pax_global_header00006660000000000000000000000064136060553040014514gustar00rootroot0000000000000052 comment=e537f2c230d113890215d35e6ac90f9981d8e832 azure-devops-cli-extension-0.17.0/000077500000000000000000000000001360605530400170045ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.azure-pipelines/000077500000000000000000000000001360605530400221765ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.azure-pipelines/azure-pipelines-create-release.yml000066400000000000000000000056661360605530400307310ustar00rootroot00000000000000# This pipeline is used to do new release of Azure DevOps CLI extension # This # 1. Runs test cases # 2. Creates a wheel and publishes it as artifact # 3. Creates a tag in github pr: none trigger: none jobs: - job: 'Build_Publish_Azure_DevOps_CLI_Extension' pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/build-publish-azure-devops-cli-extension.yml - job: 'Build_Publish_Azure_CLI_Test_SDK' pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/build-publish-azure-cli-test-sdk.yml - job: 'Run_Test' dependsOn : Build_Publish_Azure_CLI_Test_SDK pool: vmImage: 'macOS-10.13' steps: - template: templates/run-tests.yml parameters: pythonVersion: '3.x' - script: 'pip install .' displayName: 'Install the whl locally' workingDirectory: 'azure-devops/' - task: PythonScript@0 displayName : 'setupVersion' name: 'setupVersion' inputs: scriptSource: 'inline' script: | from azext_devops.version import VERSION print("##vso[task.setvariable variable=CLIVersion;isOutput=true]"+VERSION) print("##vso[task.setvariable variable=RTitle;isOutput=true]"+'Azure DevOps CLI extension for Azure CLI ' + VERSION) - job: 'Calculate_Sha_And_Create_Release' dependsOn : Run_Test pool: vmImage: 'vs2017-win2016' variables: CLIVersion: $[dependencies.Run_Test.outputs['setupVersion.CLIVersion']] RTitle: $[dependencies.Run_Test.outputs['setupVersion.RTitle']] steps: - task: DownloadBuildArtifacts@0 displayName : 'Download Extension wheel from Build Artifacts' inputs: buildType: 'current' downloadType: 'single' artifactName: 'azure-devops-cli-extension' downloadPath: '$(System.ArtifactsDirectory)/extension' - task: PowerShell@2 displayName: 'Calculate Sha for downloaded extension' inputs: targetType: 'inline' script: | $extensions = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName Foreach ($extension in $extensions) { Write-Host "calculating sha for " $extension.FullName certutil -hashfile $extension.FullName sha256 } Write-Host "done" workingDirectory: '$(System.ArtifactsDirectory)/extension' - task: GitHubRelease@0 inputs: gitHubConnection: Gsaral repositoryName: Azure/azure-devops-cli-extension action: 'create' target: '$(Build.SourceVersion)' tagSource: manual tag: $(Build.BuildNumber) title: $(RTitle) assets: '$(System.ArtifactsDirectory)/extension/**/*.whl' assetUploadMode: 'delete' isDraft: true isPreRelease: false addChangeLog: true azure-devops-cli-extension-0.17.0/.azure-pipelines/azure-pipelines-live-test-run.yml000066400000000000000000000036641360605530400305620ustar00rootroot00000000000000# This pipeline # 1. Scheduled to run UTC midnight everyday # 2. Makes sure master branch is in healthy state (run live tests) trigger: none pr: none schedules: - cron: "0 0 * * *" displayName: Daily midnight build branches: include: - master always: true jobs: - job: 'Build_Publish_Azure_DevOps_CLI_Extension' pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/build-publish-azure-devops-cli-extension.yml - job: 'Build_Publish_Azure_CLI_Test_SDK' pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/build-publish-azure-cli-test-sdk.yml - job: 'Run_Test_Ubuntu' dependsOn : [ 'Build_Publish_Azure_CLI_Test_SDK', 'Build_Publish_Azure_DevOps_CLI_Extension'] pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '$(python.version)' - template: templates/install-azure-cli-edge.yml - template: templates/download-install-local-azure-test-sdk.yml - template: templates/setup-ci-machine.yml - template: templates/download-install-local-azure-devops-cli-extension.yml # Run a Python script. - task: PythonScript@0 inputs: scriptSource: 'filePath' scriptPath: 'scripts/prepareLiveRecordingTestsRun.py' failOnStderr: true env: AZURE_DEVOPS_EXT_PAT: $(pat) - script: pytest tests --junitxml "TEST-results.xml" displayName: 'Run Live Tests' env: AZURE_DEVOPS_EXT_PAT: $(pat) - task: PublishTestResults@2 displayName: 'Publish Test Results' inputs: testResultsFormat: 'JUnit' testResultsFiles: '**TEST-*.xml' searchFolder: '$(System.DefaultWorkingDirectory)' condition: succeededOrFailed() azure-devops-cli-extension-0.17.0/.azure-pipelines/azure-pipelines-merge.yml000066400000000000000000000144051360605530400271360ustar00rootroot00000000000000# This pipeline # 1. Runs when a merge happens to working branch # 2. Makes sure working branch is in healthy state (run tests across platforms) # 3. Run style check and code coverage trigger: - master pr: none jobs: - job: 'Build_Publish_Azure_DevOps_CLI_Extension' pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/build-publish-azure-devops-cli-extension.yml - job: 'Build_Publish_Azure_CLI_Test_SDK' pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/build-publish-azure-cli-test-sdk.yml - job: 'Run_Test_Windows' dependsOn : [ 'Build_Publish_Azure_CLI_Test_SDK', 'Build_Publish_Azure_DevOps_CLI_Extension'] pool: vmImage: 'vs2017-win2016' steps: - task: PowerShell@2 inputs: targetType: 'inline' script : 'ren "C:\Program Files\Common Files\AzureCliExtensionDirectory" "C:\Program Files\Common Files\AzureCliExtensionDirectory1"' - template: templates/run-tests.yml parameters: pythonVersion: '3.x' - script: 'python setup.py sdist bdist_wheel' displayName: 'Build wheel for Azure DevOps CLI extension' workingDirectory: 'azure-devops/' - task: AzureFileCopy@2 displayName: 'Publish wheel to azure storage' inputs: sourcePath: 'azure-devops/dist/azure_devops-0.17.0-py2.py3-none-any.whl' azureConnectionType: 'ConnectedServiceNameARM' azureSubscription: 'CodeLens_Test (6bd70c51-ff44-4c89-9212-8d3f10e2a90a)' destination: 'azureBlob' storage: 'azuredevopscli' containerName: 'azuredevopscli' - job: 'Run_Test_Ubuntu' dependsOn: ['Build_Publish_Azure_CLI_Test_SDK','Build_Publish_Azure_DevOps_CLI_Extension'] pool: vmImage: 'Ubuntu-16.04' strategy: matrix: Python27: python.version: '2.x' Python36: python.version: '3.6.x' Python37: python.version: '3.x' maxParallel: 3 steps: - bash: sudo rm -R -f /usr/local/lib/azureExtensionDir - template: templates/run-tests.yml parameters: pythonVersion: '$(python.version)' - job: 'Run_Test_Mac' dependsOn: ['Build_Publish_Azure_CLI_Test_SDK','Build_Publish_Azure_DevOps_CLI_Extension'] pool: vmImage: 'macOS-10.13' steps: - template: templates/run-tests.yml parameters: pythonVersion: '3.x' - job: 'Run_Test_Mac_Azure_CLI_Released_Version' dependsOn : Build_Publish_Azure_CLI_Test_SDK pool: vmImage: 'macOS-10.13' steps: - template: templates/run-tests.yml parameters: pythonVersion: '3.x' runWithAzureCliReleased: 'true' - job: 'Code_Coverage' dependsOn: 'Build_Publish_Azure_CLI_Test_SDK' pool: vmImage: 'macOS-10.13' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/install-azure-cli-edge.yml - template: templates/download-install-local-azure-test-sdk.yml - template: templates/setup-ci-machine.yml - template: templates/download-install-local-azure-devops-cli-extension.yml - script: pytest --junitxml "TEST-UT-results.xml" --cov=azext_devops/dev --cov-report=xml --cov-report=html displayName: 'run unit tests for code coverage' workingDirectory: 'azure-devops' - script: pip install beautifulsoup4 displayName: 'install beautifulsoup4' - task: PythonScript@0 inputs: scriptSource: 'filePath' # Options: filePath, inline scriptPath: 'scripts/fixCodeCoverageStyle.py' - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'cobertura' summaryFileLocation: '$(System.DefaultWorkingDirectory)/azure-devops/coverage.xml' reportDirectory: '$(System.DefaultWorkingDirectory)/azure-devops/htmlcov' additionalCodeCoverageFiles: '$(System.DefaultWorkingDirectory)/azure-devops/htmlcov/**/*.*' - job: 'Run_Style_Check' pool: vmImage: 'macOS-10.13' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/install-azure-cli-edge.yml - template: templates/download-install-local-azure-test-sdk.yml - template: templates/setup-ci-machine.yml - template: templates/download-install-local-azure-devops-cli-extension-with-pip.yml - task: PowerShell@2 displayName: 'Run Style Check' inputs: targetType: 'filePath' filePath: 'scripts/runStyleCheck.ps1' - job: 'Run_HelpText_Check' dependsOn: 'Build_Publish_Azure_CLI_Test_SDK' pool: vmImage: 'macOS-10.13' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/install-azure-cli-edge.yml - template: templates/download-install-local-azure-test-sdk.yml - template: templates/setup-ci-machine.yml - script: 'pip install --upgrade .' displayName: 'Install Azure DevOps CLI extension' workingDirectory: 'azure-devops/' - task: PythonScript@0 displayName: 'Run HelpText Check' inputs: scriptSource: 'filePath' scriptPath: 'scripts/findEmptyHelpTexts.py' #- job: 'Run_Test_From_Old_Release' # dependsOn : Build_Publish_Azure_CLI_Test_SDK # pool: # vmImage: 'macOS-10.13' # # steps: # - script: git checkout release-0.16.0 # # - template: templates/run-tests.yml # parameters: # pythonVersion: '3.x' # runOnlyRecordedTests: 'true' - job: 'Check_Back_Compat_Arguments' pool: vmImage: 'vs2017-win2016' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/install-azure-cli-edge.yml - script: 'python setup.py sdist bdist_wheel' displayName: 'Build wheel for Azure DevOps CLI extension' workingDirectory: 'azure-devops/' - task: PythonScript@0 displayName: 'Run Back Compat Argument Check' inputs: scriptSource: 'filePath' scriptPath: 'scripts/backCompatChecker.py' - job: 'Run_Markdown_Lint_Check' pool: vmImage: 'vs2017-win2016' steps: - script: gem install mdl displayName: 'Install markdown lint' - script: mdl . -c .mdlrc displayName: 'Run markdown lint' azure-devops-cli-extension-0.17.0/.azure-pipelines/azure-pipelines-pr.yml000066400000000000000000000131221360605530400264530ustar00rootroot00000000000000# This pipeline # 1. Runs when a PR is raised against working branch # 2. Makes sure working branch is in healthy state (run tests across platforms) # 3. Run style check and code coverage pr: - master trigger: none jobs: - job: 'Build_Publish_Azure_DevOps_CLI_Extension' pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/build-publish-azure-devops-cli-extension.yml - job: 'Build_Publish_Azure_CLI_Test_SDK' pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/build-publish-azure-cli-test-sdk.yml - job: 'Run_Test_Ubuntu' dependsOn : Build_Publish_Azure_CLI_Test_SDK pool: vmImage: 'Ubuntu-16.04' strategy: matrix: Python27: python.version: '2.x' Python36: python.version: '3.6.x' Python37: python.version: '3.x' maxParallel: 3 steps: - bash: sudo rm -R -f /usr/local/lib/azureExtensionDir - template: templates/run-tests.yml parameters: pythonVersion: '$(python.version)' - job: 'Run_Test_Mac' dependsOn : Build_Publish_Azure_CLI_Test_SDK pool: vmImage: 'macOS-10.13' steps: - template: templates/run-tests.yml parameters: pythonVersion: '3.x' - job: 'Run_Test_Mac_Azure_CLI_Released_Version' dependsOn : Build_Publish_Azure_CLI_Test_SDK pool: vmImage: 'macOS-10.13' steps: - template: templates/run-tests.yml parameters: pythonVersion: '3.x' runWithAzureCliReleased: 'true' - job: 'Run_Test_Windows' dependsOn : Build_Publish_Azure_CLI_Test_SDK pool: vmImage: 'vs2017-win2016' steps: - task: PowerShell@2 inputs: targetType: 'inline' script : 'ren "C:\Program Files\Common Files\AzureCliExtensionDirectory" "C:\Program Files\Common Files\AzureCliExtensionDirectory1"' - template: templates/run-tests.yml parameters: pythonVersion: '3.x' - job: 'Code_Coverage' dependsOn: 'Build_Publish_Azure_CLI_Test_SDK' pool: vmImage: 'macOS-10.13' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/install-azure-cli-edge.yml - template: templates/download-install-local-azure-test-sdk.yml - template: templates/setup-ci-machine.yml - template: templates/download-install-local-azure-devops-cli-extension.yml - script: pytest --junitxml "TEST-UT-results.xml" --cov=azext_devops/dev --cov-report=xml --cov-report=html displayName: 'run unit tests for code coverage' workingDirectory: 'azure-devops' - script: pip install beautifulsoup4 displayName: 'install beautifulsoup4' - task: PythonScript@0 inputs: scriptSource: 'filePath' # Options: filePath, inline scriptPath: 'scripts/fixCodeCoverageStyle.py' - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: 'cobertura' summaryFileLocation: '$(System.DefaultWorkingDirectory)/azure-devops/coverage.xml' reportDirectory: '$(System.DefaultWorkingDirectory)/azure-devops/htmlcov' additionalCodeCoverageFiles: '$(System.DefaultWorkingDirectory)/azure-devops/htmlcov/**/*.*' - job: 'Run_Style_Check' pool: vmImage: 'macOS-10.13' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/install-azure-cli-edge.yml - template: templates/download-install-local-azure-test-sdk.yml - template: templates/setup-ci-machine.yml - template: templates/download-install-local-azure-devops-cli-extension-with-pip.yml - task: PowerShell@2 displayName: 'Run Style Check' inputs: targetType: 'filePath' filePath: 'scripts/runStyleCheck.ps1' - job: 'Run_HelpText_Check' dependsOn: 'Build_Publish_Azure_CLI_Test_SDK' pool: vmImage: 'macOS-10.13' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/install-azure-cli-edge.yml - template: templates/download-install-local-azure-test-sdk.yml - template: templates/setup-ci-machine.yml - script: 'pip install --upgrade .' displayName: 'Install Azure DevOps CLI extension' workingDirectory: 'azure-devops/' - task: PythonScript@0 displayName: 'Run HelpText Check' inputs: scriptSource: 'filePath' scriptPath: 'scripts/findEmptyHelpTexts.py' #- job: 'Run_Test_From_Old_Release' # dependsOn : Build_Publish_Azure_CLI_Test_SDK # pool: # vmImage: 'macOS-10.13' # # steps: # - script: git checkout release-0.16.0 # # - template: templates/run-tests.yml # parameters: # pythonVersion: '3.x' # runOnlyRecordedTests: 'true' - job: 'Check_Back_Compat_Arguments' pool: vmImage: 'vs2017-win2016' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/install-azure-cli-edge.yml - script: 'python setup.py sdist bdist_wheel' displayName: 'Build wheel for Azure DevOps CLI extension' workingDirectory: 'azure-devops/' - task: PythonScript@0 displayName: 'Run Back Compat Argument Check' inputs: scriptSource: 'filePath' scriptPath: 'scripts/backCompatChecker.py' - job: 'Run_Markdown_Lint_Check' pool: vmImage: 'vs2017-win2016' steps: - script: gem install mdl displayName: 'Install markdown lint' - script: mdl . -c .mdlrc displayName: 'Run markdown lint'azure-devops-cli-extension-0.17.0/.azure-pipelines/azure-pipelines-released-version.yml000066400000000000000000000026551360605530400313120ustar00rootroot00000000000000# This is used to test if the released version is in healthy state or not # Runs everyday midnight UTC pr: none trigger: none schedules: - cron: "0 0 * * *" displayName: Daily midnight build branches: include: - release-0.16.0 always: true jobs: - job: 'Build_Publish_Azure_CLI_Test_SDK' pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/setup-ci-machine.yml - template: templates/build-publish-azure-cli-test-sdk.yml - job: 'Run_Test' dependsOn : Build_Publish_Azure_CLI_Test_SDK pool: vmImage: 'Ubuntu-16.04' steps: - task: UsePythonVersion@0 inputs: versionSpec: '3.x' architecture: 'x64' - template: templates/install-azure-cli-edge.yml - template: templates/download-install-local-azure-test-sdk.yml - template: templates/setup-ci-machine.yml - task: CmdLine@2 displayName: 'Install azure devops extension from azure cli index' inputs: script: 'az extension add -n azure-devops --debug' - script: pytest --junitxml "TEST-results.xml" displayName: 'Run Tests' - task: PublishTestResults@2 displayName: 'Publish Test Results' inputs: testResultsFormat: 'JUnit' testResultsFiles: '**TEST-*.xml' searchFolder: '$(System.DefaultWorkingDirectory)/' condition: succeededOrFailed()azure-devops-cli-extension-0.17.0/.azure-pipelines/templates/000077500000000000000000000000001360605530400241745ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.azure-pipelines/templates/build-publish-azure-cli-test-sdk.yml000066400000000000000000000013421360605530400331070ustar00rootroot00000000000000steps: - script: 'rm -rf azure-cli' displayName: 'delete azure cli directory' - script: 'git clone https://github.com/Azure/azure-cli.git' displayName: 'Clone Azure CLI repository' - script: 'pip install --upgrade .' displayName: 'Install Azure CLI test SDK' workingDirectory: 'azure-cli/src/azure-cli-testsdk/' - script: 'python setup.py sdist bdist_wheel' displayName: 'Build wheel for Azure CLI test SDK' workingDirectory: 'azure-cli/src/azure-cli-testsdk/' - task: PublishBuildArtifacts@1 displayName: 'Publish Azure CLI test SDK as artifact' inputs: pathtoPublish: 'azure-cli/src/azure-cli-testsdk/dist' artifactName: 'azure-cli-test-sdk' publishLocation: 'Container'build-publish-azure-devops-cli-extension.yml000066400000000000000000000012671360605530400346120ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.azure-pipelines/templatessteps: - script: 'pip install --upgrade .' displayName: 'Install Azure DevOps CLI extension' workingDirectory: 'azure-devops/' - task: PythonScript@0 displayName: 'Remove code comments from SDK files' inputs: scriptSource: 'filePath' scriptPath: 'scripts/removeComments.py' - script: 'python setup.py sdist bdist_wheel' displayName: 'Build wheel for Azure DevOps CLI extension' workingDirectory: 'azure-devops/' - task: PublishBuildArtifacts@1 displayName: 'Publish Azure DevOps CLI extension as artifact' inputs: pathtoPublish: 'azure-devops/dist' artifactName: 'azure-devops-cli-extension' publishLocation: 'Container'download-install-local-azure-devops-cli-extension-with-pip.yml000066400000000000000000000013621360605530400401450ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.azure-pipelines/templatessteps: - task: DownloadBuildArtifacts@0 displayName : 'Download Extension wheel from Build Artifacts' inputs: buildType: 'current' downloadType: 'single' artifactName: 'azure-devops-cli-extension' downloadPath: '$(System.ArtifactsDirectory)/extension' - task: PowerShell@2 displayName: 'Install Downloaded Extension' inputs: targetType: 'inline' script: | $extensions = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName Foreach ($extension in $extensions) { Write-Host "installing " $extension.FullName pip install $extension.FullName } Write-Host "done" workingDirectory: '$(System.ArtifactsDirectory)/extension'download-install-local-azure-devops-cli-extension.yml000066400000000000000000000014131360605530400364030ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.azure-pipelines/templatessteps: - task: DownloadBuildArtifacts@0 displayName : 'Download Extension wheel from Build Artifacts' inputs: buildType: 'current' downloadType: 'single' artifactName: 'azure-devops-cli-extension' downloadPath: '$(System.ArtifactsDirectory)/extension' - task: PowerShell@2 displayName: 'Install Downloaded Extension' inputs: targetType: 'inline' script: | $extensions = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName Foreach ($extension in $extensions) { Write-Host "installing " $extension.FullName az extension add --source $extension.FullName -y --debug } Write-Host "done" workingDirectory: '$(System.ArtifactsDirectory)/extension'download-install-local-azure-test-sdk.yml000066400000000000000000000013251360605530400340640ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.azure-pipelines/templatessteps: - task: DownloadBuildArtifacts@0 displayName : 'Download Azure CLI test SDK wheel from Build Artifacts' inputs: buildType: 'current' downloadType: 'single' artifactName: 'azure-cli-test-sdk' downloadPath: '$(System.ArtifactsDirectory)/wheels' - task: PowerShell@2 displayName: 'Install Downloaded Wheels' inputs: targetType: 'inline' script: | $wheels = Get-ChildItem -Filter "*.whl" -Recurse | Select-Object FullName Foreach ($wheel in $wheels) { Write-Host "installing" $wheel.FullName pip install $wheel.FullName } Write-Host "done" workingDirectory: '$(System.ArtifactsDirectory)/wheels'azure-devops-cli-extension-0.17.0/.azure-pipelines/templates/install-azure-cli-edge.yml000066400000000000000000000012111360605530400311530ustar00rootroot00000000000000steps: - script: 'python -m pip install --upgrade pip' displayName: 'Upgrade pip' - script: 'python --version' displayName: 'Display Python version' - script: 'az --version' displayName: 'Display az version before update' - script: 'pip uninstall azure-cli -y' displayName: 'Remove Azure CLI' - script: 'pip install --pre azure-cli --extra-index-url https://azurecliprod.blob.core.windows.net/edge --upgrade-strategy eager' displayName: 'Install Azure CLI Edge' - script: 'python --version' displayName: 'Display Python version' - script: 'az --version' displayName: 'Display az version after update' azure-devops-cli-extension-0.17.0/.azure-pipelines/templates/install-azure-cli-released.yml000066400000000000000000000001361360605530400320400ustar00rootroot00000000000000steps: - script: pip install azure-cli displayName: 'Install Azure CLI released version'azure-devops-cli-extension-0.17.0/.azure-pipelines/templates/run-tests.yml000066400000000000000000000021671360605530400266710ustar00rootroot00000000000000parameters: pythonVersion: '' runOnlyRecordedTests: 'false' runWithAzureCliReleased: 'false' steps: - task: UsePythonVersion@0 inputs: versionSpec: ${{ parameters.pythonVersion }} architecture: 'x64' - ${{ if eq(parameters.runWithAzureCliReleased, 'false') }}: - template: install-azure-cli-edge.yml - ${{ if eq(parameters.runWithAzureCliReleased, 'true') }}: - template: install-azure-cli-released.yml - template: download-install-local-azure-test-sdk.yml - template: setup-ci-machine.yml - template: download-install-local-azure-devops-cli-extension.yml - ${{ if eq(parameters.runOnlyRecordedTests, 'false') }}: - script: pytest --junitxml "TEST-results.xml" displayName: 'Run Tests' - ${{ if eq(parameters.runOnlyRecordedTests, 'true') }}: - script: pytest tests --junitxml "TEST-results.xml" displayName: 'Run Tests' - task: PublishTestResults@2 displayName: 'Publish Test Results' inputs: testResultsFormat: 'JUnit' testResultsFiles: '**TEST-*.xml' searchFolder: '$(System.DefaultWorkingDirectory)' condition: succeededOrFailed()azure-devops-cli-extension-0.17.0/.azure-pipelines/templates/setup-ci-machine.yml000066400000000000000000000005361360605530400300560ustar00rootroot00000000000000steps: - script: python -m pip install --upgrade pip displayName: 'Upgrade pip' - script: pip install wheel==0.30.0 displayName: 'Install Wheel' - script: pip install pytest==4.6.6 displayName: 'Install pytest' - script: pip install coverage displayName: 'Install coverage' - script: pip install pytest-cov displayName: 'Install pytest-cov'azure-devops-cli-extension-0.17.0/.flake8000066400000000000000000000011351360605530400201570ustar00rootroot00000000000000[flake8] max-line-length = 120 max-complexity = 10 ignore = E501, # line too long, it is covered by pylint E722, # bare except, bad practice, to be removed in the future F401, # imported but unused, too many violations, to be removed in the future F811, # redefinition of unused, to be removed in the future C901, # code flow is too complex, too many violations, to be removed in the future W504 # line break after binary operator effect on readability is subjective exclude = tests build tools scripts doc build_scripts */test/* */devops_sdk/*azure-devops-cli-extension-0.17.0/.gitattributes000066400000000000000000000004331360605530400216770ustar00rootroot00000000000000# Set the default behavior (used when a rule below doesn't match) * text=auto *.sln -text *.ico -text *.bmp -text *.png -text *.snk -text *.mht -text *.pickle -text # Some Windows-specific files should always be CRLF *.bat eol=crlf # Shell scripts *.sh eol=lf *.completion eol=lf azure-devops-cli-extension-0.17.0/.github/000077500000000000000000000000001360605530400203445ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.github/CODEOWNERS000066400000000000000000000005071360605530400217410ustar00rootroot00000000000000# Instructions about authoring this file - https://help.github.com/en/articles/about-code-owners # These owners will be the default owners for everything in # the repo. Unless a later match takes precedence, * @atbagga @gauravsaralMs @ishitam8 # Owner for /doc directory in the root of your repository /doc/ @geverghe azure-devops-cli-extension-0.17.0/.github/ISSUE_TEMPLATE/000077500000000000000000000000001360605530400225275ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.github/ISSUE_TEMPLATE/bug_report.md000066400000000000000000000015101360605530400252160ustar00rootroot00000000000000--- name: Bug report about: Create a report to help us improve title: "[Bug] " labels: 'bug, Area: ProToCol' assignees: '' --- **Describe the bug** A clear and concise description of what the bug is. **To Reproduce** Azure Cli Version: Use az --version Look for something like- azure-cli (2.0.70) Azure-Devops extension version: Use az --version Look for something like- Extensions: azure-devops (0.16.0) Steps to reproduce the behavior: 1. login using az login 2. setup defaults.. 3. Run command.... 4. See error **Expected behavior** A clear and concise description of what you expected to happen. **Screenshots** If applicable, add screenshots to help explain your problem. **Debug logs** Add the output of the command running it with debug mode (--debug) **Additional context** Add any other context about the problem here. azure-devops-cli-extension-0.17.0/.github/ISSUE_TEMPLATE/feature_request.md000066400000000000000000000010311360605530400262470ustar00rootroot00000000000000--- name: Feature request about: Suggest an idea for this project title: "[Feature Request]" labels: Feature assignees: '' --- **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I cannot create a project.. **Describe the solution you'd like** A clear and concise description of what you want to happen. e.g. If you want a new command to be added, what would it do? **Additional context** Add any other context or screenshots about the feature request here. azure-devops-cli-extension-0.17.0/.github/pull_request_template.md000066400000000000000000000003041360605530400253020ustar00rootroot00000000000000Please make sure the code is following contribution guidelines in CONTRIBUTING.md - [ ] : This PR has a corresponding issue open in the Repository. - [ ] : Approach is signed off on the issue. azure-devops-cli-extension-0.17.0/.gitignore000066400000000000000000000120051360605530400207720ustar00rootroot00000000000000## Ignore Visual Studio temporary files, build results, and ## files generated by popular Visual Studio add-ons. ## ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore # User-specific files *.suo *.user *.userosscache *.sln.docstates # User-specific files (MonoDevelop/Xamarin Studio) *.userprefs # Python **/*.egg-info/ env/** env2/** venv/** dist/ lib/ # Python Tools for Visual Studio (PTVS) __pycache__/ *.pyc # Build results [Dd]ebug/ [Dd]ebugPublic/ [Rr]elease/ [Rr]eleases/ x64/ x86/ bld/ [Bb]in/ [Oo]bj/ [Ll]og/ out/ # Visual Studio 2015 cache/options directory .vs/ # Uncomment if you have tasks that create the project's static files in wwwroot #wwwroot/ # MSTest test Results [Tt]est[Rr]esult*/ [Bb]uild[Ll]og.* # NUNIT *.VisualState.xml TestResult.xml # Build Results of an ATL Project [Dd]ebugPS/ [Rr]eleasePS/ dlldata.c # .NET Core project.lock.json project.fragment.lock.json #artifacts/ **/Properties/launchSettings.json *_i.c *_p.c *_i.h *.ilk *.meta *.obj *.pch *.pdb *.pgc *.pgd *.rsp *.sbr *.tlb *.tli *.tlh *.tmp *.tmp_proj *.log *.vspscc *.vssscc .builds *.pidb *.svclog *.scc # Chutzpah Test files _Chutzpah* # Visual C++ cache files ipch/ *.aps *.ncb *.opendb *.opensdf *.sdf *.cachefile *.VC.db *.VC.VC.opendb # Visual Studio profiler *.psess *.vsp *.vspx *.sap # TFS 2012 Local Workspace $tf/ # Guidance Automation Toolkit *.gpState # ReSharper is a .NET coding add-in _ReSharper*/ *.[Rr]e[Ss]harper *.DotSettings.user # JustCode is a .NET coding add-in .JustCode # TeamCity is a build add-in _TeamCity* # DotCover is a Code Coverage Tool *.dotCover # Visual Studio code coverage results *.coverage *.coveragexml # NCrunch _NCrunch_* .*crunch*.local.xml nCrunchTemp_* # MightyMoose *.mm.* AutoTest.Net/ # Web workbench (sass) .sass-cache/ # Installshield output folder [Ee]xpress/ # DocProject is a documentation generator add-in DocProject/buildhelp/ DocProject/Help/*.HxT DocProject/Help/*.HxC DocProject/Help/*.hhc DocProject/Help/*.hhk DocProject/Help/*.hhp DocProject/Help/Html2 DocProject/Help/html # Click-Once directory publish/ # Publish Web Output *.[Pp]ublish.xml *.azurePubxml # TODO: Comment the next line if you want to checkin your web deploy settings # but database connection strings (with potential passwords) will be unencrypted *.pubxml *.publishproj # Microsoft Azure Web App publish settings. Comment the next line if you want to # checkin your Azure Web App publish settings, but sensitive information contained # in these scripts will be unencrypted PublishScripts/ # NuGet Packages *.nupkg # The packages folder can be ignored because of Package Restore **/packages/* # except build/, which is used as an MSBuild target. !**/packages/build/ # Uncomment if necessary however generally it will be regenerated when needed #!**/packages/repositories.config # NuGet v3's project.json files produces more ignorable files *.nuget.props *.nuget.targets # Microsoft Azure Build Output csx/ *.build.csdef # Microsoft Azure Emulator ecf/ rcf/ # Windows Store app package directories and files AppPackages/ BundleArtifacts/ Package.StoreAssociation.xml _pkginfo.txt # Visual Studio cache files # files ending in .cache can be ignored *.[Cc]ache # but keep track of directories ending in .cache !*.[Cc]ache/ # Others ClientBin/ ~$* *~ *.dbmdl *.dbproj.schemaview *.jfm *.pfx *.publishsettings orleans.codegen.cs # Since there are multiple workflows, uncomment next line to ignore bower_components # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) #bower_components/ # RIA/Silverlight projects Generated_Code/ # Backup & report files from converting an old project file # to a newer Visual Studio version. Backup files are not needed, # because we have git ;-) _UpgradeReport_Files/ Backup*/ UpgradeLog*.XML UpgradeLog*.htm # SQL Server files *.mdf *.ldf *.ndf # Business Intelligence projects *.rdl.data *.bim.layout *.bim_*.settings # Microsoft Fakes FakesAssemblies/ # GhostDoc plugin setting file *.GhostDoc.xml # Node.js Tools for Visual Studio .ntvs_analysis.dat node_modules/ # Typescript v1 declaration files typings/ # Visual Studio 6 build log *.plg # Visual Studio 6 workspace options file *.opt # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) *.vbw # Visual Studio LightSwitch build output **/*.HTMLClient/GeneratedArtifacts **/*.DesktopClient/GeneratedArtifacts **/*.DesktopClient/ModelManifest.xml **/*.Server/GeneratedArtifacts **/*.Server/ModelManifest.xml _Pvt_Extensions # Paket dependency manager .paket/paket.exe paket-files/ # FAKE - F# Make .fake/ # JetBrains Rider .idea/ *.sln.iml # CodeRush .cr/ # Cake - Uncomment if you are using it # tools/** # !tools/packages.config # Telerik's JustMock configuration file *.jmconfig # BizTalk build output *.btp.cs *.btm.cs *.odx.cs *.xsd.cs #pytest .pytest_cache/ #vscode .vscode/* # Except for the release folders which contains vsts release code !azure-devops/azext_devops/devops_sdk/*/release/ azure-devops/azext_devops/devops_sdk/*/release/release/__pycache__ azure-devops-cli-extension-0.17.0/.mdlrc000066400000000000000000000000431360605530400201030ustar00rootroot00000000000000rules "~MD013", "~MD033", "~MD046" azure-devops-cli-extension-0.17.0/.vscode/000077500000000000000000000000001360605530400203455ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/.vscode/launch.json000066400000000000000000000020121360605530400225050ustar00rootroot00000000000000{ "version": "0.2.0", "configurations": [ { "name": "Azure DevOps CLI Debug (Integrated Console)", "type": "python", "request": "launch", "pythonPath": "${config:python.pythonPath}", "program": "${workspaceRoot}/scripts/run_az.py", "cwd": "${workspaceRoot}/azure-devops/", "args": [ "devops", "project", "list", "--org", "https://dev.azure.com/mseng/", "--state-filter", "all", "-o", "json" ], "console": "integratedTerminal", "debugOptions": [ "WaitOnAbnormalExit", "WaitOnNormalExit", "RedirectOutput" ], "debugStdLib": true, "preLaunchTask": "BuildWheel", "env": { "AZURE_EXTENSION_DIR": "${workspaceRoot}" } } ] } azure-devops-cli-extension-0.17.0/.vscode/settings.json000066400000000000000000000000551360605530400231000ustar00rootroot00000000000000{ "python.testing.pytestEnabled": true, }azure-devops-cli-extension-0.17.0/.vscode/tasks.json000066400000000000000000000035551360605530400223750ustar00rootroot00000000000000{ "version": "2.0.0", "tasks": [ { "label": "BuildWheel", "command": "${config:python.pythonPath}", "args": [ "setup.py", "sdist", "bdist_wheel" ], "type": "shell", "options": { "cwd": "${workspaceRoot}/azure-devops/" }, "presentation": { "echo": true, "reveal": "never", "focus": false, "panel": "shared", "showReuseMessage": true, "clear": false } }, { "label": "Uninstall extension", "type": "shell", "command": "az extension remove -n azure-devops", "options": { "cwd": "${workspaceRoot}/azure-devops/" }, "group": "build", "problemMatcher": [] }, { "label": "Install extension", "type": "shell", "command": "az extension add --source ./dist/azure_devops-0.17.0-py2.py3-none-any.whl -y", "windows": { "command": "az extension add --source .\\dist\\azure_devops-0.17.0-py2.py3-none-any.whl -y", }, "options": { "cwd": "${workspaceRoot}/azure-devops/" }, "dependsOn": [ "BuildWheel" ], "group": "build", "problemMatcher": [] }, { "label": "Update extension", "type": "shell", "command": "az extension add --source ./dist/azure_devops-0.17.0-py2.py3-none-any.whl -y", "windows": { "command": "az extension add --source .\\dist\\azure_devops-0.17.0-py2.py3-none-any.whl -y", }, "options": { "cwd": "${workspaceRoot}/azure-devops/" }, "dependsOn": [ "Uninstall extension", "BuildWheel" ], "group": "build", "problemMatcher": [] } ] } azure-devops-cli-extension-0.17.0/CONTRIBUTING.md000066400000000000000000000076141360605530400212450ustar00rootroot00000000000000# Contribute to the Azure DevOps Extension Thank you for your interest in contributing to the Azure DevOps Extension! There are many ways in which you can contribute, beyond writing code. The goal of this document is to provide a high-level overview of how you can get involved. ## Have a question Search existing github [issues](https://github.com/Microsoft/azure-devops-cli-extension/issues?q=is%3Aopen+is%3Aissue+label%3Aquestion) for similar questions first, and feel free to file an issue with a "question" tag to get our attention. ## Found a bug ### Where to find known issues Check open [issues](https://github.com/Microsoft/azure-devops-cli-extension/issues?q=is%3Aopen+is%3Aissue+label%3Abug) before you file a new bug report. If you find your issue already exists, make relevant comments and add your reaction. Use a reaction in place of a "+1" comment: 👍 - upvote 👎 - downvote ### Report new issue The best way to get your bug fixed is to provide good repro steps. Use our [Bug template](https://github.com/Microsoft/azure-devops-cli-extension/issues/new/choose) to report any issues. ## Feature requests ### Where to find existing requests Check open [feature requests](https://github.com/Microsoft/azure-devops-cli-extension/issues?q=is%3Aissue+is%3Aopen+label%3AFeature) before you file a new request. If you find your request already exists, make relevant comments and add your reaction. Use a reaction in place of a "+1" comment: 👍 - upvote 👎 - downvote ### Submit New Feature request Use our Feature Request [template](https://github.com/Microsoft/azure-devops-cli-extension/issues/new/choose) to create a new feature request. ## Get started Unsure where to begin contributing? You can start by looking through these beginner and help-wanted issues: - [Beginner issues](https://github.com/Microsoft/azure-devops-cli-extension/issues?q=is%3Aissue+is%3Aopen+label%3ABeginner) - issues which should only require a few lines of code, and a test or two. - [Help wanted issues](https://github.com/Microsoft/azure-devops-cli-extension/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) - issues which should be a bit more involved than beginner issues. Refer our [Developer setup](./doc/dev_setup.md) instructions to get started with code and running tests. ### Code of Conduct This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)with any additional questions or comments. ### Pull Request etiquette #### Guidelines - Every contribution (PR) needs to have an issue referenced - Approach(s) should be discussed and closed in the issue itself before raising a PR - We use pylint and flake8 to have consistent coding styles followed. This is taken care in the Pull request checks. #### If PR contains new commands - Recorded tests are mandatory - UTs are mandatory - Command signature should be discussed and approved in referenced issue. [Sample](https://github.com/Microsoft/azure-devops-cli-extension/issues/319) - Table transforms are present (reviewed in PR) - Help text is present for commands and parameters #### If PR contains point fixes - UTs are mandatory ### CLA requirements You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. Submit a Contributor License Agreement (CLA) before submitting a pull request. You may visit [https://cla.microsoft.com](https://cla.microsoft.com) to sign digitally. ## Thank you Your contributions to open source, large or small, make great projects like this possible. Thank you for taking the time to contribute.azure-devops-cli-extension-0.17.0/LICENSE000066400000000000000000000022121360605530400200060ustar00rootroot00000000000000 MIT License Copyright (c) Microsoft Corporation. All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE azure-devops-cli-extension-0.17.0/README.md000066400000000000000000000074311360605530400202700ustar00rootroot00000000000000# Azure DevOps Extension for Azure CLI [![Build Status](https://dev.azure.com/ms/azure-devops-cli-extension/_apis/build/status/Azure%20DevOps%20CLI%20-%20Merge%20GitHub?branchName=master)](https://dev.azure.com/ms/azure-devops-cli-extension/_build/latest?definitionId=39&branchName=master) The Azure DevOps Extension for Azure CLI adds Pipelines, Boards, Repos, Artifacts and DevOps commands to the Azure CLI 2.0. >The Azure CLI with the Azure DevOps Extension has replaced the VSTS CLI. The VSTS CLI has been deprecated and will no longer be receiving new features. We recommend that users of the VSTS CLI switch to the Azure CLI and add the Azure DevOps extension. See the [Command Mapping](/doc/command_mapping.md) section to view the mapping between VSTS CLI and Azure DevOps Extension commands. ## Quick start 1. [Install the Azure CLI](https://docs.microsoft.com/cli/azure/install-azure-cli). You must have at least `v2.0.69`, which you can verify with `az --version` command. 1. Add the Azure DevOps Extension `az extension add --name azure-devops` 1. Run the `az login` command. If the CLI can open your default browser, it will do so and load a sign-in page. Otherwise, you need to open a browser page and follow the instructions on the command line to enter an authorization code after navigating to [https://aka.ms/devicelogin](https://aka.ms/devicelogin) in your browser. For more information, see the [Azure CLI login page](https://docs.microsoft.com/cli/azure/authenticate-azure-cli?view=azure-cli-latest). See the [Get started guide](https://docs.microsoft.com/azure/devops/cli/get-started?view=azure-devops) for detailed setup instructions. ## Usage ```bash $az [group] [subgroup] [command] {parameters} ``` Adding the Azure DevOps Extension adds `devops`, `pipelines`, `artifacts`, `boards` and `repos` groups. For usage and help content for any command, pass in the -h parameter, for example: ```bash $ az devops -h Group az devops : Manage Azure DevOps organization level operations. Related Groups az pipelines: Manage Azure Pipelines az boards: Manage Azure Boards az repos: Manage Azure Repos az artifacts: Manage Azure Artifacts. Subgroups: admin : Manage administration operations. extension : Manage extensions. project : Manage team projects. security : Manage security related operations. service-endpoint : Manage service endpoints/service connections. team : Manage teams. user : Manage users. wiki : Manage wikis. Commands: configure : Configure the Azure DevOps CLI or view your configuration. feedback : Displays information on how to provide feedback to the Azure DevOps CLI team. invoke : This command will invoke request for any DevOps area and resource. Please use only json output as the response of this command is not fixed. Helpful docs - https://docs.microsoft.com/en-us/rest/api/azure/devops/. login : Set the credential (PAT) to use for a particular organization. logout : Clear the credential for all or a particular organization. ``` - Checkout the CLI docs at [docs.microsoft.com - Azure DevOps CLI](https://docs.microsoft.com/azure/devops/cli/). - Check out other examples in the [How-to guides](https://docs.microsoft.com/azure/devops/cli/?view=azure-devops#how-to-guides) section. - You can view the various commands and its usage here - [docs.microsoft.com - Azure DevOps Extension Reference](https://docs.microsoft.com/cli/azure/ext/azure-devops/?view=azure-cli-latest) ## Contribute See our [contribution guidelines](CONTRIBUTING.md) to learn how you can contribute to this project. ## License [MIT License](LICENSE) azure-devops-cli-extension-0.17.0/azure-devops/000077500000000000000000000000001360605530400214305ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/HISTORY.rst000066400000000000000000000000671360605530400233260ustar00rootroot000000000000001.0.0 --------------------- * Initial preview release.azure-devops-cli-extension-0.17.0/azure-devops/README.rst000066400000000000000000000001631360605530400231170ustar00rootroot00000000000000Microsoft DevOps CLI Extension for Windows, Mac and Linux =========================================================azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/000077500000000000000000000000001360605530400241435ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/__init__.py000066400000000000000000000057231360605530400262630ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azure.cli.core import AzCommandsLoader from knack.events import EVENT_INVOKER_POST_PARSE_ARGS class DevCommandsLoader(AzCommandsLoader): def __init__(self, cli_ctx=None): from azure.cli.core.commands import CliCommandType custom_type = CliCommandType(operations_tmpl='azext_devops#{}') super(DevCommandsLoader, self).__init__(cli_ctx=cli_ctx, custom_command_type=custom_type) self.cli_ctx.register_event(event_name=EVENT_INVOKER_POST_PARSE_ARGS, handler=self.post_parse_args) def load_command_table(self, args): from azext_devops.dev.admin.commands import load_admin_commands load_admin_commands(self, args) from azext_devops.dev.boards.commands import load_work_commands load_work_commands(self, args) from azext_devops.dev.pipelines.commands import load_build_commands load_build_commands(self, args) from azext_devops.dev.repos.commands import load_code_commands load_code_commands(self, args) from azext_devops.dev.team.commands import load_team_commands load_team_commands(self, args) from azext_devops.dev.artifacts.commands import load_package_commands load_package_commands(self, args) return self.command_table def load_arguments(self, command): from azext_devops.dev.admin.arguments import load_admin_arguments load_admin_arguments(self, command) from azext_devops.dev.boards.arguments import load_work_arguments load_work_arguments(self, command) from azext_devops.dev.pipelines.arguments import load_build_arguments load_build_arguments(self, command) from azext_devops.dev.repos.arguments import load_code_arguments load_code_arguments(self, command) from azext_devops.dev.team.arguments import load_team_arguments load_team_arguments(self, command) from azext_devops.dev.artifacts.arguments import load_package_arguments load_package_arguments(self, command) @staticmethod def post_parse_args(_cli_ctx, **kwargs): if (kwargs.get('command', None) and kwargs['command'].startswith(('devops', 'boards', 'artifacts', 'pipelines', 'repos'))): from azext_devops.dev.common.telemetry import set_tracking_data # we need to set tracking data only after we know that all args are valid, # otherwise we may log EUII data that a user inadvertently sent as an argument # name. We already don't log argument values. set_tracking_data(**kwargs) COMMAND_LOADER_CLS = DevCommandsLoader azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/azext_metadata.json000066400000000000000000000000541360605530400300300ustar00rootroot00000000000000{ "azext.minCliCoreVersion": "2.0.69" } azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/conftest.py000066400000000000000000000000001360605530400263300ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/000077500000000000000000000000001360605530400247215ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/__init__.py000066400000000000000000000006301360605530400270310ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import pkg_resources pkg_resources.declare_namespace(__name__) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/admin/000077500000000000000000000000001360605530400260115ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/admin/__init__.py000066400000000000000000000007171360605530400301270ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import pkg_resources from ._help import load_admin_help pkg_resources.declare_namespace(__name__) load_admin_help() azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/admin/_format.py000066400000000000000000000022361360605530400300150ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from collections import OrderedDict def transform_banner_table_output(result): table_output = [] for k, v in result.items(): table_output.append(_transform_banner_row(k, v)) return table_output def _transform_banner_row(key, value): table_row = OrderedDict() table_row['ID'] = key if 'message' in value: table_row['Message'] = value['message'] else: table_row['Message'] = ' ' if 'level' in value: level = value['level'] if level is not None and level != '': level = level[0:1].upper() + level[1:] table_row['Type'] = level else: table_row['Type'] = 'Info' if 'expirationDate' in value: table_row['Expiration Date'] = value['expirationDate'] else: table_row['Expiration Date'] = ' ' return table_row azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/admin/_help.py000066400000000000000000000012261360605530400274530ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.help_files import helps def load_admin_help(): helps['devops admin'] = """ type: group short-summary: Manage administration operations. long-summary: """ helps['devops admin banner'] = """ type: group short-summary: Manage organization banner. long-summary: """ azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/admin/arguments.py000066400000000000000000000020121360605530400303630ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.arguments import enum_choice_list _ORGANIZATION_LICENSE_TYPES_FOR_ADD = ['advanced', 'express', 'professional', 'stakeholder'] _TYPE_FOR_BANNER = ['info', 'warning', 'error'] def load_admin_arguments(self, _): with self.argument_context('devops admin user') as context: context.argument('user_id', options_list='--id') context.argument('access_level', **enum_choice_list(_ORGANIZATION_LICENSE_TYPES_FOR_ADD)) with self.argument_context('devops admin banner') as context: context.argument('message', options_list=['-m', '--message']) context.argument('banner_type', options_list=['-t', '--type'], **enum_choice_list(_TYPE_FOR_BANNER)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/admin/banner.py000066400000000000000000000134041360605530400276320ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azext_devops.dev.common.arguments import convert_date_string_to_iso8601 from .setting import setting_add_or_update, setting_list, setting_remove, GLOBAL_MESSAGE_BANNERS_KEY, USER_SCOPE_HOST def banner_list(organization=None, detect=None): """List banners. """ return setting_list(user_scope='host', key=GLOBAL_MESSAGE_BANNERS_KEY, organization=organization, detect=detect) def banner_show(id, organization=None, detect=None): # pylint: disable=redefined-builtin """Show details for a banner. :param id: Identifier for the banner. :type id: str :rtype: [object] """ existing_entries = setting_list(user_scope='host', key=GLOBAL_MESSAGE_BANNERS_KEY, organization=organization, detect=detect) if id not in existing_entries: raise ValueError('The following banner was not found: %s' % id) return {id: existing_entries[id]} def banner_add(message, banner_type=None, id=None, expiration=None, organization=None, detect=None): # pylint: disable=redefined-builtin """Add a new banner and immediately show it. :param message: Message (string) to show in the banner. :type message: str :param banner_type: Type of banner to present. Defaults is "info". :type banner_type: str :param id: Identifier for the new banner. This identifier is needed to change or remove the message later. A unique identifier is automatically created if one is not specified. :type id: str :param expiration: Date/time when the banner should no longer be presented to users. If not set, the banner does not automatically expire and must be removed with the remove command. Example : "2019-06-10 17:21:00 UTC", "2019-06-10" :type expiration: date :rtype: [object] """ if expiration is not None: expiration_iso8601 = convert_date_string_to_iso8601(value=expiration, argument='expiration') else: expiration_iso8601 = None if id is None or id == '': import uuid id = str(uuid.uuid4()) setting_key = _get_banner_key(id) entries = { setting_key: { "message": message } } if banner_type is not None: entries[setting_key]['level'] = banner_type if expiration_iso8601 is not None: entries[setting_key]['expirationDate'] = expiration_iso8601 setting_add_or_update(entries=entries, user_scope=USER_SCOPE_HOST, organization=organization, detect=detect) return {id: entries[setting_key]} def banner_update(id, message=None, banner_type=None, expiration=None, organization=None, detect=None): # pylint: disable=redefined-builtin """Update the message, level, or expiration date for a banner. :param message: Message (string) to show in the banner. :type message: str :param banner_type: Type of banner to present. Defaults is "info". :type banner_type: str :param id: ID of the banner to update. :type id: str :param expiration: Date/time when the banner should no longer be presented to users. To unset the expiration for the banner, supply an empty value to this argument. Example : "2019-06-10 17:21:00 UTC", "2019-06-10" :type expiration: date :rtype: [object] """ if message is None and banner_type is None and expiration is None: raise ValueError('At least one of the following arguments need to be supplied: --message, --type, ' '--expiration.') if expiration is not None and expiration != '': expiration_iso8601 = convert_date_string_to_iso8601(value=expiration, argument='expiration') else: expiration_iso8601 = expiration existing_entries = setting_list(user_scope='host', key=GLOBAL_MESSAGE_BANNERS_KEY, organization=organization, detect=detect) if id not in existing_entries: raise ValueError('The following banner was not found: %s' % id) existing_entry = existing_entries[id] setting_key = _get_banner_key(id) entries = { setting_key: { "message": message } } if message is not None: entries[setting_key]['message'] = message elif 'message' in existing_entry: entries[setting_key]['message'] = existing_entry['message'] if banner_type is not None: entries[setting_key]['level'] = banner_type elif 'level' in existing_entry: entries[setting_key]['level'] = existing_entry['level'] if expiration_iso8601 is not None: entries[setting_key]['expirationDate'] = expiration_iso8601 elif 'expirationDate' in existing_entry: entries[setting_key]['expirationDate'] = existing_entry['expirationDate'] setting_add_or_update(entries=entries, user_scope=USER_SCOPE_HOST, organization=organization, detect=detect) return {id: entries[setting_key]} def banner_remove(id, organization=None, detect=None): # pylint: disable=redefined-builtin """Remove a banner. :param id: ID of the banner to remove. :type id: str :rtype: [object] """ setting_key = _get_banner_key(id) setting_remove(key=setting_key, user_scope='host', organization=organization, detect=detect) def _get_banner_key(message_id): return GLOBAL_MESSAGE_BANNERS_KEY + '/' + message_id azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/admin/commands.py000066400000000000000000000022561360605530400301710ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType from azext_devops.dev.common.exception_handler import azure_devops_exception_handler from ._format import transform_banner_table_output bannerops = CliCommandType( operations_tmpl='azext_devops.dev.admin.banner#{}', exception_handler=azure_devops_exception_handler ) def load_admin_commands(self, _): with self.command_group('devops admin banner', command_type=bannerops) as g: g.command('list', 'banner_list', table_transformer=transform_banner_table_output) g.command('show', 'banner_show', table_transformer=transform_banner_table_output) g.command('add', 'banner_add', table_transformer=transform_banner_table_output) g.command('remove', 'banner_remove') g.command('update', 'banner_update', table_transformer=transform_banner_table_output) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/admin/setting.py000066400000000000000000000025231360605530400300420ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azext_devops.dev.common.services import (get_settings_client, resolve_instance) def setting_list(user_scope, key=None, organization=None, detect=None): organization = resolve_instance(detect=detect, organization=organization) client = get_settings_client(organization) entries = client.get_entries(user_scope=user_scope, key=key) return entries def setting_add_or_update(entries, user_scope, organization=None, detect=None): organization = resolve_instance(detect=detect, organization=organization) client = get_settings_client(organization) client.set_entries(entries=entries, user_scope=user_scope) def setting_remove(key, user_scope, organization=None, detect=None): organization = resolve_instance(detect=detect, organization=organization) client = get_settings_client(organization) client.remove_entries(key=key, user_scope=user_scope) GLOBAL_MESSAGE_BANNERS_KEY = 'GlobalMessageBanners' USER_SCOPE_HOST = 'host' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/artifacts/000077500000000000000000000000001360605530400267015ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/artifacts/__init__.py000066400000000000000000000007301360605530400310120ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import pkg_resources from ._help import load_artifacts_help pkg_resources.declare_namespace(__name__) load_artifacts_help() azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/artifacts/_help.py000066400000000000000000000013371360605530400303460ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.help_files import helps def load_artifacts_help(): helps['artifacts'] = """ type: group short-summary: Manage Azure Artifacts. long-summary: This command group is a part of the azure-devops extension. """ helps['artifacts universal'] = """ type: group short-summary: Manage Universal Packages long-summary: """ azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/artifacts/arguments.py000066400000000000000000000016021360605530400312570ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.arguments import enum_choice_list _SCOPE_VALUES = ['project', 'organization'] def load_package_arguments(self, _): with self.argument_context('artifacts universal') as context: context.argument('name', options_list=('--name', '-n')) context.argument('version', options_list=('--version', '-v')) context.argument('scope', **enum_choice_list(_SCOPE_VALUES)) with self.argument_context('artifacts universal publish') as context: context.argument('description', options_list=('--description', '-d')) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/artifacts/commands.py000066400000000000000000000015231360605530400310550ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType from azext_devops.dev.common.exception_handler import azure_devops_exception_handler artifactOps = CliCommandType( operations_tmpl='azext_devops.dev.artifacts.universal#{}', exception_handler=azure_devops_exception_handler ) def load_package_commands(self, _): with self.command_group('artifacts universal', command_type=artifactOps) as g: g.command('publish', 'publish_package') g.command('download', 'download_package') azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/artifacts/universal.py000066400000000000000000000075441360605530400312750ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import colorama from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.services import resolve_instance, resolve_instance_and_project from azext_devops.dev.common.artifacttool import ArtifactToolInvoker from azext_devops.dev.common.artifacttool_updater import ArtifactToolUpdater from azext_devops.dev.common.external_tool import ProgressReportingExternalToolInvoker logger = get_logger(__name__) def publish_package(feed, name, version, path, description=None, scope='organization', organization=None, project=None, detect=None): """Publish a package to a feed. :param scope: Scope of the feed: 'project' if the feed was created in a project, and 'organization' otherwise. :type scope: str :param feed: Name or ID of the feed. :type feed: str :param name: Name of the package, e.g. 'foo-package'. :type name: str :param version: Version of the package, e.g. '1.0.0'. :type version: str :param description: Description of the package. :type description: str :param path: Directory containing the package contents. :type path: str """ colorama.init() # Needed for humanfriendly spinner to display correctly if scope == 'project': organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) else: if project is not None: raise CLIError('--scope \'project\' is required when specifying a value in --project') organization = resolve_instance( detect=detect, organization=organization) artifact_tool = ArtifactToolInvoker(ProgressReportingExternalToolInvoker(), ArtifactToolUpdater()) return artifact_tool.publish_universal(organization, project, feed, name, version, description, path) def download_package(feed, name, version, path, file_filter=None, scope='organization', organization=None, project=None, detect=None): """Download a package. :param scope: Scope of the feed: 'project' if the feed was created in a project, and 'organization' otherwise. :type scope: str :param feed: Name or ID of the feed. :type feed: str :param name: Name of the package, e.g. 'foo-package'. :type name: str :param version: Version of the package, e.g. 1.0.0. :type version: str :param path: Directory to place the package contents. :type path: str :param file_filter: Wildcard filter for file download. :type file_filter: str """ colorama.init() # Needed for humanfriendly spinner to display correctly if scope == 'project': organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) else: if project is not None: raise CLIError('--scope \'project\' is required when specifying a value in --project') organization = resolve_instance( detect=detect, organization=organization) artifact_tool = ArtifactToolInvoker(ProgressReportingExternalToolInvoker(), ArtifactToolUpdater()) return artifact_tool.download_universal(organization, project, feed, name, version, path, file_filter) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/000077500000000000000000000000001360605530400261735ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/__init__.py000066400000000000000000000007211360605530400303040ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import pkg_resources from ._help import load_boards_help pkg_resources.declare_namespace(__name__) load_boards_help() azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/_format.py000066400000000000000000000206741360605530400302050ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from collections import OrderedDict _WORK_ITEM_TITLE_TRUNCATION_LENGTH = 70 _PATH_TRUNCATION_LENGTH = 50 def transform_work_item_relation_type_table_output(result): table_output = [] for item in result: table_row = OrderedDict() table_row['Name'] = item['name'] table_row['ReferenceName'] = item['referenceName'] table_row['Enabled'] = item['attributes']['enabled'] table_row['Usage'] = item['attributes']['usage'] table_output.append(table_row) return table_output def transform_work_item_relations(result): if result['relations'] is None: return [] relations = result['relations'] table_output = [] for item in relations: table_row = OrderedDict() table_row['Relation Type'] = item['rel'] table_row['Url'] = item['url'] table_output.append(table_row) return table_output def transform_work_items_table_output(result): table_output = [] for item in result: table_output.append(_transform_work_items_row(item)) return table_output def transform_work_item_table_output(result): table_output = [_transform_work_items_row(result)] return table_output def _transform_work_items_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] if 'fields' in row: if 'System.WorkItemType' in row['fields']: table_row['Type'] = row['fields']['System.WorkItemType'] else: table_row['Type'] = ' ' if 'System.Title' in row['fields']: title = row['fields']['System.Title'] if len(title) > _WORK_ITEM_TITLE_TRUNCATION_LENGTH: title = title[0:_WORK_ITEM_TITLE_TRUNCATION_LENGTH - 3] + '...' table_row['Title'] = title else: table_row['Title'] = ' ' if 'System.AssignedTo' in row['fields']: table_row['Assigned To'] = row['fields']['System.AssignedTo']['uniqueName'] else: table_row['Assigned To'] = ' ' if 'System.State' in row['fields']: table_row['State'] = row['fields']['System.State'] else: table_row['State'] = ' ' else: table_row['Type'] = ' ' table_row['Title'] = ' ' table_row['Assigned To'] = ' ' table_row['State'] = ' ' return table_row def transform_work_item_query_result_table_output(result): table_output = [] for item in result: if 'fields' in item: table_output.append(transform_work_item_query_result_row_output(item['fields'])) return table_output def transform_work_item_query_result_row_output(row): from azext_devops.dev.boards.work_item import get_last_query_result table_row = OrderedDict() max_columns = 5 i = 0 for field_reference in get_last_query_result().columns: if field_reference.reference_name in row: if row[field_reference.reference_name] == 0: # knack hides column values that are equal to numeric 0. table_row[field_reference.name] = '0' else: if field_reference.reference_name == 'System.Title': title = row[field_reference.reference_name] if len(title) > _WORK_ITEM_TITLE_TRUNCATION_LENGTH: title = title[0:_WORK_ITEM_TITLE_TRUNCATION_LENGTH - 3] + '...' table_row[field_reference.name] = title elif field_reference.reference_name == 'System.AssignedTo': table_row[field_reference.name] = row[field_reference.reference_name]['uniqueName'] else: table_row[field_reference.name] = row[field_reference.reference_name] else: table_row[field_reference.name] = ' ' i += 1 if i >= max_columns: # limit number of columns in table view break return table_row def transform_work_item_team_iterations_table_output(result): table_output = [] for item in sorted(result, key=_get_team_iteration_key): table_output.append(_transform_team_iteration_row(item)) return table_output def transform_work_item_team_iteration_table_output(result): table_output = [_transform_team_iteration_row(result)] return table_output def _transform_team_iteration_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] if row['attributes']: if row['attributes']['startDate'] is None: table_row['Start Date'] = '' else: table_row['Start Date'] = row['attributes']['startDate'] if row['attributes']['finishDate'] is None: table_row['Finish Date'] = '' else: table_row['Finish Date'] = row['attributes']['finishDate'] if 'timeFrame' in row['attributes']: table_row['Time Frame'] = row['attributes']['timeFrame'] table_row['Path'] = row['path'] return table_row def transform_work_item_team_iteration_work_items(result): table_output = [] for item in result['workItemRelations']: table_output.append(_transform_team_iteration_work_item_row(item)) return table_output def _transform_team_iteration_work_item_row(row): table_row = OrderedDict() if row['source']: table_row['Source'] = row['source']['id'] if row['target']: table_row['Target'] = row['target']['id'] table_row['Relation Type'] = row['rel'] return table_row def transform_work_item_team_default_iteration_table_output(result): table_output = [] table_row = OrderedDict() if result['defaultIteration']: table_row = _transform_team_iteration_row(result['defaultIteration']) table_row['Default Iteration Macro'] = result['defaultIterationMacro'] table_output.append(table_row) return table_output def transform_work_item_team_backlog_iteration_table_output(result): table_output = [] table_output.append(_transform_team_iteration_row(result['backlogIteration'])) return table_output def transform_work_item_project_classification_nodes_table_output(response): table_op = [] table_op = transform_work_item_project_classification_nodes_table_output_recursive(response, table_op) return table_op def transform_work_item_project_classification_nodes_table_output_recursive(result, table_output): table_output.append(_transform_project_classification_node_row(result)) if result['children']: for item in result['children']: table_output = transform_work_item_project_classification_nodes_table_output_recursive(item, table_output) return table_output def transform_work_item_project_classification_node_table_output(result): table_output = [_transform_project_classification_node_row(result[0])] return table_output def _transform_project_classification_node_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Identifier'] = row['identifier'] table_row['Name'] = row['name'] if row['attributes']: table_row['Start Date'] = row['attributes']['startDate'] table_row['Finish Date'] = row['attributes']['finishDate'] path = row['path'] if len(path) > _PATH_TRUNCATION_LENGTH: path = path[0:_PATH_TRUNCATION_LENGTH - 3] + '...' table_row['Path'] = path table_row['Has Children'] = row['hasChildren'] return table_row def transform_work_item_team_areas_table_output(result): table_output = [] for item in sorted(result['values'], key=_get_team_area_key): table_output.append(_transform_work_item_team_area_row(item, default_area_path=result['defaultValue'])) return table_output def _transform_work_item_team_area_row(row, default_area_path): table_row = OrderedDict() table_row['Area'] = row['value'] table_row['Include sub areas'] = row['includeChildren'] if row['value'] == default_area_path: table_row['Is Default'] = True else: table_row['Is Default'] = False return table_row def _get_team_iteration_key(team_iteration_row): return team_iteration_row['name'].lower() def _get_team_area_key(team_area_row): return team_area_row['value'].lower() azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/_help.py000066400000000000000000000053161360605530400276410ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.help_files import helps def load_boards_help(): helps['boards'] = """ type: group short-summary: Manage Azure Boards. long-summary: This command group is a part of the azure-devops extension. """ helps['boards work-item'] = """ type: group short-summary: Manage work items. long-summary: """ helps['boards query'] = """ type: command short-summary: Manage queries. long-summary: """ helps['boards iteration'] = """ type: group short-summary: Manage iterations. long-summary: """ helps['boards iteration team'] = """ type: group short-summary: Manage iterations for a team. long-summary: """ helps['boards iteration project'] = """ type: group short-summary: Manage iterations for a project. long-summary: """ helps['boards iteration project update'] = """ type: command long-summary: Move iteration or update iteration details like name AND/OR start-date and finish-date. """ helps['boards area'] = """ type: group short-summary: Manage area paths. long-summary: """ helps['boards area project'] = """ type: group short-summary: Manage areas for a project. long-summary: """ helps['boards area project update'] = """ type: command long-summary: Move area or update area name. """ helps['boards area team'] = """ type: group short-summary: Manage areas for a team. long-summary: """ helps['boards area team update'] = """ type: command long-summary: Update any area to include/exclude sub areas OR Set already added area as default. """ helps['boards area team add'] = """ type: command long-summary: Every team needs to have a default area configured which can't be empty. Hence, you need to pass --set-as-default while adding first area to your team. You can later configure any other area which already added to team as default by using `az boards area team update -h` command. examples: - name: Add area to a team. text: | az boards area team add --team 'ContosoTeam' --path '\\ContosoProject\\MyProjectAreaName' """ helps['boards work-item relation'] = """ type: group short-summary: Manage work item relations. long-summary: """ azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/area.py000066400000000000000000000260231360605530400274600ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.util import CLIError from azext_devops.devops_sdk.exceptions import AzureDevOpsServiceError from azext_devops.devops_sdk.v5_0.work_item_tracking.models import WorkItemClassificationNode from azext_devops.devops_sdk.v5_0.work.models import (TeamContext, TeamFieldValuesPatch, TeamFieldValue) from azext_devops.dev.common.services import (resolve_instance_and_project, get_work_item_tracking_client, get_work_client) from .boards_helper import resolve_classification_node_path, handle_common_boards_errors _STRUCTURE_GROUP_AREA = 'areas' def get_project_areas(depth=1, path=None, organization=None, project=None, detect=None): """List areas for a project. :param depth: Depth of child nodes to be fetched. Example: --depth 3 :type depth: int """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) if path: path = resolve_classification_node_path(client, path, project, _STRUCTURE_GROUP_AREA) list_of_areas = client.get_classification_node(project=project, structure_group=_STRUCTURE_GROUP_AREA, depth=depth, path=path) return list_of_areas def delete_project_area(path, organization=None, project=None, detect=None): """Delete area. """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) path = resolve_classification_node_path(client, path, project, _STRUCTURE_GROUP_AREA) response = client.delete_classification_node(project=project, structure_group=_STRUCTURE_GROUP_AREA, path=path) return response def create_project_area(name, path=None, organization=None, project=None, detect=None): """Create area. :param name: Name of the area. :type: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) if path: path = resolve_classification_node_path(client, path, project, _STRUCTURE_GROUP_AREA) classification_node_object = WorkItemClassificationNode() classification_node_object.name = name response = client.create_or_update_classification_node(project=project, posted_node=classification_node_object, structure_group=_STRUCTURE_GROUP_AREA, path=path) return response def get_project_area(id, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Show area details for a project. :param id: Area ID. :type id: int """ ids = [int(id)] organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) response = client.get_classification_nodes(project=project, ids=ids) return response def update_project_area(path, name=None, child_id=None, organization=None, project=None, detect=None): """Update area. :param name: New name of the area. :type: str :param child_id: Move an existing area and add as child node for this area. :type: int """ if name is None and child_id is None: raise CLIError('Either --name or --child-id should be provided.') organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) path = resolve_classification_node_path(client, path, project, _STRUCTURE_GROUP_AREA) if child_id: move_classification_node_object = WorkItemClassificationNode() move_classification_node_object.id = child_id response = client.create_or_update_classification_node(project=project, posted_node=move_classification_node_object, structure_group=_STRUCTURE_GROUP_AREA, path=path) classification_node_object = client.get_classification_node(project=project, structure_group=_STRUCTURE_GROUP_AREA, path=path) if name is not None: classification_node_object.name = name response = client.update_classification_node(project=project, posted_node=classification_node_object, structure_group=_STRUCTURE_GROUP_AREA, path=path) return response def get_team_areas(team, organization=None, project=None, detect=None): """List areas for a team. """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) list_of_areas = client.get_team_field_values(team_context=team_context) return list_of_areas def add_team_area(path, team, set_as_default=False, include_sub_areas=None, organization=None, project=None, detect=None): """Add area to a team. :param set_as_default: Set this area path as default area for this team. Default: False :type set_as_default: bool """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) get_response = client.get_team_field_values(team_context=team_context) patch_doc = TeamFieldValuesPatch() patch_doc.values = get_response.values if include_sub_areas is None: include_sub_areas = False team_field_value = TeamFieldValue(include_children=include_sub_areas, value=path) if set_as_default: patch_doc.default_value = path else: patch_doc.default_value = get_response.default_value patch_doc.values.append(team_field_value) try: update_response = client.update_team_field_values(patch=patch_doc, team_context=team_context) return update_response except AzureDevOpsServiceError as ex: handle_common_boards_errors(ex) def remove_team_area(path, team, organization=None, project=None, detect=None): """Remove area from a team. """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) if path[0] == '\\': path = path[1:] get_response = client.get_team_field_values(team_context=team_context) if get_response.default_value == path: raise CLIError('You are trying to remove the default area for this team. ' 'Please change the default area node and then try this command again.') area_found = False for entry in get_response.values: if path == entry.value[:]: area_found = True get_response.values.remove(entry) if not area_found: raise CLIError('Path is not added to team area list.') patch_doc = TeamFieldValuesPatch() patch_doc.values = get_response.values patch_doc.default_value = get_response.default_value try: update_response = client.update_team_field_values(patch=patch_doc, team_context=team_context) return update_response except AzureDevOpsServiceError as ex: handle_common_boards_errors(ex) def update_team_area(path, team, include_sub_areas=None, set_as_default=False, organization=None, project=None, detect=None): """Update team area. :param set_as_default: Set as default team area path. Default: False :type set_as_default: bool """ if include_sub_areas is None and set_as_default is False: raise CLIError('Either --set-as-default or --include-sub-areas parameter should be provided.') organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) get_response = client.get_team_field_values(team_context=team_context) patch_doc = TeamFieldValuesPatch() area_found = False for entry in get_response.values: if path == entry.value[:]: area_found = True if include_sub_areas is not None: entry.include_children = include_sub_areas if set_as_default is True: patch_doc.default_value = path else: patch_doc.default_value = get_response.default_value if not area_found: raise CLIError('Path is not added to team area list.') patch_doc.values = get_response.values try: update_response = client.update_team_field_values(patch=patch_doc, team_context=team_context) return update_response except AzureDevOpsServiceError as ex: handle_common_boards_errors(ex) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/arguments.py000066400000000000000000000102431360605530400305520ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azure.cli.core.commands.parameters import get_enum_type, get_three_state_flag _EXPAND_TYPES = ['none', 'relations', 'fields', 'links', 'all'] def load_work_arguments(self, _): with self.argument_context('boards') as context: context.argument('project', options_list=('--project', '-p')) with self.argument_context('boards work-item create') as context: context.argument('work_item_type', type=str, options_list='--type') context.argument('fields', nargs='*', options_list=('--fields', '-f')) context.argument('description', options_list=('--description', '-d')) with self.argument_context('boards work-item update') as context: context.argument('fields', nargs='*', options_list=('--fields', '-f')) context.argument('description', options_list=('--description', '-d')) with self.argument_context('boards work-item delete') as context: context.argument('yes', options_list=['--yes', '-y'], action='store_true', help='Do not prompt for confirmation.') with self.argument_context('boards work-item show') as context: context.argument('expand', arg_type=get_enum_type(_EXPAND_TYPES)) context.argument('fields', options_list=('--fields', '-f')) with self.argument_context('boards work-item relation') as context: context.argument('id', help='The ID of the work item') with self.argument_context('boards work-item relation add') as context: context.argument('relation_type', help='Relation type to create. Example: parent, child ') context.argument('target_id', help='ID(s) of work-items to create relation with. \ Multiple values can be passed comma separated. Example: 1,2 ') with self.argument_context('boards work-item relation remove') as context: context.argument('relation_type', help='Relation type to remove. Example: parent, child ') context.argument('target_id', help='ID(s) of work-items to remove relation from. \ Multiple values can be passed comma separated. Example: 1,2 ') with self.argument_context('boards iteration project') as context: context.argument('path', help='Absolute path of an iteration. ' 'Example:' + r'\ProjectName\Iteration\IterationName') context.argument('start_date', help='Start date of the iteration. Example : "2019-06-03"') context.argument('finish_date', help='Finish date of the iteration. Example : "2019-06-21"') with self.argument_context('boards iteration project show') as context: context.argument('id', type=int) with self.argument_context('boards iteration project create') as context: context.argument('path', help='Absolute path of an iteration. ' 'Creates an iteration at root level if --path is not specified. ' 'Example:' + r'\ProjectName\Iteration\IterationName.') with self.argument_context('boards area') as context: context.argument('path', help='Absolute path of an area. Example:' + r'\ProjectName\Area\AreaName') with self.argument_context('boards area project create') as context: context.argument('path', help='Absolute path of an area. ' 'Creates an area at root level if --path is not specified. ' 'Example:' + r'\ProjectName\Area\AreaName.') with self.argument_context('boards area team') as context: context.argument('team', help='The name or id of the team.') context.argument('include_sub_areas', arg_type=get_three_state_flag(), help='Include child nodes of this area.') context.argument('path', help='Area path. Example:' + r'\ProjectName\AreaName') azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/boards_helper.py000066400000000000000000000023561360605530400313640ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.util import CLIError from knack.log import get_logger logger = get_logger(__name__) def resolve_classification_node_path(client, path, project, structure_group): get_root_node = client.get_root_nodes(project=project, depth=0) root_node_path = None for entry in get_root_node: if entry.structure_type == structure_group[:-1]: root_node_path = entry.additional_properties['path'] if root_node_path and path.lower().startswith(root_node_path.lower()): updated_path = path[len(root_node_path):] return updated_path raise CLIError("--path parameter is expected to be absolute path.") def handle_common_boards_errors(ex): logger.debug(ex, exc_info=True) raise CLIError(str(ex.message) + "\nPlease see https://aka.ms/azure-devops-cli-troubleshooting " + 'for more information on troubleshooting common errors.') azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/commands.py000066400000000000000000000154451360605530400303570ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType from azext_devops.dev.common.exception_handler import azure_devops_exception_handler from ._format import (transform_work_item_table_output, transform_work_item_query_result_table_output, transform_work_item_relation_type_table_output, transform_work_item_relations, transform_work_item_team_iterations_table_output, transform_work_item_team_iteration_table_output, transform_work_item_team_iteration_work_items, transform_work_item_team_default_iteration_table_output, transform_work_item_team_backlog_iteration_table_output, transform_work_item_project_classification_nodes_table_output, transform_work_item_project_classification_node_table_output, transform_work_item_team_areas_table_output) workItemOps = CliCommandType( operations_tmpl='azext_devops.dev.boards.work_item#{}', exception_handler=azure_devops_exception_handler ) relationsOps = CliCommandType( operations_tmpl='azext_devops.dev.boards.relations#{}', exception_handler=azure_devops_exception_handler ) workProjectAndTeamIterationOps = CliCommandType( operations_tmpl='azext_devops.dev.boards.iteration#{}', exception_handler=azure_devops_exception_handler ) workProjectAndTeamAreaOps = CliCommandType( operations_tmpl='azext_devops.dev.boards.area#{}', exception_handler=azure_devops_exception_handler ) def load_work_commands(self, _): with self.command_group('boards', command_type=workItemOps) as g: # basic work item commands g.command('work-item show', 'show_work_item', table_transformer=transform_work_item_table_output) g.command('work-item create', 'create_work_item', table_transformer=transform_work_item_table_output) g.command('work-item update', 'update_work_item', table_transformer=transform_work_item_table_output) g.command('work-item delete', 'delete_work_item', confirmation='Are you sure you want to delete this work item?') # query commands g.command('query', 'query_work_items', table_transformer=transform_work_item_query_result_table_output) with self.command_group('boards work-item', command_type=relationsOps) as g: # relation commands g.command('relation list-type', 'get_relation_types_show', table_transformer=transform_work_item_relation_type_table_output) g.command('relation add', 'add_relation', table_transformer=transform_work_item_relations) g.command('relation remove', 'remove_relation', table_transformer=transform_work_item_relations, confirmation='Are you sure you want to remove this relation(s)?') g.command('relation show', 'show_work_item', table_transformer=transform_work_item_relations) with self.command_group('boards iteration', command_type=workProjectAndTeamIterationOps, is_preview=True) as g: # team iteration commands g.command('team list', 'get_team_iterations', table_transformer=transform_work_item_team_iterations_table_output) g.command('team list-work-items', 'list_iteration_work_items', table_transformer=transform_work_item_team_iteration_work_items) g.command('team set-default-iteration', 'set_default_iteration', table_transformer=transform_work_item_team_default_iteration_table_output) g.command('team set-backlog-iteration', 'set_backlog_iteration', table_transformer=transform_work_item_team_backlog_iteration_table_output) g.command('team show-default-iteration', 'show_default_iteration', table_transformer=transform_work_item_team_default_iteration_table_output) g.command('team show-backlog-iteration', 'show_backlog_iteration', table_transformer=transform_work_item_team_backlog_iteration_table_output) g.command('team remove', 'delete_team_iteration', table_transformer=transform_work_item_team_iteration_table_output) g.command('team add', 'post_team_iteration', table_transformer=transform_work_item_team_iteration_table_output) # team iteration commands g.command('project list', 'get_project_iterations', table_transformer=transform_work_item_project_classification_nodes_table_output) g.command('project update', 'update_project_iteration', table_transformer=transform_work_item_project_classification_nodes_table_output) g.command('project delete', 'delete_project_iteration', confirmation='Are you sure you want to delete this iteration?') g.command('project show', 'get_project_iteration', table_transformer=transform_work_item_project_classification_node_table_output) g.command('project create', 'create_project_iteration', table_transformer=transform_work_item_project_classification_nodes_table_output) with self.command_group('boards area', command_type=workProjectAndTeamAreaOps, is_preview=True) as g: # team iteration commands g.command('project list', 'get_project_areas', table_transformer=transform_work_item_project_classification_nodes_table_output) g.command('project delete', 'delete_project_area', confirmation='Are you sure you want to delete this area?') g.command('project create', 'create_project_area', table_transformer=transform_work_item_project_classification_nodes_table_output) g.command('project update', 'update_project_area', table_transformer=transform_work_item_project_classification_nodes_table_output) g.command('project show', 'get_project_area', table_transformer=transform_work_item_project_classification_node_table_output) # team iteration commands g.command('team list', 'get_team_areas', table_transformer=transform_work_item_team_areas_table_output) g.command('team add', 'add_team_area', table_transformer=transform_work_item_team_areas_table_output) g.command('team remove', 'remove_team_area', table_transformer=transform_work_item_team_areas_table_output) g.command('team update', 'update_team_area', table_transformer=transform_work_item_team_areas_table_output) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/iteration.py000066400000000000000000000401421360605530400305440ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.util import CLIError from knack.log import get_logger from azext_devops.devops_sdk.exceptions import AzureDevOpsServiceError from azext_devops.devops_sdk.v5_0.work_item_tracking.models import WorkItemClassificationNode from azext_devops.devops_sdk.v5_0.work.models import (TeamContext, TeamSettingsIteration, TeamSettingsPatch) from azext_devops.dev.common.arguments import convert_date_only_string_to_iso8601 from azext_devops.dev.common.services import (resolve_instance_and_project, get_work_item_tracking_client, get_work_client) from azext_devops.dev.common.uuid import EMPTY_UUID from .boards_helper import resolve_classification_node_path, handle_common_boards_errors logger = get_logger(__name__) _STRUCTURE_GROUP_ITERATION = 'iterations' def get_project_iterations(depth=1, path=None, organization=None, project=None, detect=None): """List iterations for a project. :param depth: Depth of child nodes to be fetched. Example: --depth 3. :type depth: int """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) if path: path = resolve_classification_node_path(client, path, project, _STRUCTURE_GROUP_ITERATION) list_of_iterations = client.get_classification_node(project=project, structure_group=_STRUCTURE_GROUP_ITERATION, depth=depth, path=path) return list_of_iterations def update_project_iteration(path, child_id=None, name=None, start_date=None, finish_date=None, organization=None, project=None, detect=None): """Update project iteration. :param name: New name of the iteration. :type: str :param child_id: Move an existing iteration and add as child node for this iteration. :type: int """ if start_date is None and finish_date is None and name is None and child_id is None: raise CLIError('At least one of --start-date , --finish-date , --child-id or --name arguments is required.') organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) path = resolve_classification_node_path(client, path, project, _STRUCTURE_GROUP_ITERATION) if child_id: move_classification_node_object = WorkItemClassificationNode() move_classification_node_object.id = child_id update_iteration = client.create_or_update_classification_node(project=project, posted_node=move_classification_node_object, structure_group=_STRUCTURE_GROUP_ITERATION, path=path) classification_node_object = client.get_classification_node(project=project, structure_group=_STRUCTURE_GROUP_ITERATION, path=path) if classification_node_object.attributes is None and \ ((start_date and not finish_date) or (not start_date and finish_date)): raise CLIError('You must specify both start and finish dates or neither date') if classification_node_object.attributes is None: attributes_obj = {} classification_node_object.attributes = attributes_obj if start_date: start_date = convert_date_only_string_to_iso8601(value=start_date, argument='start_date') classification_node_object.attributes['startDate'] = start_date if finish_date: finish_date = convert_date_only_string_to_iso8601(value=finish_date, argument='finish_date') classification_node_object.attributes['finishDate'] = finish_date if name is not None: classification_node_object.name = name update_iteration = client.update_classification_node(project=project, posted_node=classification_node_object, structure_group=_STRUCTURE_GROUP_ITERATION, path=path) return update_iteration def delete_project_iteration(path, organization=None, project=None, detect=None): """Delete iteration. """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) path = resolve_classification_node_path(client, path, project, _STRUCTURE_GROUP_ITERATION) response = client.delete_classification_node(project=project, structure_group=_STRUCTURE_GROUP_ITERATION, path=path) return response def get_project_iteration(id, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Show iteration details for a project. :param id: Iteration ID. :type id: int """ ids = [int(id)] organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) response = client.get_classification_nodes(project=project, ids=ids) return response def create_project_iteration(name, path=None, start_date=None, finish_date=None, organization=None, project=None, detect=None): """Create iteration. :param name: Name of the iteration. :type: str """ if start_date is None and finish_date is None and name is None: raise CLIError('At least one of --start-date , --finish-date or --name arguments is required.') organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) if path: path = resolve_classification_node_path(client, path, project, _STRUCTURE_GROUP_ITERATION) classification_node_object = WorkItemClassificationNode() if ((start_date and not finish_date) or (not start_date and finish_date)): raise CLIError('You must specify both start and finish dates or neither date') if classification_node_object.attributes is None: attributes_obj = {} classification_node_object.attributes = attributes_obj if start_date: start_date = convert_date_only_string_to_iso8601(value=start_date, argument='start_date') classification_node_object.attributes['startDate'] = start_date if finish_date: finish_date = convert_date_only_string_to_iso8601(value=finish_date, argument='finish_date') classification_node_object.attributes['finishDate'] = finish_date if name is not None: classification_node_object.name = name response = client.create_or_update_classification_node(project=project, posted_node=classification_node_object, structure_group=_STRUCTURE_GROUP_ITERATION, path=path) return response def get_team_iterations(team, timeframe=None, organization=None, project=None, detect=None): """List iterations for a team. :param team: The name or id of the team. :type team: str :param timeframe: A filter for which iterations are returned based on relative time. Only Current is supported currently. :type: str :rtype: :class:` ` """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) list_of_iterations = client.get_team_iterations(team_context=team_context, timeframe=timeframe) return list_of_iterations def delete_team_iteration(id, team, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Remove iteration from a team. :param id: Identifier of the iteration. :type: str :param team: Name or ID of the team. :type: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) try: team_iteration = client.delete_team_iteration(team_context=team_context, id=id) return team_iteration except AzureDevOpsServiceError as ex: handle_common_boards_errors(ex) def post_team_iteration(id, team, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Add iteration to a team. :param id: Identifier of the iteration. :type: str :param team: Name or ID of the team. :type: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) team_setting_iteration = TeamSettingsIteration(id=id) try: team_iteration = client.post_team_iteration(iteration=team_setting_iteration, team_context=team_context) return team_iteration except AzureDevOpsServiceError as ex: _handle_empty_backlog_iteration_id(ex=ex, client=client, team_context=team_context) def list_iteration_work_items(id, team, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """List work-items for an iteration. :param id: Identifier of the iteration. :type: str :param team: Name or ID of the team. :type: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) work_items = client.get_iteration_work_items(iteration_id=id, team_context=team_context) wit_client = get_work_item_tracking_client(organization) relation_types = wit_client.get_relation_types() work_items = _fill_friendly_name_for_relations_in_iteration_work_items(relation_types_from_service=relation_types, iteration_work_items=work_items) return work_items def set_default_iteration(team, id=None, default_iteration_macro=None, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Set default iteration for a team. :param id: Identifier of the iteration which needs to be set as default. :type: str :param team: Name or ID of the team. :type: str :param default_iteration_macro: Default iteration macro. Example: @CurrentIteration. :type: str """ if default_iteration_macro is None and id is None: raise CLIError('Either --id or --default-iteration-macro is required.') organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) patch_object = TeamSettingsPatch() if id: patch_object.default_iteration = id if default_iteration_macro: patch_object.default_iteration_macro = default_iteration_macro team_iteration_setting = client.update_team_settings(team_settings_patch=patch_object, team_context=team_context) return team_iteration_setting def set_backlog_iteration(team, id, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Set backlog iteration for a team. :param id: Identifier of the iteration which needs to be set as backlog iteration. :type: str :param team: Name or ID of the team. :type: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) patch_object = TeamSettingsPatch() patch_object.backlog_iteration = id team_iteration_setting = client.update_team_settings(team_settings_patch=patch_object, team_context=team_context) return team_iteration_setting def show_default_iteration(team, organization=None, project=None, detect=None): """Show default iteration for a team. :param team: Name or ID of the team. :type: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) team_iteration_setting = client.get_team_settings(team_context=team_context) return team_iteration_setting def show_backlog_iteration(team, organization=None, project=None, detect=None): """Show backlog iteration for a team. :param team: Name or ID of the team. :type: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_client(organization) team_context = TeamContext(project=project, team=team) team_iteration_setting = client.get_team_settings(team_context=team_context) return team_iteration_setting def _fill_friendly_name_for_relations_in_iteration_work_items(relation_types_from_service, iteration_work_items): if not iteration_work_items.work_item_relations: return iteration_work_items for relation in iteration_work_items.work_item_relations: for relation_type_from_service in relation_types_from_service: if relation_type_from_service.reference_name == relation.rel: relation.rel = relation_type_from_service.name return iteration_work_items def _handle_empty_backlog_iteration_id(ex, client, team_context): logger.debug(ex, exc_info=True) # Error string - "TF400497: The backlog iteration path that you specified is no longer valid." exception_message_str = r'TF400497' if exception_message_str in ex.message: # Check if backlog iteration ID is empty backlog_setting = client.get_team_settings(team_context=team_context) if backlog_setting.backlog_iteration.id == EMPTY_UUID: raise CLIError('No backlog iteration has been selected for your team. ' 'Before you can select iterations for your team to participate in, ' 'you must first specify a backlog iteration.' '\nYou can set backlog iteration by running following command: ' 'az boards iteration team set-backlog-iteration --team --id ') handle_common_boards_errors(ex) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/relations.py000066400000000000000000000134231360605530400305500ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError from azext_devops.devops_sdk.v5_0.work_item_tracking.models import JsonPatchOperation, Wiql from azext_devops.dev.common.services import (get_work_item_tracking_client, resolve_instance) logger = get_logger(__name__) def get_relation_types_show(organization=None, detect=None): """ List work item relations supported in the organization. """ organization = resolve_instance(detect=detect, organization=organization) client = get_work_item_tracking_client(organization) return client.get_relation_types() def add_relation(id, relation_type, target_id, organization=None, detect=None): # pylint: disable=redefined-builtin """ Add relation(s) to work item. """ organization = resolve_instance(detect=detect, organization=organization) patch_document = [] client = get_work_item_tracking_client(organization) relation_types_from_service = client.get_relation_types() relation_type_system_name = get_system_relation_name(relation_types_from_service, relation_type) target_work_item_ids = target_id.split(',') work_item_query_clause = [] for target_work_item_id in target_work_item_ids: work_item_query_clause.append('[System.Id] = {}'.format(target_work_item_id)) wiql_query_format = 'SELECT [System.Id] FROM WorkItems WHERE ({})' wiql_query_to_get_target_work_items = wiql_query_format.format(' OR '.join(work_item_query_clause)) wiql_object = Wiql() wiql_object.query = wiql_query_to_get_target_work_items target_work_items = client.query_by_wiql(wiql=wiql_object).work_items if len(target_work_items) != len(target_work_item_ids): raise CLIError('Id(s) supplied in --target-id is not valid') patch_document = [] for target_work_item in target_work_items: op = _create_patch_operation('add', '/relations/-', relation_type_system_name, target_work_item.url) patch_document.append(op) client.update_work_item(document=patch_document, id=id) work_item = client.get_work_item(id, expand='All') work_item = fill_friendly_name_for_relations_in_work_item(relation_types_from_service, work_item) return work_item def remove_relation(id, relation_type, target_id, organization=None, detect=None): # pylint: disable=redefined-builtin """ Remove relation(s) from work item. """ organization = resolve_instance(detect=detect, organization=organization) patch_document = [] client = get_work_item_tracking_client(organization) relation_types_from_service = client.get_relation_types() relation_type_system_name = get_system_relation_name(relation_types_from_service, relation_type) target_work_item_ids = target_id.split(',') main_work_item = client.get_work_item(id, expand='All') if main_work_item.relations: for target_work_item_id in target_work_item_ids: target_work_item = client.get_work_item(target_work_item_id, expand='All') target_work_item_url = target_work_item.url index = 0 for relation in main_work_item.relations: if relation.rel == relation_type_system_name and relation.url == target_work_item_url: po = _create_patch_operation('remove', '/relations/{}'.format(index)) patch_document.append(po) break index = index + 1 if len(patch_document) != len(target_work_item_ids): raise CLIError('Id(s) supplied in --target-id is not valid') client.update_work_item(document=patch_document, id=id) work_item = client.get_work_item(id, expand='All') work_item = fill_friendly_name_for_relations_in_work_item(relation_types_from_service, work_item) return work_item def show_work_item(id, organization=None, detect=None): # pylint: disable=redefined-builtin """ Get work item, fill relations with friendly name """ organization = resolve_instance(detect=detect, organization=organization) client = get_work_item_tracking_client(organization) work_item = client.get_work_item(id, expand='All') relation_types_from_service = client.get_relation_types() work_item = fill_friendly_name_for_relations_in_work_item(relation_types_from_service, work_item) return work_item def fill_friendly_name_for_relations_in_work_item(relation_types_from_service, wi): if not wi.relations: return wi for relation in wi.relations: for relation_type_from_service in relation_types_from_service: if relation_type_from_service.reference_name == relation.rel: relation.rel = relation_type_from_service.name return wi def get_system_relation_name(relation_types_from_service, relation_type): for relation_type_from_service in relation_types_from_service: if relation_type_from_service.name.lower() == relation_type.lower(): return relation_type_from_service.reference_name raise CLIError("--relation-type is not valid. Use \"az boards work-item relation list-type\" " + "command to list possible relation types in your project") def _create_patch_operation(op, path, rel=None, url=None): patch_operation = JsonPatchOperation() patch_operation.op = op patch_operation.path = path if rel is not None and url is not None: patch_operation.value = { 'rel': rel, 'url': url } return patch_operation azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/boards/work_item.py000066400000000000000000000453241360605530400305550ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function import webbrowser from knack.log import get_logger from knack.util import CLIError from azext_devops.devops_sdk.exceptions import AzureDevOpsServiceError from azext_devops.devops_sdk.v5_0.work_item_tracking.models import JsonPatchOperation, Wiql from azext_devops.dev.common.arguments import convert_date_string_to_iso8601 from azext_devops.dev.common.identities import (ME, get_current_identity, resolve_identity, get_account_from_identity) from azext_devops.dev.common.services import (get_work_item_tracking_client, resolve_instance, resolve_instance_and_project) from azext_devops.dev.common.uri import uri_quote logger = get_logger(__name__) def create_work_item(work_item_type, title, description=None, assigned_to=None, area=None, iteration=None, reason=None, discussion=None, fields=None, open=False, # pylint: disable=redefined-builtin organization=None, project=None, detect=None): r"""Create a work item. :param work_item_type: Name of the work item type (e.g. Bug). :type work_item_type: str :param title: Title of the work item. :type title: str :param description: Description of the work item. :type description: str :param assigned_to: Name of the person the work item is assigned-to (e.g. fabrikam). :type assigned_to: str :param area: Area the work item is assigned to (e.g. Demos) :type area: str :param iteration: Iteration path of the work item (e.g. Demos\Iteration 1). :type iteration: str :param reason: Reason for the state of the work item. :type reason: str :param discussion: Comment to add to a discussion in a work item. :type discussion: str :param fields: Space separated "field=value" pairs for custom fields you would like to set. Refer https://aka.ms/azure-devops-cli-field-api for more details on fields. :type fields: [str] :param open: Open the work item in the default web browser. :type open: bool :rtype: :class:` ` """ try: organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project, project_required=True) patch_document = [] if title is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.Title', title)) else: raise ValueError('--title is a required argument.') if description is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.Description', description)) if assigned_to is not None: # 'assigned to' does not take an identity id. Display name works. assigned_to = assigned_to.strip() if assigned_to == '': resolved_assigned_to = '' else: resolved_assigned_to = _resolve_identity_as_unique_user_id(assigned_to, organization) if resolved_assigned_to is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.AssignedTo', resolved_assigned_to)) if area is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.AreaPath', area)) if iteration is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.IterationPath', iteration)) if reason is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.Reason', reason)) if discussion is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.History', discussion)) if fields is not None and fields: for field in fields: kvp = field.split('=', 1) if len(kvp) == 2: patch_document.append(_create_work_item_field_patch_operation('add', kvp[0], kvp[1])) else: raise ValueError('The --fields argument should consist of space separated "field=value" pairs.') client = get_work_item_tracking_client(organization) work_item = client.create_work_item(document=patch_document, project=project, type=work_item_type) if open: _open_work_item(work_item, organization) return work_item except AzureDevOpsServiceError as ex: _handle_vsts_service_error(ex) def update_work_item(id, title=None, description=None, assigned_to=None, state=None, area=None, # pylint: disable=redefined-builtin iteration=None, reason=None, discussion=None, fields=None, open=False, # pylint: disable=redefined-builtin organization=None, detect=None): r"""Update work items. :param id: The id of the work item to update. :type id: int :param title: Title of the work item. :type title: str :param description: Description of the work item. :type description: str :param assigned_to: Name of the person the work item is assigned-to (e.g. fabrikam). :type assigned_to: str :param state: State of the work item (e.g. active). :type state: str :param area: Area the work item is assigned to (e.g. Demos). :type area: str :param iteration: Iteration path of the work item (e.g. Demos\Iteration 1). :type iteration: str :param reason: Reason for the state of the work item. :type reason: str :param discussion: Comment to add to a discussion in a work item. :type discussion: str :param fields: Space separated "field=value" pairs for custom fields you would like to set. Refer https://aka.ms/azure-devops-cli-field-api for more details on fields. :type fields: [str] :param open: Open the work item in the default web browser. :type open: bool :rtype: :class:` ` """ organization = resolve_instance(detect=detect, organization=organization) patch_document = [] if title is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.Title', title)) if description is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.Description', description)) if assigned_to is not None: assigned_to = assigned_to.strip() # 'assigned to' does not take an identity id. Display name works. if assigned_to == '': resolved_assigned_to = '' else: resolved_assigned_to = _resolve_identity_as_unique_user_id(assigned_to, organization) if resolved_assigned_to is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.AssignedTo', resolved_assigned_to)) if state is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.State', state)) if area is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.AreaPath', area)) if iteration is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.IterationPath', iteration)) if reason is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.Reason', reason)) if discussion is not None: patch_document.append(_create_work_item_field_patch_operation('add', 'System.History', discussion)) if fields is not None and fields: for field in fields: kvp = field.split('=', 1) if len(kvp) == 2: patch_document.append(_create_work_item_field_patch_operation('add', kvp[0], kvp[1])) else: raise ValueError('The --fields argument should consist of space separated "field=value" pairs.') client = get_work_item_tracking_client(organization) work_item = client.update_work_item(document=patch_document, id=id) if open: _open_work_item(work_item, organization) return work_item def delete_work_item(id, # pylint: disable=redefined-builtin destroy=False, organization=None, project=None, detect=None): """Delete a work item. :param id: Unique id of the work item. :type id: int :param destroy: Permanently delete this work item. :type destroy: bool :rtype: :class:` ` """ try: organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_work_item_tracking_client(organization) delete_response = client.delete_work_item(id=id, project=project, destroy=destroy) print('Deleted work item {}'.format(id)) return delete_response except AzureDevOpsServiceError as ex: _handle_vsts_service_error(ex) def _handle_vsts_service_error(ex): logger.debug(ex, exc_info=True) if ex.type_key == 'RuleValidationException' and "FieldReferenceName" in ex.custom_properties: if ex.message is not None: message = ex.message if message and message[len(message) - 1] != '.': message += '.' name = ex.custom_properties["FieldReferenceName"] if name is not None: if name in _SYSTEM_FIELD_ARGS: message += ' Use the --{} argument to supply this value.'.format(_SYSTEM_FIELD_ARGS[name]) else: message += ' To specify a value for this field, use the --field argument and set the name of the ' \ + 'name/value pair to {}.'.format(name) else: message = "RuleValidationException for FieldReferenceName: " + ex.custom_properties["FieldReferenceName"] raise CLIError(ValueError(message)) raise CLIError(ex) def show_work_item(id, as_of=None, expand='all', fields=None, open=False, organization=None, detect=None): # pylint: disable=redefined-builtin """Show details for a work item. :param id: The ID of the work item :type id: int :param as_of: Work item details as of a particular date and time. Provide a date or date time string. Assumes local time zone. Example: '2019-01-20', '2019-01-20 00:20:00'. For UTC, append 'UTC' to the date time string, '2019-01-20 00:20:00 UTC'. :type as_of:string :param expand: The expand parameters for work item attributes. :type expand:str :param fields: Comma-separated list of requested fields. Example:System.Id,System.AreaPath. Refer https://aka.ms/azure-devops-cli-field-api for more details on fields. :type fields: str :param open: Open the work item in the default web browser. :type open: bool :rtype: :class:` ` """ organization = resolve_instance(detect=detect, organization=organization) try: client = get_work_item_tracking_client(organization) as_of_iso = None if as_of: as_of_iso = convert_date_string_to_iso8601(value=as_of, argument='as-of') if fields: fields = fields.split(',') work_item = client.get_work_item(id, as_of=as_of_iso, fields=fields, expand=expand) except AzureDevOpsServiceError as ex: _handle_vsts_service_error(ex) if open: _open_work_item(work_item, organization) return work_item # pylint: disable=too-many-statements def query_work_items(wiql=None, id=None, path=None, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Query for a list of work items. :param wiql: The query in Work Item Query Language format. Ignored if --id or --path is specified. :type wiql: str :param id: The ID of an existing query. Required unless --path or --wiql are specified. :type id: str :param path: The path of an existing query. Ignored if --id is specified. :type path: str :rtype: :class:` ` """ if wiql is None and path is None and id is None: raise CLIError("Either the --wiql, --id, or --path argument must be specified.") organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project, project_required=False) client = get_work_item_tracking_client(organization) if id is None and path is not None: if project is None: raise CLIError("The --project argument must be specified for this query.") query = client.get_query(project=project, query=path) id = query.id if id is not None: query_result = client.query_by_id(id=id) else: wiql_object = Wiql() wiql_object.query = wiql query_result = client.query_by_wiql(wiql=wiql_object) if query_result.work_items: _last_query_result[_LAST_QUERY_RESULT_KEY] = query_result # store query result for table view safety_buffer = 100 # a buffer in the max url length to protect going over the limit remaining_url_length = 2048 - safety_buffer remaining_url_length -= len(organization) # following subtracts relative url, the asof parameter and beginning of id and field parameters. # asof value length will vary, but this should be the longest possible remaining_url_length -=\ len('/_apis/wit/workItems?ids=&fields=&asOf=2017-11-07T17%3A05%3A34.06699999999999999Z') fields = [] fields_length_in_url = 0 if query_result.columns: for field_ref in query_result.columns: fields.append(field_ref.reference_name) if fields_length_in_url > 0: fields_length_in_url += 3 # add 3 for %2C delimiter fields_length_in_url += len(uri_quote(field_ref.reference_name)) if fields_length_in_url > 800: logger.info("Not retrieving all fields due to max url length.") break remaining_url_length -= fields_length_in_url max_work_items = 1000 work_items_batch_size = 200 current_batch = [] work_items = [] work_item_url_length = 0 for work_item_ref in query_result.work_items: if len(work_items) >= max_work_items: logger.info("Only retrieving the first %s work items.", max_work_items) break if work_item_url_length > 0: work_item_url_length += 3 # add 3 for %2C delimiter work_item_url_length += len(str(work_item_ref.id)) current_batch.append(work_item_ref.id) if remaining_url_length - work_item_url_length <= 0 or len(current_batch) == work_items_batch_size: # url is near max length, go ahead and send first request for details. # url can go over by an id length because we have a safety buffer current_batched_items = client.get_work_items(ids=current_batch, as_of=query_result.as_of, fields=fields) for work_item in current_batched_items: work_items.append(work_item) current_batch = [] work_item_url_length = 0 if current_batch: current_batched_items = client.get_work_items(ids=current_batch, as_of=query_result.as_of, fields=fields) for work_item in current_batched_items: work_items.append(work_item) # put items in the same order they appeared in the initial query results work_items = sorted(work_items, key=_get_sort_key_from_last_query_results) return work_items return None def _get_sort_key_from_last_query_results(work_item): work_items = get_last_query_result().work_items i = 0 num_items = len(work_items) while i < num_items: if work_items[i].id == work_item.id: return i i += 1 # following lines should never be reached raise CLIError("Work Item {} was not found in the original query results.".format(work_item.id)) _last_query_result = {} _LAST_QUERY_RESULT_KEY = 'value' def get_last_query_result(): return _last_query_result.get(_LAST_QUERY_RESULT_KEY, None) def _open_work_item(work_item, organization): """Opens the work item in the default browser. :param work_item: The work item to open. :type work_item: :class:` ` """ project = work_item.fields['System.TeamProject'] url = organization.rstrip('/') + '/' + uri_quote(project) + '/_workitems?id='\ + uri_quote(str(work_item.id)) logger.debug('Opening web page: %s', url) webbrowser.open_new(url=url) def _create_patch_operation(op, path, value): patch_operation = JsonPatchOperation() patch_operation.op = op patch_operation.path = path patch_operation.value = value return patch_operation def _create_work_item_field_patch_operation(op, field, value): path = '/fields/{field}'.format(field=field) return _create_patch_operation(op=op, path=path, value=value) def _resolve_identity_as_unique_user_id(identity_filter, organization): """Takes an identity name, email, alias, or id, and returns the unique_user_id. """ if identity_filter.find(' ') > 0 or identity_filter.find('@') > 0: return identity_filter if identity_filter.lower() == ME: identity = get_current_identity(organization) else: # For alias identity = resolve_identity(identity_filter, organization) if identity is not None: return get_account_from_identity(identity) return None _SYSTEM_FIELD_ARGS = {'System.Title': 'title', 'System.Description': 'description', 'System.AssignedTo': 'assigned-to', 'System.State': 'state', 'System.AreaPath': 'area-path', 'System.IterationPath': 'iteration-path', 'System.Reason': 'reason', 'System.History': 'history'} azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/000077500000000000000000000000001360605530400262115ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/__init__.py000066400000000000000000000005311360605530400303210ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/_credentials.py000066400000000000000000000066501360605530400312260ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import os from knack.log import get_logger from knack.util import CLIError from .uri import uri_parse from .credential_store import CredentialStore from .config import AZ_DEVOPS_GLOBAL_CONFIG_DIR logger = get_logger(__name__) def get_credential(organization, fall_back_to_default=True): token = _get_credential(organization) if token is None and organization is not None and fall_back_to_default: token = _get_credential(organization=None) return token def _get_credential(organization): key = _get_service_name(organization) logger.debug('Getting credential: %s', key) cred_store = CredentialStore() return cred_store.get_password(key) def set_credential(organization, token): key = _get_service_name(organization) cred_store = CredentialStore() cred_store.set_password(key, token) if os.path.isfile(ORGANIZATION_LIST_FILE): # No need to add organization if it's already present. with open(ORGANIZATION_LIST_FILE, 'r') as org_list: for org in org_list: if key == org.rstrip(): return with open(ORGANIZATION_LIST_FILE, 'a+') as org_list: org_list.write(key + "\n") def clear_credential(organization): key = _get_service_name(organization) logger.debug('Clearing credential: %s', key) cred_store = CredentialStore() if key == _DEFAULT_CREDENTIAL_KEY: # remove all organizations and delete the file if os.path.isfile(ORGANIZATION_LIST_FILE): with open(ORGANIZATION_LIST_FILE) as org_list_file: for org in org_list_file: cred_store.clear_password(org.rstrip()) os.remove(ORGANIZATION_LIST_FILE) # this is to clear default credential before upgrade elif cred_store.get_password(key) is not None: cred_store.clear_password(key) else: raise CLIError('No credentials were found.') else: # delete particular organization from the list if os.path.isfile(ORGANIZATION_LIST_FILE): with open(ORGANIZATION_LIST_FILE, "r") as input_file: orgs = input_file.readlines() with open(ORGANIZATION_LIST_FILE, "w") as output_file: for line in orgs: if line.rstrip() != key: output_file.write(line) cred_store.clear_password(key) def _get_service_name(organization): if organization is not None: return 'azdevops-cli:' + normalize_url_for_key(organization) return _DEFAULT_CREDENTIAL_KEY def normalize_url_for_key(url): components = uri_parse(url) normalized_url = components.scheme.lower() + '://' + components.netloc.lower() organization_name = components.path.lower() if(organization_name and ('visualstudio.com' not in url.lower())): organization_name = organization_name.split('/')[1] normalized_url = normalized_url + '/' + organization_name return normalized_url _DEFAULT_CREDENTIAL_KEY = 'azdevops-cli: default' ORGANIZATION_LIST_FILE = os.path.join(AZ_DEVOPS_GLOBAL_CONFIG_DIR, 'organization_list') azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/arguments.py000066400000000000000000000027451360605530400306000ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import logging def should_detect(detect): if detect is None: return True return detect def convert_date_string_to_iso8601(value, argument=None): import dateutil.parser try: d = dateutil.parser.parse(value) except BaseException as ex: # pylint: disable=broad-except logging.info(msg=ex) if argument is None: raise ValueError('The string "%s" must be a valid date or datetime string.' % value) raise ValueError('The --%s argument must be a valid ISO 8601 string.' % argument) if d.tzinfo is None: from dateutil.tz import tzlocal d = d.replace(tzinfo=tzlocal()) d = d.isoformat() return d def convert_date_only_string_to_iso8601(value, argument=None): import dateutil.parser try: d = dateutil.parser.parse(value) except BaseException as ex: # pylint: disable=broad-except logging.info(msg=ex) if argument is None: raise ValueError('The string "%s" must be a valid date.' % value) raise ValueError('The --%s argument must be a valid ISO 8601 string.' % argument) d = d.isoformat() return d azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/artifacttool.py000066400000000000000000000143261360605530400312640ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import json import os from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.services import _get_credentials from azext_devops.dev.common.const import ARTIFACTTOOL_PAT_ENVKEY logger = get_logger(__name__) class ArtifactToolInvoker: def __init__(self, tool_invoker, artifacttool_updater): self._tool_invoker = tool_invoker self._artifacttool_updater = artifacttool_updater def download_pipeline_artifact(self, organization, project, run_id, artifact_name, path): args = ["pipelineartifact", "download", "--service", organization, "--patvar", ARTIFACTTOOL_PAT_ENVKEY, "--project", project, "--pipeline-id", run_id, "--artifact-name", artifact_name, "--path", path] return self.run_artifacttool(organization, args, "Downloading") def upload_pipeline_artifact(self, organization, project, run_id, artifact_name, path): args = ["pipelineartifact", "publish", "--service", organization, "--patvar", ARTIFACTTOOL_PAT_ENVKEY, "--project", project, "--pipeline-id", run_id, "--artifact-name", artifact_name, "--path", path] return self.run_artifacttool(organization, args, "Uploading") def download_universal(self, organization, project, feed, package_name, package_version, path, file_filter): args = ["universal", "download", "--service", organization, "--patvar", ARTIFACTTOOL_PAT_ENVKEY, "--feed", feed, "--package-name", package_name, "--package-version", package_version, "--path", path] if project: args.extend(["--project", project]) if file_filter: args.extend(["--filter", file_filter]) return self.run_artifacttool(organization, args, "Downloading") def publish_universal(self, organization, project, feed, package_name, package_version, description, path): args = ["universal", "publish", "--service", organization, "--patvar", ARTIFACTTOOL_PAT_ENVKEY, "--feed", feed, "--package-name", package_name, "--package-version", package_version, "--path", path] if project: args.extend(["--project", project]) if description: args.extend(["--description", description]) return self.run_artifacttool(organization, args, "Publishing") def run_artifacttool(self, organization, args, initial_progress_message): # Download ArtifactTool if necessary, and return the path artifacttool_dir = self._artifacttool_updater.get_latest_artifacttool(organization) artifacttool_binary_path = os.path.join(artifacttool_dir, "artifacttool") # Populate the environment for the process with the PAT creds = _get_credentials(organization) new_env = os.environ.copy() new_env[ARTIFACTTOOL_PAT_ENVKEY] = str(creds.password) # Run ArtifactTool command_args = [artifacttool_binary_path] + args proc = self._tool_invoker.run(command_args, new_env, initial_progress_message, _process_stderr) if proc: output = proc.stdout.read().decode('utf-8') try: return json.loads(output) except ValueError: # JSONDecodeError but not available on Python 2.7 if output: logger.warning("Failed to parse the output of ArtifactTool as JSON. The output was:\n %s", output) return None def _process_stderr(line, update_progress_callback): try: json_line = json.loads(line) except BaseException as ex: # pylint: disable=broad-except json_line = None logger.warning("Failed to parse structured output from Universal Packages tooling (ArtifactTool)") logger.warning("Exception: %s", ex) logger.warning("Log line: %s", line) return _log_message(json_line) _process_event(json_line, update_progress_callback) # Interpret the structured log line from ArtifactTool and emit the message to Azure devops CLI logging def _log_message(json_line): if json_line is not None and '@m' in json_line: # Serilog doesn't emit @l for Information it seems log_level = json_line['@l'] if '@l' in json_line else "Information" message = json_line['@m'] if log_level in ["Critical", "Error"]: ex = json_line['@x'] if '@x' in json_line else None if ex: message = "{}\n{}".format(message, ex) raise CLIError(message) if log_level == "Warning": logger.warning(message) elif log_level == "Information": logger.info(message) else: logger.debug(message) # Inspect the structured log line for an event, and update the progress def _process_event(json_line, update_progress_callback): if json_line is not None and 'EventId' in json_line and 'Name' in json_line['EventId']: event_name = json_line['EventId']['Name'] if event_name == "ProcessingFiles": processed_files = json_line['ProcessedFiles'] total_files = json_line['TotalFiles'] percent = 100 * float(processed_files) / float(total_files) update_progress_callback("Pre-upload processing: {}/{} files" .format(processed_files, total_files), percent) if event_name == "Uploading": uploaded_bytes = json_line['UploadedBytes'] total_bytes = json_line['TotalBytes'] percent = 100 * float(uploaded_bytes) / float(total_bytes) update_progress_callback("Uploading: {}/{} bytes".format(uploaded_bytes, total_bytes), percent) if event_name == "Downloading": downloaded_bytes = json_line['DownloadedBytes'] total_bytes = json_line['TotalBytes'] percent = 100 * float(downloaded_bytes) / float(total_bytes) update_progress_callback("Downloading: {}/{} bytes".format(downloaded_bytes, total_bytes), percent) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/artifacttool_updater.py000066400000000000000000000205341360605530400330060ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import io import os import platform import shutil import stat import sys import time import uuid import zipfile import humanfriendly import requests from knack.log import get_logger from knack.util import CLIError import distro from azext_devops.dev.common.services import get_connection from azext_devops.dev.common.config import AZ_DEVOPS_GLOBAL_CONFIG_DIR from azext_devops.dev.common.const import (ARTIFACTTOOL_OVERRIDE_PATH_ENVKEY, ARTIFACTTOOL_OVERRIDE_URL_ENVKEY, ARTIFACTTOOL_OVERRIDE_VERSION_ENVKEY) logger = get_logger(__name__) # pylint: disable=too-few-public-methods class ArtifactToolUpdater: def get_latest_artifacttool(self, organization): artifacttool_binary_override_path = os.environ.get(ARTIFACTTOOL_OVERRIDE_PATH_ENVKEY) if artifacttool_binary_override_path is not None: artifacttool_binary_path = artifacttool_binary_override_path logger.debug("ArtifactTool path was overriden to '%s' due to environment variable %s", artifacttool_binary_path, ARTIFACTTOOL_OVERRIDE_PATH_ENVKEY) else: logger.debug("Checking for a new ArtifactTool") artifacttool_binary_path = self._get_artifacttool(organization) return artifacttool_binary_path def _get_artifacttool(self, organization): # pylint: disable=no-self-use logger.debug("Checking for ArtifactTool updates") # Call the auto-update API to find the current version of ArtifactTool # If AZURE_DEVOPS_EXT_ARTIFACTTOOL_OVERRIDE_URL is set, instead always download from the URL artifacttool_override_url = os.environ.get(ARTIFACTTOOL_OVERRIDE_URL_ENVKEY) if artifacttool_override_url is not None: release_uri = artifacttool_override_url release_id = "custom_{}".format(uuid.uuid4()) logger.debug("ArtifactTool download URL is being overridden to '%s' (ID '%s')", release_uri, release_id) else: override_version = os.environ.get(ARTIFACTTOOL_OVERRIDE_VERSION_ENVKEY) try: release = _get_current_release(organization, override_version) except Exception as ex: logger.debug(ex, exc_info=True) raise CLIError('Failed to update Universal Packages tooling.\n {}'.format(ex)) release_uri, release_id = release # Determine the path for the release, and skip downloading if it already exists logger.debug("Checking if we already have ArtifactTool release '%s'", release_id) release_dir = _compute_release_dir(release_id) if os.path.exists(release_dir): logger.debug("Not updating ArtifactTool because the current release already exists at '%s'", release_dir) return release_dir # Doesn't already exist. Download and extract the release. logger.debug("Updating to ArtifactTool release %s since it doesn't exist at %s", release_id, release_dir) _update_artifacttool(release_uri, release_id) return release_dir def _update_artifacttool(uri, release_id): root = _compute_artifacttool_root() # Remove all existing releases. In the future we may maintain some old versions, # but right now we always delete them. if os.path.isdir(root): for item in os.listdir(root): path = os.path.join(root, item) if os.path.isdir(path): logger.debug("Trying to remove old release %s", item) shutil.rmtree(path, ignore_errors=True) # Failing cleanup is not fatal with humanfriendly.Spinner(label="Downloading Universal Packages tooling ({})" .format(release_id), total=100, stream=sys.stderr) as spinner: spinner.step() logger.debug("Downloading ArtifactTool from %s", uri) # Make the request, determine the total size response = requests.get(uri, stream=True) content_length_header = response.headers['Content-Length'].strip() content_length = int(content_length_header) # Do the download, updating the progress bar content = io.BytesIO() bytes_so_far = 0 for chunk in response.iter_content(chunk_size=1024 * 512): if chunk: content.write(chunk) bytes_so_far += len(chunk) spinner.step(100 * float(bytes_so_far) / float(content_length)) # Extract the zip release_temp_dir = os.path.join(root, str(uuid.uuid4())) logger.debug("Extracting ArtifactTool to %s", release_temp_dir) f = zipfile.ZipFile(content) try: _mkdir_if_not_exist(release_temp_dir) f.extractall(path=release_temp_dir) # For Linux, ensure the executable bit is set on the binary "ArtifactTool" if it exists. # Python has a bug https://bugs.python.org/issue15795 where file permissions are not preserved. artifacttool_binary = os.path.join(release_temp_dir, "artifacttool") if os.path.exists(artifacttool_binary): artifacttool_stat = os.stat(artifacttool_binary) os.chmod(artifacttool_binary, artifacttool_stat.st_mode | stat.S_IXUSR | stat.S_IXGRP | stat.S_IXOTH) # Move the release into the real releases location release_dir = _compute_release_dir(release_id) if os.path.exists(release_dir): logger.warning( "The Universal Packages tool already exists at the location %s. Skipping download.", release_dir) else: logger.debug("Moving downloaded ArtifactTool from %s to %s", release_temp_dir, release_dir) # number of times to retry retries = 10 for _ in range(retries - 1): try: os.rename(release_temp_dir, release_dir) break except BaseException as ex: # pylint: disable=broad-except logger.debug( "An error occurred while renaming the Universal Packages tooling: %s. Retrying...", ex) time.sleep(1) else: os.rename(release_temp_dir, release_dir) logger.info("Downloaded Universal Packages tooling successfully") except BaseException as ex: # pylint: disable=broad-except logger.error("An error occurred while extracting the Universal Packages tooling: %s", ex) logger.debug("Removing temporary directory %s", release_temp_dir) shutil.rmtree(release_temp_dir, ignore_errors=True) def _get_current_release(organization, override_version): connection = get_connection(organization) client = connection.get_client('azext_devops.dev.common.client_tool.client_tool_client.ClientToolClient') logger.debug("Looking up current version of ArtifactTool...") # Distro returns empty strings on Windows currently, so don't even send distro_name = distro.id() or None distro_version = distro.version() or None release = client.get_clienttool_release( "ArtifactTool", os_name=platform.system(), arch=platform.machine(), distro_name=distro_name, distro_version=distro_version, version=override_version) return (release.uri, _compute_id(release)) if release is not None else None def _mkdir_if_not_exist(path): try: os.makedirs(path) except OSError: # Ignore errors that were likely because the directory already exists if not os.path.isdir(path): raise def _compute_id(release): return "{}_{}_{}".format(release.name, release.rid, release.version) def _compute_artifacttool_root(): az_devops_cli_root = os.path.join(AZ_DEVOPS_GLOBAL_CONFIG_DIR, 'cli', 'tools') return os.path.join(az_devops_cli_root, "artifacttool") def _compute_release_dir(release_id): return os.path.join(_compute_artifacttool_root(), release_id) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/client_tool/000077500000000000000000000000001360605530400305245ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/client_tool/__init__.py000066400000000000000000000006301360605530400326340ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import pkg_resources pkg_resources.declare_namespace(__name__) client_tool_client.py000066400000000000000000000043611360605530400346740ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/client_tool# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from azext_devops.devops_sdk.client import Client from . import models class ClientToolClient(Client): def __init__(self, base_url=None, creds=None): super(ClientToolClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '3fda18ba-dff2-42e6-8d10-c521b23b85fc' def get_clienttool_release( self, tool_name, os_name=None, arch=None, distro_name=None, distro_version=None, version=None): route_values = {} if tool_name is not None: route_values['toolName'] = self._serialize.url('tool_name', tool_name, 'str') query_parameters = {} if os_name is not None: query_parameters['osName'] = self._serialize.query('os_name', os_name, 'str') if arch is not None: query_parameters['arch'] = self._serialize.query('arch', arch, 'str') if distro_name is not None: query_parameters['distroName'] = self._serialize.query('distro_name', distro_name, 'str') if distro_version is not None: query_parameters['distroVersion'] = self._serialize.query('distro_version', distro_version, 'str') if version is not None: query_parameters['version'] = self._serialize.query('version', version, 'str') response = self._send(http_method='GET', location_id='187ec90d-dd1e-4ec6-8c57-937d979261e5', version='5.0-preview', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ClientToolRelease', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/client_tool/models/000077500000000000000000000000001360605530400320075ustar00rootroot00000000000000__init__.py000066400000000000000000000006641360605530400340470ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/client_tool/models# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from .client_tool_release import ClientToolRelease __all__ = [ 'ClientToolRelease' ] client_tool_release.py000066400000000000000000000015401360605530400363150ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/client_tool/models# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class ClientToolRelease(Model): _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'rid': {'key': 'rid', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'}, } def __init__(self, name=None, rid=None, version=None, uri=None): super(ClientToolRelease, self).__init__() self.name = name self.rid = rid self.version = version self.uri = uri azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/config.py000066400000000000000000000033611360605530400300330ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import os from knack.config import CLIConfig, get_config_parser from knack.util import ensure_dir from .const import (AZ_DEVOPS_CONFIG_DIR_ENVKEY, AZ_DEVOPS_DEFAULT_CONFIG_DIR, CLI_ENV_VARIABLE_PREFIX, CONFIG_FILE_NAME) _UNSET = object() def _get_config_dir(): azure_devops_config_dir = os.getenv(AZ_DEVOPS_CONFIG_DIR_ENVKEY, None) or AZ_DEVOPS_DEFAULT_CONFIG_DIR # Create a directory if it doesn't exist ensure_dir(azure_devops_config_dir) return azure_devops_config_dir AZ_DEVOPS_GLOBAL_CONFIG_DIR = _get_config_dir() AZ_DEVOPS_GLOBAL_CONFIG_PATH = os.path.join(AZ_DEVOPS_GLOBAL_CONFIG_DIR, CONFIG_FILE_NAME) class AzDevopsConfig(CLIConfig): def __init__(self, config_dir=AZ_DEVOPS_GLOBAL_CONFIG_DIR, config_env_var_prefix=CLI_ENV_VARIABLE_PREFIX): super(AzDevopsConfig, self).__init__(config_dir=config_dir, config_env_var_prefix=config_env_var_prefix) self.config_parser = get_config_parser() azdevops_config = AzDevopsConfig() azdevops_config.config_parser.read(AZ_DEVOPS_GLOBAL_CONFIG_PATH) def set_global_config_value(section, option, value): azdevops_config.set_value(section, option, _normalize_config_value(value)) azdevops_config.config_parser.read(AZ_DEVOPS_GLOBAL_CONFIG_PATH) def _normalize_config_value(value): if value: value = '' if value in ["''", '""'] else value return value azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/const.py000066400000000000000000000042561360605530400277200ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import os from azure.cli.core._environment import get_config_dir # Config directory AZ_CLI_GLOBAL_CONFIG_DIR = get_config_dir() _AZ_DEVOPS_CONFIG_DIR_NAME = 'azuredevops' AZ_DEVOPS_DEFAULT_CONFIG_DIR = os.path.join(AZ_CLI_GLOBAL_CONFIG_DIR, _AZ_DEVOPS_CONFIG_DIR_NAME) # Environment Variables CLI_ENV_VARIABLE_PREFIX = 'AZURE_DEVOPS_EXT_' AZ_DEVOPS_CONFIG_DIR_ENVKEY = CLI_ENV_VARIABLE_PREFIX + 'CONFIG_DIR' AZ_DEVOPS_GITHUB_PAT_ENVKEY = CLI_ENV_VARIABLE_PREFIX + 'GITHUB_PAT' AZ_DEVOPS_PIPELINES_VARIABLES_KEY_PREFIX = CLI_ENV_VARIABLE_PREFIX + 'PIPELINE_VAR_' # Import request Environment Variable GIT_SOURCE_PASSWORD_OR_PAT = CLI_ENV_VARIABLE_PREFIX + 'GIT_SOURCE_PASSWORD_OR_PAT' # Config file constants CONFIG_FILE_NAME = 'config' DEFAULTS_SECTION = 'defaults' DEVOPS_ORGANIZATION_DEFAULT = 'organization' DEVOPS_TEAM_PROJECT_DEFAULT = 'project' PAT_ENV_VARIABLE_NAME = CLI_ENV_VARIABLE_PREFIX + 'PAT' AUTH_TOKEN_ENV_VARIABLE_NAME = CLI_ENV_VARIABLE_PREFIX + 'AUTH_TOKEN' # Artifact tool variables ARTIFACTTOOL_OVERRIDE_PATH_ENVKEY = CLI_ENV_VARIABLE_PREFIX + "ARTIFACTTOOL_OVERRIDE_PATH" ARTIFACTTOOL_OVERRIDE_URL_ENVKEY = CLI_ENV_VARIABLE_PREFIX + "ARTIFACTTOOL_OVERRIDE_URL" ARTIFACTTOOL_OVERRIDE_VERSION_ENVKEY = CLI_ENV_VARIABLE_PREFIX + "ARTIFACTTOOL_OVERRIDE_VERSION" ARTIFACTTOOL_PAT_ENVKEY = CLI_ENV_VARIABLE_PREFIX + "ARTIFACTTOOL_PATVAR" # Telemetry Constants ORG_PRESENT_IN_COMMAND = 'OrgPresentInCommand' PROJECT_PRESENT_IN_COMMAND = 'ProjectPresentInCommand' REPO_PRESENT_IN_COMMAND = 'RepoPresentInCommand' ORG_PICKED_FROM_GIT = 'OrgPickedFromGit' PROJECT_PICKED_FROM_GIT = 'ProjectPickedFromGit' REPO_PICKED_FROM_GIT = 'RepoPickedFromGit' ORG_PICKED_FROM_CONFIG = 'OrgPickedFromConfig' ORG_IGNORED_FROM_CONFIG = 'OrgIgnoredFromConfig' PROJECT_PICKED_FROM_CONFIG = 'ProjectPickedFromConfig' PROJECT_IGNORED_FROM_CONFIG = 'ProjectIgnoredFromConfig' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/credential_store.py000066400000000000000000000150061360605530400321130ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import os import sys from knack.util import CLIError, ensure_dir from knack.log import get_logger from six.moves import configparser from .config import AZ_DEVOPS_GLOBAL_CONFIG_DIR from .pip_helper import install_keyring logger = get_logger(__name__) class CredentialStore: def __init__(self): self._initialize_keyring() def set_password(self, key, token): try: import keyring except ImportError: install_keyring() self._initialize_keyring() import keyring try: # check for and delete existing credential old_token = keyring.get_password(key, self._USERNAME) if old_token is not None: keyring.delete_password(key, self._USERNAME) logger.debug('Setting credential: %s', key) keyring.set_password(key, self._USERNAME, token) except Exception as ex: # pylint: disable=broad-except # store credentials in azuredevops config directory if keyring is missing or malfunctioning if sys.platform.startswith(self._LINUX_PLATFORM): logger.warning('Failed to store PAT using keyring; falling back to file storage.') logger.warning('You can clear the stored credential by running az devops logout.') logger.warning('Refer https://aka.ms/azure-devops-cli-auth to know more on sign in with PAT.') logger.debug('Keyring failed. ERROR :%s', ex) logger.debug('Storing credentials in the file: %s', self._PAT_FILE) creds_list = self._get_credentials_list() if key not in creds_list.sections(): creds_list.add_section(key) logger.debug('Added new entry to PAT file : %s ', key) creds_list.set(key, self._USERNAME, token) self._commit_change(creds_list) else: raise CLIError(ex) def get_password(self, key): try: import keyring except ImportError: return None token = None try: token = keyring.get_password(key, self._USERNAME) except Exception as ex: # pylint: disable=broad-except # fetch credentials from file if keyring is missing or malfunctioning if sys.platform.startswith(self._LINUX_PLATFORM): token = None else: raise CLIError(ex) # look for credential in file too for linux if token is None if token is None and sys.platform.startswith(self._LINUX_PLATFORM): token = self.get_PAT_from_file(key) return token def clear_password(self, key): try: import keyring except ImportError: install_keyring() self._initialize_keyring() import keyring if sys.platform.startswith(self._LINUX_PLATFORM): keyring_token = None file_token = None try: keyring_token = keyring.get_password(key, self._USERNAME) if keyring_token: keyring.delete_password(key, self._USERNAME) except Exception as ex: # pylint: disable=broad-except logger.debug("%s", ex) finally: file_token = self.get_PAT_from_file(key) if file_token: self.delete_PAT_from_file(key) if(keyring_token is None and file_token is None): raise CLIError(self._CRDENTIAL_NOT_FOUND_MSG) else: try: keyring.delete_password(key, self._USERNAME) except keyring.errors.PasswordDeleteError: raise CLIError(self._CRDENTIAL_NOT_FOUND_MSG) except RuntimeError as ex: # pylint: disable=broad-except raise CLIError(ex) def get_PAT_from_file(self, key): ensure_dir(AZ_DEVOPS_GLOBAL_CONFIG_DIR) logger.debug('Keyring not configured properly or package not found.' 'Looking for credentials with key:%s in the file: %s', key, self._PAT_FILE) creds_list = self._get_credentials_list() try: return creds_list.get(key, self._USERNAME) except (configparser.NoOptionError, configparser.NoSectionError): return None def delete_PAT_from_file(self, key): logger.debug('Keyring not configured properly or package not found.' 'Looking for credentials with key:%s in the file: %s', key, self._PAT_FILE) creds_list = self._get_credentials_list() if key not in creds_list.sections(): raise CLIError(self._CRDENTIAL_NOT_FOUND_MSG) creds_list.remove_section(key) self._commit_change(creds_list) @staticmethod def _get_config_parser(): if sys.version_info.major == 3: return configparser.ConfigParser(interpolation=None) return configparser.ConfigParser() @staticmethod def _get_credentials_list(): try: credential_list = CredentialStore._get_config_parser() credential_list.read(CredentialStore._PAT_FILE) return credential_list except BaseException: # pylint: disable=broad-except return CredentialStore._get_config_parser() @staticmethod def _commit_change(credential_list): with open(CredentialStore._PAT_FILE, 'w+') as creds_file: credential_list.write(creds_file) @staticmethod def _initialize_keyring(): try: import keyring except ImportError: return def _only_builtin(backend): return ( backend.__module__.startswith('keyring.backends.') and 'chain' not in backend.__module__ ) keyring.core.init_backend(_only_builtin) logger.debug('Keyring backend : %s', keyring.get_keyring()) # a value is required for the python config file that gets generated on some operating systems. _USERNAME = 'Personal Access Token' _LINUX_PLATFORM = 'linux' _PAT_FILE = os.path.join(AZ_DEVOPS_GLOBAL_CONFIG_DIR, 'personalAccessTokens') _CRDENTIAL_NOT_FOUND_MSG = 'The credential was not found' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/exception_handler.py000066400000000000000000000022251360605530400322570ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError logger = get_logger(__name__) def azure_devops_exception_handler(ex): # we are taking dependency on string here because taking dependency on # Azure DevOps Client will increase load time for every command exceptionTypeName = type(ex).__name__ if exceptionTypeName == 'AzureDevOpsServiceError': logger.debug('handling vsts service error') raise CLIError(ex) if exceptionTypeName == 'AzureDevOpsAuthenticationError': logger.debug('handling vsts auth error') raise CLIError(ex) if exceptionTypeName == 'ValueError': logger.debug('handling value error') raise CLIError(ex) logger.debug('handling generic error') import sys from six import reraise reraise(*sys.exc_info()) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/external_tool.py000066400000000000000000000062311360605530400314440ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import os import signal import subprocess import sys import humanfriendly from knack.log import get_logger from knack.util import CLIError logger = get_logger(__name__) class ExternalToolInvoker: _proc = None _terminating = False def __init__(self): signal.signal(signal.SIGINT, self._sigint_handler) self._args = None def start(self, command_args, env): if self._proc is not None: raise RuntimeError("Attempted to invoke already-running external tool") logger.debug("Running external command: %s", ' '.join(command_args)) DEVNULL = open(os.devnull, 'w') # Note: subprocess.DEVNULL not available on python 2.7 self._args = command_args self._proc = subprocess.Popen( command_args, shell=False, stdin=DEVNULL, stdout=subprocess.PIPE, stderr=subprocess.PIPE, env=env) def wait(self): if self._proc is None: return None # Ensure process completed, and emit error if returncode is non-zero (including any remaining stderr) self._proc.wait() if self._proc.returncode != 0 and not self._terminating: stderr = self._proc.stderr.read().decode('utf-8', 'ignore').strip() if stderr != "": stderr = "\n{}".format(stderr) raise CLIError("Process {proc} with PID {pid} exited with return code {code}{err}" .format(proc=self._args, pid=self._proc.pid, code=self._proc.returncode, err=stderr)) return self._proc def _sigint_handler(self): self._terminating = True if self._proc: # Would be better to try sending SIGINT first, # but that's hard to support on multiple platforms (esp Windows) logger.debug("Killing process %s", self._proc.pid) self._proc.kill() class ProgressReportingExternalToolInvoker(ExternalToolInvoker): _spinner = None def run(self, command_args, env, initial_progress_text, stderr_handler): with humanfriendly.Spinner(label=initial_progress_text, total=100, stream=sys.stderr) as self._spinner: self._spinner.step() # Start the process, process stderr for progress reporting, check the process result self.start(command_args, env) try: for bline in iter(self._proc.stderr.readline, b''): line = bline.decode('utf-8', 'ignore').strip() stderr_handler(line, self._update_progress) return self.wait() except IOError as ex: if not self._terminating: raise ex def _update_progress(self, progress_text, percentage): if self._spinner: self._spinner.step(label=progress_text, progress=percentage) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/file_cache.py000066400000000000000000000016331360605530400306300ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import os from knack.util import ensure_dir from azext_devops.devops_sdk._file_cache import get_cache, DEFAULT_MAX_AGE from .config import AZ_DEVOPS_GLOBAL_CONFIG_DIR def _get_cache_dir(): azdevops_config_dir = (os.getenv('AZURE_DEVOPS_CACHE_DIR', None) or os.path.join(AZ_DEVOPS_GLOBAL_CONFIG_DIR, 'cache')) ensure_dir(azdevops_config_dir) return azdevops_config_dir DEFAULT_CACHE_DIR = _get_cache_dir() def get_cli_cache(name, max_age=DEFAULT_MAX_AGE, cache_dir=DEFAULT_CACHE_DIR): return get_cache(name, max_age, cache_dir) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/format.py000066400000000000000000000021271360605530400300550ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger logger = get_logger(__name__) def trim_for_display(text, max_length): if not text: return text result = text if len(text) > max_length: result = text[0: max_length] + '...' logger.info('trimmed %s to %s', text, result) else: logger.info('not trimming %s', text) return result def date_time_to_only_date(date_time): try: from dateutil import parser result = str(parser.parse(date_time).date()) logger.info('trimmed %s to %s', date_time, result) return result except Exception as ex: # pylint: disable=broad-except logger.info('encountered error while parsing date time') logger.info(str(ex)) return date_time azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/git.py000066400000000000000000000160211360605530400273460ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import subprocess import sys from knack.log import get_logger from knack.util import CLIError from .uri import uri_parse logger = get_logger(__name__) _GIT_EXE = 'git' def set_config(key, value, local=True): scope = _get_git_config_scope_arg(local) subprocess.check_output([_GIT_EXE, 'config', scope, key, value]) def unset_config(key, local=True): scope = _get_git_config_scope_arg(local) subprocess.check_output([_GIT_EXE, 'config', scope, '--unset', key]) def get_config(key, local=True): scope = _get_git_config_scope_arg(local) return subprocess.check_output([_GIT_EXE, 'config', scope, key]) def _get_git_config_scope_arg(local): if local: return '--local' return '--global' def fetch_remote_and_checkout(refName, remote_name): subprocess.run([_GIT_EXE, 'fetch', remote_name, refName], check=False) subprocess.run([_GIT_EXE, 'checkout', get_branch_name_from_ref(refName)], check=False) subprocess.run([_GIT_EXE, 'pull', remote_name, get_branch_name_from_ref(refName)], check=False) def get_current_branch_name(): try: output = subprocess.check_output([_GIT_EXE, 'symbolic-ref', '--short', '-q', 'HEAD']) except BaseException as ex: # pylint: disable=broad-except logger.info('GitDetect: Could not detect current branch based on current working directory.') logger.debug(ex, exc_info=True) return None if sys.stdout.encoding is not None: result = output.decode(sys.stdout.encoding) else: result = output.decode() return result.strip() def get_remote_url(validation_function=None): remotes = get_git_remotes() if remotes is not None: if _ORIGIN_PUSH_KEY in remotes and (validation_function is None or validation_function(remotes[_ORIGIN_PUSH_KEY])): return remotes[_ORIGIN_PUSH_KEY] for k, value in remotes.items(): if k != _ORIGIN_PUSH_KEY and k.endswith('(push)') and (validation_function is None or validation_function(value)): return value return None def get_git_credentials(organization): parse_result = uri_parse(organization) protocol = parse_result.scheme host = parse_result.netloc standard_in = bytes('protocol={protocol}\nhost={host}'.format(protocol=protocol, host=host), 'utf-8') try: # pylint: disable=unexpected-keyword-arg output = subprocess.check_output([_GIT_EXE, 'credential-manager', 'get'], input=standard_in) except BaseException as ex: # pylint: disable=broad-except logger.info('GitDetect: Could not detect git credentials for current working directory.') logger.debug(ex, exc_info=True) return None if sys.stdout.encoding is not None: lines = output.decode(sys.stdout.encoding).split('\n') else: lines = output.decode().split('\n') properties = {} for line in lines: equal_position = line.find('=') if equal_position >= 0: properties[line[0:equal_position]] = line[equal_position + 1:] return properties def get_git_remotes(): if _git_remotes: return _git_remotes try: # Example output: # git remote - v # full https://mseng.visualstudio.com/DefaultCollection/VSOnline/_git/_full/VSO (fetch) # full https://mseng.visualstudio.com/DefaultCollection/VSOnline/_git/_full/VSO (push) # origin https://mseng.visualstudio.com/defaultcollection/VSOnline/_git/VSO (fetch) # origin https://mseng.visualstudio.com/defaultcollection/VSOnline/_git/VSO (push) output = subprocess.check_output([_GIT_EXE, 'remote', '-v'], stderr=subprocess.STDOUT) except BaseException as ex: # pylint: disable=broad-except logger.info('GitDetect: Could not detect current remotes based on current working directory.') logger.debug(ex, exc_info=True) return None if sys.stdout.encoding is not None: lines = output.decode(sys.stdout.encoding).split('\n') else: lines = output.decode().split('\n') for line in lines: components = line.strip().split() if len(components) == 3: _git_remotes[components[0] + components[2]] = components[1] return _git_remotes def resolve_git_refs(ref): """Prepends 'refs/' prefix to ref str if not already there. :param str ref: The text to validate. :rtype: str """ if ref is not None and not ref.startswith(REFS_PREFIX): ref = REFS_PREFIX + ref return ref def get_ref_name_from_ref(ref): """Removes 'refs/' prefix from ref str if there. :param ref: The text to validate. :type ref: str :rtype: str """ if ref is not None and ref.startswith(REFS_PREFIX): ref = ref[len(REFS_PREFIX):] return ref def resolve_git_ref_heads(ref): """Prepends 'refs/heads/' prefix to ref str if not already there. :param ref: The text to validate. :type ref: str :rtype: str """ if ref is not None and not ref.startswith(REF_HEADS_PREFIX) and not ref.startswith(REF_PULL_PREFIX): ref = REF_HEADS_PREFIX + ref return ref def get_branch_name_from_ref(ref): """Removes 'refs/heads/' prefix from ref str if there. :param ref: The text to validate. :type ref: str :rtype: str """ if ref is not None and ref.startswith(REF_HEADS_PREFIX): ref = ref[len(REF_HEADS_PREFIX):] return ref def setup_git_alias(alias, command, local=False): try: set_config(key=_get_alias_key(alias), value=_get_alias_value(command), local=local) except OSError: raise CLIError('Setting the git alias failed. Ensure git is installed and in your path.') def clear_git_alias(alias, local=False): unset_config(key=_get_alias_key(alias), local=local) def is_git_alias_setup(alias, command, local=False): try: try: value = get_config(key=_get_alias_key(alias), local=local) except subprocess.CalledProcessError: return False return _get_alias_value(command) == value.decode(sys.stdout.encoding).strip() except OSError: raise CLIError('Checking the git config values failed. Ensure git is installed and in your path.') def _get_alias_key(alias): return 'alias.' + alias def _get_alias_value(command): mime = '.cmd' if sys.platform.lower().startswith('win') else '' return '!f() { exec az' + mime + ' ' + command + ' \"$@\"; }; f' _git_remotes = {} _ORIGIN_PUSH_KEY = 'origin(push)' REFS_PREFIX = 'refs/' REF_HEADS_PREFIX = 'refs/heads/' REF_PULL_PREFIX = 'refs/pull/' GIT_CREDENTIALS_USERNAME_KEY = 'username' GIT_CREDENTIALS_PASSWORD_KEY = 'password' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/github_credential_manager.py000066400000000000000000000105051360605530400337320ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import base64 import requests from knack.prompting import prompt, prompt_pass from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.utils import datetime_now_as_string, singleton from azext_devops.dev.common.const import AZ_DEVOPS_GITHUB_PAT_ENVKEY logger = get_logger(__name__) @singleton class GithubCredentialManager(): """ GithubCredentialManager """ def __init__(self): self.username = None self.password = None self.token = None def _create_token(self, note=None): logger.warning('We need to create a Personal Access Token to communicate with GitHub. ' 'A new PAT with scopes (admin:repo_hook, repo, user) will be created.') logger.warning('You can set the PAT in the environment variable (%s) to avoid getting prompted.', AZ_DEVOPS_GITHUB_PAT_ENVKEY) self.username = prompt(msg='Enter your GitHub username (leave blank for using already generated PAT): ') print('') if not self.username: while not self.token: self.token = prompt_pass(msg='Enter your GitHub PAT: ', help_string='Generate a Personal Access Token ' 'with approproate permissions from GitHub Developer settings and paste here.') print('') return self.password = prompt_pass(msg='Enter your GitHub password: ', confirm=True) print('') if not note: note = "AzureDevopsCLIExtensionToken_" + datetime_now_as_string() encoded_pass = base64.b64encode(self.username.encode('utf-8') + b':' + self.password.encode('utf-8')) basic_auth = 'basic ' + encoded_pass.decode("utf-8") request_body = { 'scopes': [ 'admin:repo_hook', 'repo', 'user' ], 'note': note } headers = {'Content-Type': 'application/json' + '; charset=utf-8', 'Accept': 'application/json', 'Authorization': basic_auth} response = self.post_authorization_request(headers=headers, body=request_body) if (response.status_code == 401 and response.headers.get('X-GitHub-OTP') and response.headers.get('X-GitHub-OTP').startswith('required')): two_factor_code = None while not two_factor_code: two_factor_code = prompt_pass(msg='Enter your two factor authentication code: ') print('') headers = {'Content-Type': 'application/json' + '; charset=utf-8', 'Accept': 'application/json', 'Authorization': basic_auth, 'X-GitHub-OTP': two_factor_code} response = self.post_authorization_request(headers=headers, body=request_body) import json response_json = json.loads(response.content) if response.status_code == 200 or response.status_code == 201: logger.warning('Created new personal access token with scopes (admin:repo_hook, repo, user). Name: %s ' 'You can revoke this from your GitHub settings if the pipeline is no longer required.', note) self.token = response_json['token'] else: raise CLIError('Could not create a Personal Access Token for GitHub. Check your credentials and try again.') def post_authorization_request(self, headers, body): # pylint: disable=no-self-use return requests.post('https://api.github.com/authorizations', json=body, headers=headers) def get_token(self, note=None): import os github_pat = os.getenv(AZ_DEVOPS_GITHUB_PAT_ENVKEY, None) if github_pat: logger.warning('Using GitHub PAT token found in environment variable (%s).', AZ_DEVOPS_GITHUB_PAT_ENVKEY) return github_pat if not self.token: self._create_token(note=note) return self.token azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/identities.py000066400000000000000000000134741360605530400307350ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.util import CLIError from .file_cache import get_cli_cache from .uuid import is_uuid from .services import get_connection_data, get_identity_client def resolve_identity_as_id(identity_filter, organization): """Takes an identity name, email, alias, or id, and returns the id. """ if identity_filter is None or is_uuid(identity_filter): return identity_filter if identity_filter.lower() == ME: return get_current_identity(organization).id identity = resolve_identity(identity_filter, organization) if identity is not None: return identity.id return None def resolve_identity_as_identity_descriptor(identity_filter, organization): """Takes an identity name, email, alias, or id, and returns the id. """ if identity_filter is None: return identity_filter if identity_filter.lower() == ME: return get_current_identity(organization).descriptor identity = resolve_identity(identity_filter, organization) if identity is not None: return identity.descriptor return None def resolve_identity_as_display_name(identity_filter, organization): """Takes an identity name, email, alias, or id, and returns the display name. """ identity = resolve_identity(identity_filter, organization) if identity is not None: if identity_filter.lower() == ME: return get_current_identity(organization).provider_display_name return get_display_name_from_identity(identity) return None def resolve_identity(identity_filter, organization): """Takes an identity name, email, alias, or id, and returns the identity. """ if identity_filter is None: return None if identity_filter.lower() == ME: return get_current_identity(organization) identity_client = get_identity_client(organization) if identity_filter.find(' ') > 0 or identity_filter.find('@') > 0: identities = identity_client.read_identities(search_filter='General', filter_value=identity_filter) if identities is None or not identities: identities = identity_client.read_identities(search_filter='DirectoryAlias', filter_value=identity_filter) else: identities = identity_client.read_identities(search_filter='DirectoryAlias', filter_value=identity_filter) if identities is None or not identities: identities = identity_client.read_identities(search_filter='General', filter_value=identity_filter) if not identities: raise CLIError('Could not resolve identity: ' + identity_filter) if len(identities) > 1: # prefer users with same domain identities_with_tenant = [] for identity in identities: if 'Domain' in identity.properties and '$value' in identity.properties['Domain']: current_user = get_current_identity(organization) if 'Domain' in current_user.properties and '$value' in current_user.properties['Domain']\ and identity.properties['Domain']['$value'] ==\ current_user.properties['Domain']['$value']: identities_with_tenant.append(identity) if len(identities_with_tenant) == 1: return identities_with_tenant[0] raise CLIError('There are multiple identities found for "' + identity_filter + '" ' 'Please provide a more specific identifier for this identity.') return identities[0] def get_current_identity(organization): return get_connection_data(organization).authenticated_user def get_identities(organization, identity_ids): identity_client = get_identity_client(organization) return identity_client.read_identities(identity_ids=identity_ids) def ensure_display_names_in_cache(organization, identity_ids): ids_to_look_up = [] for identity_id in identity_ids: if not _display_name_cache[identity_id]: ids_to_look_up.append(identity_id) if ids_to_look_up: resolved_identities = get_identities(organization, ','.join(ids_to_look_up)) for identity in resolved_identities: _display_name_cache[identity.id] = get_display_name_from_identity(identity) def get_display_name_from_identity_id(organization, identity_id): if not _display_name_cache[identity_id]: ensure_display_names_in_cache(organization, [identity_id]) if _display_name_cache[identity_id]: return _display_name_cache[identity_id] return None def get_display_name_from_identity(identity): if identity.custom_display_name is not None and identity.custom_display_name != '': return identity.custom_display_name return identity.provider_display_name def get_account_from_identity(identity): if 'Account' in identity.properties and '$value' in identity.properties['Account']: return identity.properties['Account']['$value'] return identity.provider_display_name def get_identity_descriptor_from_subject_descriptor(subject_descriptor, organization): identity_client = get_identity_client(organization) identities = identity_client.read_identities(subject_descriptors=subject_descriptor) if identities: return identities[0].descriptor return subject_descriptor ME = 'me' _display_name_cache = get_cli_cache('identity_display_names', 3600 * 6) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/operations.py000066400000000000000000000016311360605530400307470ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import time from .services import get_operations_client def wait_for_long_running_operation(organization, operation_id, interval_seconds=5): operation_client = get_operations_client(organization) operation = operation_client.get_operation(operation_id) while not has_operation_completed(operation): time.sleep(interval_seconds) operation = operation_client.get_operation(operation_id) return operation def has_operation_completed(operation): status = operation.status.lower() return status in ('succeeded', 'failed', 'cancelled') azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/pip_helper.py000066400000000000000000000021451360605530400307140ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError from azure.cli.core.extension.operations import _run_pip from azure.cli.core.extension import get_extension_path logger = get_logger(__name__) def install_keyring(): _install_package('keyring~=17.1.1') def _install_package(package_name): logger.debug('installing %s', package_name) extensionPath = get_extension_path('azure-devops') pip_args = ['install', package_name, '--target', extensionPath] pip_status_code = _run_pip(pip_args) # pylint: disable=protected-access if pip_status_code > 0: raise CLIError('An error occurred. Pip failed with status code {} for package {}. ' 'Use --debug for more information.'.format(pip_status_code, package_name)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/prompting.py000066400000000000000000000076301360605530400306100ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import sys from knack.log import get_logger from knack.prompting import NoTTYException, verify_is_a_tty, prompt logger = get_logger(__name__) def delete_last_line(): "Use this function to delete the last line in the STDOUT" from colorama import init, deinit init() # cursor up one line sys.stdout.write('\x1b[1A') # delete last line sys.stdout.write('\x1b[2K') deinit() def prompt_user_friendly_choice_list(msg, a_list, default=1, help_string=None, error_msg=None): """Prompt user to select from a list of possible choices. :param msg: A message displayed to the user before the choice list :type msg: str :param a_list: The list of choices (list of strings or list of dicts with 'name' & 'desc') "type a_list: list :param default: The default option that should be chosen if user doesn't enter a choice :type default: int :param help_string: Help message to be displayed on the input terminal :type help_string: str :param error_msg: Error message to display if the terminal is non interactive :type error_msg: str :returns: The list index of the item chosen. """ verify_is_a_tty_or_raise_error(error_msg=error_msg) options = '\n'.join([' [{}] {}{}' .format(i + 1, x['name'] if isinstance(x, dict) and 'name' in x else x, ' - ' + x['desc'] if isinstance(x, dict) and 'desc' in x else '') for i, x in enumerate(a_list)]) allowed_vals = list(range(1, len(a_list) + 1)) linesToDelete = len(a_list) + 1 while True: val = prompt('{}\n{}\nPlease enter a choice [Default choice({})]: '.format(msg, options, default)) if val == '?' and help_string is not None: for x in range(0, linesToDelete): delete_last_line() print('Please enter a choice [Default choice({})]: {}'.format(default, '?')) print(help_string) continue if not val: val = '{}'.format(default) try: ans = int(val) if ans in allowed_vals: for x in range(0, linesToDelete): delete_last_line() print('Please enter a choice [Default choice({})]: {}'.format(default, a_list[ans - 1])) print('') # array index is 0-based, user input is 1-based return ans - 1 raise ValueError except ValueError: for x in range(0, linesToDelete): delete_last_line() print('Please enter a choice [Default choice({})]: {}'.format(default, val)) logger.warning('Valid values are %s', allowed_vals) def prompt_not_empty(msg, help_string=None): """ Wrapper on knacks prompt function which does not return until non none value is recieved from user input. """ if not help_string: help_string = 'This field cannot be left blank.' user_input = None while not user_input: user_input = prompt(msg=msg, help_string=help_string) return user_input def verify_is_a_tty_or_raise_error(error_msg=None): """ Verifies interactive environment raises NoTTYException with the error_msg string if the environment is non-interative """ try: verify_is_a_tty() except NoTTYException: raise NoTTYException(error_msg) def try_verify_is_a_tty(): """ Return True for TTY and False for non-TTY terminals """ try: verify_is_a_tty() return True except NoTTYException: return False azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/services.py000066400000000000000000000424321360605530400304130ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import datetime import os from collections import OrderedDict from msrest.authentication import BasicAuthentication from azure.cli.core._profile import Profile from knack.log import get_logger from knack.util import CLIError from azext_devops.devops_sdk.connection import Connection from azext_devops.version import VERSION from .arguments import should_detect from .const import (DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT, DEVOPS_TEAM_PROJECT_DEFAULT, PAT_ENV_VARIABLE_NAME, ORG_PRESENT_IN_COMMAND, PROJECT_PRESENT_IN_COMMAND, REPO_PRESENT_IN_COMMAND, ORG_PICKED_FROM_GIT, PROJECT_PICKED_FROM_GIT, REPO_PICKED_FROM_GIT, ORG_PICKED_FROM_CONFIG, ORG_IGNORED_FROM_CONFIG, PROJECT_PICKED_FROM_CONFIG, PROJECT_IGNORED_FROM_CONFIG) from ._credentials import get_credential from .git import get_remote_url from .vsts_git_url_info import VstsGitUrlInfo from .uri import uri_parse_instance_from_git_uri, is_valid_url from .uuid import is_uuid from .telemetry import vsts_tracking_data, init_telemetry logger = get_logger(__name__) def get_connection(organization): organization = organization.lower() if organization not in _connection: credentials = _get_credentials(organization) try: from .telemetry import try_send_telemetry_data _connection[organization] = _get_connection(organization, credentials) try_send_telemetry_data(organization) except Exception as ex: logger.debug(ex, exc_info=True) raise CLIError(ex) return _connection[organization] def _get_credentials(organization): pat_token_present = False if PAT_ENV_VARIABLE_NAME in os.environ or get_credential(organization) is not None: logger.debug("PAT is present which can be used against this instance") pat_token_present = True try: token_from_az_login = get_token_from_az_logins(organization, pat_token_present) if token_from_az_login: credentials = BasicAuthentication('', token_from_az_login) return credentials except BaseException as ex: # pylint: disable=broad-except logger.debug("az login is not present") logger.debug(ex, exc_info=True) if PAT_ENV_VARIABLE_NAME in os.environ: pat = os.environ[PAT_ENV_VARIABLE_NAME] logger.info("received PAT from environment variable") else: pat = get_credential(organization) if pat is not None: logger.info("Creating connection with personal access token.") credentials = BasicAuthentication('', pat) # credentials can be incorrect but they are present then it means user has already done az devops login to set # so let the user get a 401 return credentials raise get_authentication_error('Before you can run Azure DevOps commands, you need to run the login command' '(az login if using AAD/MSA identity else az devops login if using PAT token) to ' 'setup credentials.') def validate_token_for_instance(organization, credentials): logger.debug("instance recieved in validate_token_for_instance %s", organization) organization = uri_parse_instance_from_git_uri(organization) logger.debug("instance processed in validate_token_for_instance %s", organization) connection = _get_connection(organization, credentials) core_client = connection.get_client(VSTS_MODULE + 'v5_0.core.core_client.CoreClient') try: core_client.get_projects(state_filter='all', top=1, skip=0) return True except BaseException as ex2: # pylint: disable=broad-except logger.debug(ex2, exc_info=True) logger.debug("Failed to connect using provided credentials") return False def get_default_subscription_info(): """ Returns the Id, name, tenantID and environmentName of the default subscription None if no default is set or no subscription is found """ profile = Profile() dummy_user = profile.get_current_account_user() # noqa: F841 subscriptions = profile.load_cached_subscriptions(False) for subscription in subscriptions: if subscription['isDefault']: return subscription['id'], subscription['name'], subscription['tenantId'], subscription['environmentName'] logger.debug('Your account does not have a default Azure subscription. Please run \'az login\' to setup account.') return None, None, None, None def get_token_from_az_logins(organization, pat_token_present): profile = Profile() dummy_user = profile.get_current_account_user() # noqa: F841 subscriptions = profile.load_cached_subscriptions(False) tenantsDict = OrderedDict() # first loop to make sure the first identity we try with is coming from selected subscription for subscription in subscriptions: if subscription['isDefault'] == "true": tenantsDict[(subscription['tenantId'], subscription['user']['name'])] = '' for subscription in subscriptions: tenantsDict[(subscription['tenantId'], subscription['user']['name'])] = '' skipValidateToken = False if pat_token_present is False and len(tenantsDict) == 1: skipValidateToken = True try: for key, dummy_value in tenantsDict.items(): try: logger.debug('trying to get token (temp) for tenant %s and user %s ', key[0], key[1]) token = get_token_from_az_login(profile, key[1], key[0]) credentials = BasicAuthentication('', token) if skipValidateToken is True: return token if validate_token_for_instance(organization, credentials): return token logger.debug('invalid token obtained for tenant %s', key[0]) except BaseException as ex2: # pylint: disable=broad-except logger.debug(ex2) logger.debug('failed while trying to get token for tenant %s', key[0]) except BaseException as ex: # pylint: disable=broad-except logger.debug(ex) return '' def get_token_from_az_login(profile, user, tenant): try: auth_token = profile.get_access_token_for_resource(user, tenant, '499b84ac-1321-427f-aa17-267ca6975798') return auth_token except BaseException as ex: # pylint: disable=broad-except logger.debug('not able to get token from az login') logger.debug(ex, exc_info=True) return "" def _get_connection(organization, credentials): return Connection(get_base_url(organization), creds=credentials, user_agent='devOpsCli/{}'.format(VERSION)) def get_first_vss_instance_uri(): for key in _connection: return key def get_release_client(team_instance=None): connection = get_connection(team_instance) return connection.get_client(VSTS_MODULE + 'v5_0.release.release_client.ReleaseClient') def get_build_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.build.build_client.BuildClient') def get_new_pipeline_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_1.build.build_client.BuildClient') def get_new_task_agent_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_1.task_agent.task_agent_client.TaskAgentClient') def get_new_cix_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_1.cix.cix_client.CixClient') def get_ci_client(organization=None): connection = get_connection(organization) return connection.get_client( VSTS_MODULE + 'v5_0.customer_intelligence.customer_intelligence_client.CustomerIntelligenceClient') def get_core_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.core.core_client.CoreClient') def get_core_client_v51(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_1.core.core_client.CoreClient') def get_wiki_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.wiki.wiki_client.WikiClient') def get_git_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.git.git_client.GitClient') def get_graph_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.graph.graph_client.GraphClient') def get_identity_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.identity.identity_client.IdentityClient') def get_service_endpoint_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.service_endpoint.service_endpoint_client.ServiceEndpointClient') def get_location_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.location.location_client.LocationClient') def get_member_entitlement_management_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.member_entitlement_management.' 'member_entitlement_management_client.MemberEntitlementManagementClient') def get_operations_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.operations.operations_client.OperationsClient') def get_policy_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.policy.policy_client.PolicyClient') def get_security_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.security.security_client.SecurityClient') def get_settings_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.settings.settings_client.SettingsClient') def get_task_agent_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.task_agent.task_agent_client.TaskAgentClient') def get_work_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.work.work_client.WorkClient') def get_work_item_tracking_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.work_item_tracking.' 'work_item_tracking_client.WorkItemTrackingClient') def get_extension_client(organization=None): connection = get_connection(organization) return connection.get_client(VSTS_MODULE + 'v5_0.extension_management.extension_management_client.ExtensionManagementClient') def get_base_url(organization): if organization is not None: return organization raise _team_organization_arg_error() def _team_organization_arg_error(): return CLIError('--organization must be specified. The value should be the URI of your Azure DevOps ' 'organization, for example: https://dev.azure.com/MyOrganization/ or your Azure DevOps Server ' 'organization. You can set a default value by running: az devops configure --defaults ' 'organization=https://dev.azure.com/MyOrganization/. For auto detection to work ' '(--detect true), you must be in a local Git directory that has a "remote" referencing a ' 'Azure DevOps or Azure DevOps Server repository.') def _raise_team_project_arg_error(): raise CLIError('--project must be specified. The value should be the ID or name of a team project. ' 'You can set a default value by running: az devops configure --defaults project=.') def _raise_repo_requird_arg_error(): raise CLIError('--repository must be specified') def resolve_instance_project_and_repo( detect, organization, project=None, project_required=True, repo=None, repo_required=False): init_telemetry() vsts_tracking_data.properties[ORG_PRESENT_IN_COMMAND] = organization is not None vsts_tracking_data.properties[PROJECT_PRESENT_IN_COMMAND] = project is not None vsts_tracking_data.properties[REPO_PRESENT_IN_COMMAND] = repo is not None if organization is None: if should_detect(detect): git_info = get_vsts_info_from_current_remote_url() organization = git_info.uri vsts_tracking_data.properties[ORG_PICKED_FROM_GIT] = organization is not None if project is None: project = git_info.project vsts_tracking_data.properties[PROJECT_PICKED_FROM_GIT] = project is not None if repo is None: repo = git_info.repo vsts_tracking_data.properties[REPO_PICKED_FROM_GIT] = repo is not None if organization is None: organization = _resolve_instance_from_config(organization) vsts_tracking_data.properties[ORG_PICKED_FROM_CONFIG] = organization is not None else: orgFromConfig = _resolve_instance_from_config(organization) vsts_tracking_data.properties[ORG_IGNORED_FROM_CONFIG] = orgFromConfig is not None if project is None: project = _resolve_project_from_config(project, project_required) vsts_tracking_data.properties[PROJECT_PICKED_FROM_CONFIG] = organization is not None else: projectFromConfig = _resolve_project_from_config(project, False) vsts_tracking_data.properties[PROJECT_IGNORED_FROM_CONFIG] = projectFromConfig is not None if not is_valid_url(organization): raise _team_organization_arg_error() if project_required and project is None: _raise_team_project_arg_error() if repo_required and repo is None: _raise_repo_requird_arg_error() return organization, project, repo def resolve_instance_and_project(detect, organization, project=None, project_required=True): organization, project, _ = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, project_required=project_required) return organization, project def resolve_instance(detect, organization): organization, _ = resolve_instance_and_project( detect=detect, organization=organization, project_required=False) return organization def _resolve_instance_from_config(organization): from .config import azdevops_config if organization is None: if azdevops_config.has_option(DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT): organization = azdevops_config.get(DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT) if organization is None or organization == '': raise _team_organization_arg_error() return organization def _resolve_project_from_config(project, project_required=True): from .config import azdevops_config if project is None: if azdevops_config.has_option(DEFAULTS_SECTION, DEVOPS_TEAM_PROJECT_DEFAULT): project = azdevops_config.get(DEFAULTS_SECTION, DEVOPS_TEAM_PROJECT_DEFAULT) if project_required and (project is None or project == ''): _raise_team_project_arg_error() return project def get_vsts_info_from_current_remote_url(): start = datetime.datetime.now() info = VstsGitUrlInfo(get_remote_url(VstsGitUrlInfo.is_vsts_url_candidate)) end = datetime.datetime.now() duration = end - start logger.info("Detect: Url discovery took %s", str(duration)) return info def get_connection_data(organization): organization = organization.lower() if organization in _connection_data: return _connection_data[organization] location_client = get_location_client(organization) _connection_data[organization] = location_client.get_connection_data() return _connection_data[organization] def get_authentication_error(message): return CLIError(str(message) + " Please see https://aka.ms/azure-devops-cli-auth for more information.") def clear_connection_cache(): _connection.clear() def get_project_id_from_name(organization, project): if not is_uuid(project): core_client = get_core_client(organization) team_project = core_client.get_project(project_id=project) return team_project.id return project _connection_data = {} _connection = OrderedDict() VSTS_MODULE = 'azext_devops.devops_sdk.' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/telemetry.py000066400000000000000000000110341360605530400305740ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import threading from knack.log import get_logger from azext_devops.devops_sdk.v5_0.customer_intelligence.models import CustomerIntelligenceEvent logger = get_logger(__name__) vsts_tracking_data = CustomerIntelligenceEvent() def init_telemetry(): global vsts_tracking_data # pylint: disable=global-statement if vsts_tracking_data is None: vsts_tracking_data = CustomerIntelligenceEvent() if vsts_tracking_data.properties is None: vsts_tracking_data.properties = {} def try_send_telemetry_data(organization): try: if _is_telemetry_enabled(): logger.debug('Azure devops telemetry enabled.') _try_send_tracking_ci_event_async(organization) else: logger.debug('Azure devops telemetry disabled.') except BaseException as ex: # pylint: disable=broad-except logger.debug(ex, exc_info=True) logger.debug('Azure devops telemetry sending failed.') def set_tracking_data(**kwargs): init_telemetry() try: vsts_tracking_data.area = 'AzureDevopsCli' vsts_tracking_data.properties = {} command_line_args = vars(kwargs.get('args', None)) command_line_split = command_line_args['command'].split() vsts_tracking_data.feature = command_line_split[0] if len(command_line_split) > 1: vsts_tracking_data.properties['Command'] = ' '.join(command_line_split[1:]) args = [] for key, value in command_line_args.items(): if value and isinstance(value, str) and not key.startswith('_') and key != 'command': args.append(key) vsts_tracking_data.properties['Args'] = ' '.join(args) vsts_tracking_data.properties['ShellType'] = _get_shell_type() import sys vsts_tracking_data.properties['IsInteractive'] = str(sys.stdin.isatty()) vsts_tracking_data.properties['OutputType'] = command_line_args['_output_format'] except BaseException as ex: # pylint: disable=broad-except logger.debug(ex, exc_info=True) def _is_telemetry_enabled(): from azure.cli.core import get_default_cli collect_telemetry = None # Read the telemetry flag from az cli config file not the az devops extension config file az_cli_ctx = get_default_cli() az_config = az_cli_ctx.config if az_config.has_option('core', 'collect_telemetry'): collect_telemetry = az_config.get('core', 'collect_telemetry') return bool(collect_telemetry is None or collect_telemetry != 'no') def _try_send_tracking_ci_event_async(organization=None): if (vsts_tracking_data is not None and vsts_tracking_data.area is not None and vsts_tracking_data.feature is not None): logger.debug("Logging telemetry to azure devops server.") try: thread = threading.Thread(target=_send_tracking_ci_event, args=[organization]) thread.start() except BaseException as ex: # pylint: disable=broad-except # we should always continue if we fail to set tracking data logger.debug(ex, exc_info=True) else: logger.debug("Skipping telemetry to azure devops server.") def _send_tracking_ci_event(organization=None, ci_client=None): from .services import get_ci_client if ci_client is None: ci_client = get_ci_client(organization=organization) try: ci_client.publish_events([vsts_tracking_data]) return True except BaseException as ex: # pylint: disable=broad-except logger.debug(ex, exc_info=True) return False # azure cli uses this to get shell type from os environment def _get_shell_type(): import os if 'ZSH_VERSION' in os.environ: return 'zsh' if 'BASH_VERSION' in os.environ: return 'bash' if 'KSH_VERSION' in os.environ or 'FCEDIT' in os.environ: return 'ksh' if 'WINDIR' in os.environ: return 'cmd' return _remove_cmd_chars(_remove_symbols(os.environ.get('SHELL'))) def _remove_cmd_chars(s): if isinstance(s, str): return s.replace("'", '_').replace('"', '_').replace('\r\n', ' ').replace('\n', ' ') return s def _remove_symbols(s): if isinstance(s, str): for c in '$%^&|': s = s.replace(c, '_') return s azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/uri.py000066400000000000000000000031601360605530400273620ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- try: from urllib.parse import urlparse, quote except ImportError: from urllib import quote from urlparse import urlparse def uri_parse(url): # Special handling for NEW ssh urls which do not start with ssh:// if not url.startswith('ssh:') and ("vs-ssh.visualstudio.com" in url or "ssh.dev.azure.com" in url): # e.g. org@vs-ssh.visualstudio.com:v3/org/project/repo # e.g. git@ssh.dev.azure.com:v3/org/Project/Repo # append ssh at start to set correct scheme return urlparse("ssh://{original_uri}".format(original_uri=url)) return urlparse(url) def uri_quote(query_data): return quote(query_data) # Only works for hosted scenario def uri_parse_instance_from_git_uri(uri): if "/_git" in uri: parsed_uri = urlparse(uri) # old Uri format if "visualstudio.com" in uri: return '{uri.scheme}://{uri.netloc}/'.format(uri=parsed_uri) # new Uri format if "dev.azure.com" in uri: org_name = parsed_uri.path.strip("/").split("/")[0] return parsed_uri.scheme + "://" + parsed_uri.hostname + "/" + org_name return uri def is_valid_url(url): parsed_url = uri_parse(url) if not parsed_url.scheme or not parsed_url.netloc: return False return True azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/utils.py000066400000000000000000000050451360605530400277270ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError logger = get_logger(__name__) FILE_ENCODING_TYPES = ['ascii', 'utf-16be', 'utf-16le', 'utf-8'] def read_file_content(file_path, encoding): if not file_path or not encoding: raise CLIError("File path {} or encoding {} is missing.".format(file_path, encoding)) if encoding not in FILE_ENCODING_TYPES: raise CLIError("File encoding {encoding} is not supported.".format(encoding=encoding)) try: import sys if sys.version_info[0] < 3: return _read_file_content_ver2(file_path, encoding) return _read_file_content_ver3(file_path, encoding) except UnicodeDecodeError as ex: logger.debug(msg=ex) raise CLIError("Unable to decode file '{}' with '{}' encoding.".format( file_path, encoding)) def open_file(filepath): """ Opens a file in the default editor for the file type and exits. """ import subprocess import platform import os if platform.system() == 'Darwin': # macOS subprocess.call(('open', filepath)) elif platform.system() == 'Windows': # Windows os.system(filepath) else: # linux variants subprocess.call(('xdg-open', filepath)) def delete_dir(path): import shutil shutil.rmtree(path) def datetime_now_as_string(): from datetime import datetime now = datetime.utcnow().isoformat() return ''.join(e for e in now if e.isalnum()) def open_url(url): """Opens the url in new window in the default browser. """ from webbrowser import open_new open_new(url=url) # Decorators def singleton(myclass): instance = [None] def wrapper(*args, **kwargs): if instance[0] is None: instance[0] = myclass(*args, **kwargs) return instance[0] return wrapper def _read_file_content_ver3(file_path, encoding): logger.debug('inside read_file_content_ver3') with open(file_path, 'r', encoding=encoding) as f: return f.read() def _read_file_content_ver2(file_path, encoding): logger.debug('inside read_file_content_ver2') with open(file_path) as f: return f.read().decode(encoding) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/uuid.py000066400000000000000000000012631360605530400275330ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import re def is_uuid(text): """Returns true if the text is a GUID. :param text: The text to validate. :type text: str :rtype: bool """ return _uuid_regex.match(text) is not None _uuid_regex = re.compile(r'^[\da-f]{8}-([\da-f]{4}-){3}[\da-f]{12}$', re.IGNORECASE) EMPTY_UUID = '00000000-0000-0000-0000-000000000000' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/common/vsts_git_url_info.py000066400000000000000000000154741360605530400323350ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model from knack.log import get_logger from .file_cache import get_cli_cache from .uri import uri_parse logger = get_logger(__name__) class VstsGitUrlInfo(): """ VstsGitUrlInfo. """ def __init__(self, remote_url): from msrest import Serializer, Deserializer from msrest.exceptions import DeserializationError, SerializationError self.project = None self.repo = None self.uri = None if remote_url is not None: logger.debug("Remote url: %s", remote_url) models = {'_RemoteInfo': self._RemoteInfo} remote_url = remote_url.lower() remote_info = None if _git_remote_info_cache[remote_url]: deserializer = Deserializer(models) try: remote_info = deserializer.deserialize_data(_git_remote_info_cache[remote_url], '_RemoteInfo') except DeserializationError as ex: logger.debug(ex, exc_info=True) if remote_info is not None: self.project = remote_info.project self.repo = remote_info.repository self.uri = remote_info.server_url if remote_info is None: vsts_info = self.get_vsts_info(remote_url) if vsts_info is not None: self.project = vsts_info.repository.project.id self.repo = vsts_info.repository.id apis_path_segment = '/_apis/' apis_path_segment_pos = vsts_info.repository.url.find(apis_path_segment) if apis_path_segment_pos >= 0: self.uri = vsts_info.repository.url[:apis_path_segment_pos] else: self.uri = vsts_info.server_url serializer = Serializer(models) try: _git_remote_info_cache[remote_url] = \ serializer.serialize_data(self._RemoteInfo(self.project, self.repo, self.uri), '_RemoteInfo') except SerializationError as ex: logger.debug(ex, exc_info=True) @staticmethod def get_vsts_info(remote_url): from azext_devops.devops_sdk.v5_0.git.git_client import GitClient from .services import _get_credentials components = uri_parse(remote_url.lower()) if components.scheme == 'ssh': # Convert to https url. netloc = VstsGitUrlInfo.convert_ssh_netloc_to_https_netloc(components.netloc) if netloc is None: return None # New ssh urls do not have _ssh so path is like org/project/repo # We need to convert it into project/_git/repo/ or org/project/_git/repo for dev.azure.com urls path = components.path ssh_path_segment = '_ssh/' ssh_path_segment_pos = components.path.find(ssh_path_segment) if ssh_path_segment_pos < 0: # new ssh url path_vals = components.path.strip('/').split('/') if path_vals and len(path_vals) == 3: if 'visualstudio.com' in netloc: path = '{proj}/{git}/{repo}'.format(proj=path_vals[1], git='_git', repo=path_vals[2]) elif 'dev.azure.com' in netloc: path = '{org}/{proj}/{git}/{repo}'.format( org=path_vals[0], proj=path_vals[1], git='_git', repo=path_vals[2]) else: logger.debug("Unsupported url format encountered in git repo url discovery.") uri = 'https://' + netloc + '/' + path else: # old ssh urls uri = 'https://' + netloc + '/' + path.strip('/') ssh_path_segment_pos = uri.find(ssh_path_segment) if ssh_path_segment_pos >= 0: uri = uri[:ssh_path_segment_pos] + '_git/' + uri[ssh_path_segment_pos + len(ssh_path_segment):] else: uri = remote_url credentials = _get_credentials(uri) try: return GitClient.get_vsts_info_by_remote_url(uri, credentials=credentials) except Exception as ex: # pylint: disable=broad-except exceptionTypeName = type(ex).__name__ if exceptionTypeName == 'AzureDevOpsAuthenticationError': logger.warning('Auto-detect from git remote url failed because of insufficient permissions.') return None import sys from six import reraise reraise(*sys.exc_info()) @staticmethod def convert_ssh_netloc_to_https_netloc(netloc): if netloc is None: return None if netloc.find('@') < 0: # on premise url logger.warning('DevOps SSH URLs are not supported for repo auto-detection yet. See the following issue for \ latest updates: https://github.com/Microsoft/azure-devops-cli-extension/issues/142') return None # hosted url import re regex = re.compile(r'([^@]+)@[^\.]+(\.[^:]+)') match = regex.match(netloc) if match is not None: # Handle new and old url formats if match.group(1) == 'git' and match.group(2) == '.dev.azure.com': return match.group(2).strip('.') return match.group(1) + match.group(2) return None @staticmethod def is_vsts_url_candidate(url): if url is None: return False components = uri_parse(url.lower()) if components.netloc == 'github.com': return False if components.path is not None \ and (components.path.find('/_git/') >= 0 or components.path.find('/_ssh/') >= 0 or components.scheme == 'ssh'): return True return False class _RemoteInfo(Model): _attribute_map = { 'project': {'key': 'project', 'type': 'str'}, 'repository': {'key': 'repository', 'type': 'str'}, 'server_url': {'key': 'serverUrl', 'type': 'str'} } def __init__(self, project=None, repository=None, server_url=None): super(VstsGitUrlInfo._RemoteInfo, self).__init__() # pylint: disable=protected-access self.project = project self.repository = repository self.server_url = server_url _git_remote_info_cache = get_cli_cache('remotes', 0) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/000077500000000000000000000000001360605530400267115ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/__init__.py000066400000000000000000000007301360605530400310220ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import pkg_resources from ._help import load_pipelines_help pkg_resources.declare_namespace(__name__) load_pipelines_help() azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/_format.py000066400000000000000000000304151360605530400307150ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from collections import OrderedDict import dateutil _VALUE_TRUNCATION_LENGTH = 80 def transform_builds_table_output(result): table_output = [] for item in result: table_output.append(_transform_build_row(item)) return table_output def transform_build_table_output(result): table_output = [_transform_build_row(result)] return table_output def _transform_build_row(row): from azext_devops.dev.common.git import REF_HEADS_PREFIX table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Number'] = row['buildNumber'] table_row['Status'] = row['status'] if row['result']: table_row['Result'] = row['result'] else: table_row['Result'] = ' ' table_row['Definition ID'] = row['definition']['id'] table_row['Definition Name'] = row['definition']['name'] if row['sourceBranch']: source_branch = row['sourceBranch'] if source_branch[0:len(REF_HEADS_PREFIX)] == REF_HEADS_PREFIX: source_branch = source_branch[len(REF_HEADS_PREFIX):] table_row['Source Branch'] = source_branch else: table_row['Source Branch'] = ' ' queued_time = dateutil.parser.parse(row['queueTime']).astimezone(dateutil.tz.tzlocal()) table_row['Queued Time'] = str(queued_time.date()) + ' ' + str(queued_time.time()) table_row['Reason'] = row['reason'] return table_row def transform_build_tags_output(result): table_output = [] for item in result: table_output.append(_transform_build_tags_row(item)) return table_output def _transform_build_tags_row(row): table_row = OrderedDict() table_row['Tags'] = row return table_row def transform_definitions_table_output(result): table_output = [] include_draft_column = False for item in result: if item['quality'] == 'draft': include_draft_column = True break for item in result: table_output.append(_transform_definition_row(item, include_draft_column)) return table_output def transform_definition_table_output(result): table_output = [_transform_definition_row(result, result['quality'] == 'draft')] return table_output def _transform_definition_row(row, include_draft_column=False): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] if include_draft_column: if row['quality'] == 'draft': table_row['Draft'] = True else: table_row['Draft'] = ' ' if row['queueStatus']: table_row['Status'] = row['queueStatus'] else: table_row['Status'] = ' ' if row['queue']: table_row['Default Queue'] = row['queue']['name'] else: table_row['Default Queue'] = ' ' return table_row def _get_task_key(row): return row['name'].lower() def transform_releases_table_output(result): table_output = [] for item in result: table_output.append(_transform_release_row(item)) return table_output def transform_release_table_output(result): table_output = [_transform_release_row(result)] return table_output def _transform_release_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Definition Name'] = row['releaseDefinition']['name'] table_row['Created By'] = row['createdBy']['displayName'] created_on = dateutil.parser.parse(row['createdOn']).astimezone(dateutil.tz.tzlocal()) table_row['Created On'] = str(created_on.date()) + ' ' + str(created_on.time()) table_row['Status'] = row['status'] table_row['Description'] = row['description'] return table_row def transform_release_definitions_table_output(result): table_output = [] for item in result: table_output.append(_transform_release_definition_row(item)) return table_output def transform_release_definition_table_output(result): table_output = [_transform_release_definition_row(result)] return table_output def _transform_release_definition_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['CreatedBy'] = row['createdBy']['displayName'] table_row['Created On'] = row['createdOn'] return table_row def transform_runs_artifact_table_output(result): table_output = [] for item in result: table_output.append(_transform_runs_artifact_row(item)) return table_output def _transform_runs_artifact_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Type'] = row['resource']['type'] return table_row def transform_pipelines_table_output(result): table_output = [] include_draft_column = False for item in result: if item['quality'] == 'draft': include_draft_column = True break for item in result: table_output.append(_transform_pipeline_row(item, include_draft_column)) return table_output def transform_pipeline_table_output(result): table_output = [_transform_pipeline_row(result, result['quality'] == 'draft')] return table_output def _transform_pipeline_row(row, include_draft_column=False): table_row = OrderedDict() table_row['ID'] = row['id'] path = row['path'] table_row['Path'] = path[:50] + '..' if len(path) > 50 else path name = row['name'] table_row['Name'] = name[:50] + '..' if len(name) > 50 else name if include_draft_column: if row['quality'] == 'draft': table_row['Draft'] = True else: table_row['Draft'] = ' ' if row['queueStatus']: table_row['Status'] = row['queueStatus'] else: table_row['Status'] = ' ' if row['queue']: table_row['Default Queue'] = row['queue']['name'] else: table_row['Default Queue'] = ' ' return table_row def transform_pipeline_runs_table_output(result): table_output = [] for item in result: table_output.append(_transform_pipeline_run_row(item)) return table_output def transform_pipeline_or_run_table_output(result): table_output = [_transform_pipeline_or_run_row(result)] return table_output def _transform_pipeline_or_run_row(row): if row.get("buildNumber", None): # Hack to detect the json object is definition or run return _transform_pipeline_run_row(row) return _transform_pipeline_row(row) def transform_pipeline_run_table_output(result): table_output = [_transform_pipeline_run_row(result)] return table_output def _transform_pipeline_run_row(row): from azext_devops.dev.common.git import REF_HEADS_PREFIX table_row = OrderedDict() table_row['Run ID'] = row['id'] table_row['Number'] = row['buildNumber'] table_row['Status'] = row['status'] if row['result']: table_row['Result'] = row['result'] else: table_row['Result'] = ' ' table_row['Pipeline ID'] = row['definition']['id'] table_row['Pipeline Name'] = row['definition']['name'] if row['sourceBranch']: source_branch = row['sourceBranch'] if source_branch[0:len(REF_HEADS_PREFIX)] == REF_HEADS_PREFIX: source_branch = source_branch[len(REF_HEADS_PREFIX):] table_row['Source Branch'] = source_branch else: table_row['Source Branch'] = ' ' queued_time = dateutil.parser.parse(row['queueTime']).astimezone(dateutil.tz.tzlocal()) table_row['Queued Time'] = str(queued_time.date()) + ' ' + str(queued_time.time()) table_row['Reason'] = row['reason'] return table_row def transform_pipelines_pools_table_output(result): table_output = [] for item in result: table_output.append(_transform_pipeline_pool_row(item)) return table_output def transform_pipelines_pool_table_output(result): table_output = [_transform_pipeline_pool_row(result)] return table_output def _transform_pipeline_pool_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Is Hosted'] = row['isHosted'] table_row['Pool Type'] = row['poolType'] return table_row def transform_pipelines_agents_table_output(result): table_output = [] for item in result: table_output.append(_transform_pipeline_agent_row(item)) return table_output def transform_pipelines_agent_table_output(result): table_output = [_transform_pipeline_agent_row(result)] return table_output def _transform_pipeline_agent_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Is Enabled'] = row['enabled'] table_row['Status'] = row['status'] table_row['Version'] = row['version'] return table_row def transform_pipelines_queues_table_output(result): table_output = [] for item in result: table_output.append(_transform_pipeline_queue_row(item)) return table_output def transform_pipelines_queue_table_output(result): table_output = [_transform_pipeline_queue_row(result)] return table_output def _transform_pipeline_queue_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Pool IsHosted'] = row['pool']['isHosted'] table_row['Pool Type'] = row['pool']['poolType'] return table_row def transform_pipelines_variable_groups_table_output(result): table_output = [] for item in result: table_output.append(_transform_pipeline_variable_group_row(item)) return table_output def transform_pipelines_variable_group_table_output(result): table_output = [_transform_pipeline_variable_group_row(result)] return table_output def _transform_pipeline_variable_group_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Type'] = row['type'] table_row['Description'] = row['description'] if row.get('authorized', None) is not None: table_row['Is Authorized'] = row['authorized'] table_row['Number of Variables'] = len(row['variables']) return table_row def transform_pipelines_variables_table_output(result): table_output = [] for key, value in result.items(): table_output.append(_transform_pipeline_variable_row(key, value)) return table_output def _transform_pipeline_variable_row(key, value): table_row = OrderedDict() table_row['Name'] = key table_row['Allow Override'] = 'True' if value['allowOverride'] else 'False' table_row['Is Secret'] = 'True' if value['isSecret'] else 'False' val = value['value'] if value['value'] is not None else '' if len(val) > _VALUE_TRUNCATION_LENGTH: val = val[0:_VALUE_TRUNCATION_LENGTH] + '...' table_row['Value'] = val return table_row def transform_pipelines_var_group_variables_table_output(result): table_output = [] for key, value in result.items(): table_output.append(_transform_pipeline_var_group_variable_row(key, value)) return table_output def _transform_pipeline_var_group_variable_row(key, value): table_row = OrderedDict() table_row['Name'] = key table_row['Is Secret'] = 'True' if value['isSecret'] else 'False' val = value['value'] if value['value'] is not None else '' if len(val) > _VALUE_TRUNCATION_LENGTH: val = val[0:_VALUE_TRUNCATION_LENGTH] + '...' table_row['Value'] = val return table_row def transform_pipelines_folders_table_output(result): table_output = [] for item in result: table_output.append(_transform_pipeline_folder_row(item)) return table_output def transform_pipelines_folder_table_output(result): table_output = [_transform_pipeline_folder_row(result)] return table_output def _transform_pipeline_folder_row(row): table_row = OrderedDict() table_row['Path'] = row['path'] val = row['description'] if row['description'] is not None else '' if len(val) > _VALUE_TRUNCATION_LENGTH: val = val[0:_VALUE_TRUNCATION_LENGTH] + '...' table_row['Description'] = val return table_row azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/_help.py000066400000000000000000000107151360605530400303560ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.help_files import helps def load_pipelines_help(): helps['pipelines'] = """ type: group short-summary: Manage Azure Pipelines. long-summary: This command group is a part of the azure-devops extension. """ helps['pipelines runs'] = """ type: group short-summary: Manage pipeline runs. long-summary: """ helps['pipelines runs tag'] = """ type: group short-summary: Manage pipeline run tags. long-summary: """ helps['pipelines build'] = """ type: group short-summary: Manage builds. long-summary: """ helps['pipelines variable-group'] = """ type: group short-summary: Manage variable groups. long-summary: """ helps['pipelines variable-group variable'] = """ type: group short-summary: Manage variables in a variable group. long-summary: """ helps['pipelines pool'] = """ type: group short-summary: Manage agent pools. long-summary: """ helps['pipelines folder'] = """ type: group short-summary: Manage folders for organizing pipelines. long-summary: """ helps['pipelines folder delete'] = """ type: command short-summary: Delete a folder. long-summary: This will delete all pipelines in the folder. """ helps['pipelines agent'] = """ type: group short-summary: Manage agents. long-summary: """ helps['pipelines queue'] = """ type: group short-summary: Manage agent queues. long-summary: """ helps['pipelines variable'] = """ type: group short-summary: Manage pipeline variables. long-summary: """ helps['pipelines build tag'] = """ type: group short-summary: Manage build tags. long-summary: """ helps['pipelines build definition'] = """ type: group short-summary: Manage build definitions. long-summary: """ helps['pipelines release'] = """ type: group short-summary: Manage releases. long-summary: """ helps['pipelines release definition'] = """ type: group short-summary: Manage release definitions. long-summary: """ helps['pipelines runs artifact'] = """ type: group short-summary: Manage pipeline run artifacts. long-summary: """ helps['pipelines create'] = """ type: command short-summary: Create a new Azure Pipeline (YAML based). long-summary: examples: - name: Create an Azure Pipeline from local checkout repository context text: | Repository name/url (--repository), type (--repository-type) and branch name (--branch) will be detected from the local git repository az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project' - name: Create an Azure Pipeline for a repository hosted on Github using clone url text: | az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project' --repository https://github.com/SampleOrg/SampleRepo --branch master - name: Create an Azure Pipeline for a repository hosted on Github organization SampleOrg, repository name SampleRepo text: | az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project' --repository SampleOrg/SampleRepoName --branch master --repository-type github - name: Create an Azure Pipeline for a repository hosted in a Azure Repo in the same project text: | az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project' --repository SampleRepoName --branch master --repository-type tfsgit - name: Create an Azure Pipeline for a repository with the pipeline yaml already checked in into the repository text: | Service connection required for non Azure Repos can be optionally provided in the command to run it non interatively az pipelines create --name 'ContosoBuild' --description 'Pipeline for contoso project' --repository https://github.com/SampleOrg/SampleRepo --branch master --yml-path azure-pipelines.yml [--service-connection SERVICE_CONNECTION] """ azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/agent_pool_queue.py000066400000000000000000000133351360605530400326230ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from azext_devops.dev.common.services import (get_new_task_agent_client, resolve_instance, resolve_instance_and_project) logger = get_logger(__name__) def list_pools(pool_name=None, pool_type=None, action=None, organization=None, detect=None): """ List agent pools :param pool_name: Filter the list with matching pool name. :type pool_name: str :param pool_type: Filter the list with type of pool. :type pool_type: str :param action: Filter the list with user action permitted. :type action: str """ organization = resolve_instance(organization=organization, detect=detect) task_agent_client = get_new_task_agent_client(organization=organization) return task_agent_client.get_agent_pools( pool_name=pool_name, properties=None, pool_type=pool_type, action_filter=action) def show_pool(pool_id, action=None, organization=None, detect=None): """ Show agent pool details :param pool_id: Id of the pool to list the details. :type pool_id: int :param action: Filter the list with user action permitted. :type action: str """ organization = resolve_instance(organization=organization, detect=detect) task_agent_client = get_new_task_agent_client(organization=organization) return task_agent_client.get_agent_pool(pool_id=pool_id, properties=None, action_filter=action) def list_agents(pool_id, agent_name=None, include_capabilities=None, include_assigned_request=None, include_last_completed_request=None, demands=None, organization=None, detect=None): """ Get a list of agents in a pool :param pool_id: The agent pool containing the agents. :type pool_id: int :param agent_name: Filter on agent name. :type agent_name: str :param include_capabilities: Whether to include the agents' capabilities in the response. :type include_capabilities: bool :param include_assigned_request: Whether to include details about the agents' current work. :type include_assigned_request: bool :param include_last_completed_request: Whether to include details about the agents' most recent completed work. :type include_last_completed_request: bool :param demands: Filter by demands the agents can satisfy. Comma separated list. :type demands: str """ organization = resolve_instance(organization=organization, detect=detect) task_agent_client = get_new_task_agent_client(organization=organization) if demands: demands = list(map(str, demands.split(','))) return task_agent_client.get_agents( pool_id=pool_id, agent_name=agent_name, include_capabilities=include_capabilities, include_last_completed_request=include_last_completed_request, include_assigned_request=include_assigned_request, property_filters=None, demands=demands) def show_agent(pool_id, agent_id, include_capabilities=None, include_assigned_request=None, include_last_completed_request=None, organization=None, detect=None): """ Show agent details :param pool_id: The agent pool containing the agent. :type pool_id: int :param agent_id: The agent ID to get information about. :type agent_id: str :param include_capabilities: Whether to include the agents' capabilities in the response. :type include_capabilities: bool :param include_assigned_request: Whether to include details about the agents' current work. :type include_assigned_request: bool :param include_last_completed_request: Whether to include details about the agents' most recent completed work. :type include_last_completed_request: bool """ organization = resolve_instance(organization=organization, detect=detect) task_agent_client = get_new_task_agent_client(organization=organization) return task_agent_client.get_agent( pool_id=pool_id, agent_id=agent_id, include_capabilities=include_capabilities, include_assigned_request=include_assigned_request, include_last_completed_request=include_last_completed_request, property_filters=None) def list_queues(queue_name=None, action=None, project=None, organization=None, detect=None): """ List agent queues :param queue_name: Filter the list with matching queue name regex. e.g. *ubuntu* for queue with name 'Hosted Ubuntu 1604' :type queue_name: str :param action: Filter by whether the calling user has use or manage permissions :type action: str """ organization, project = resolve_instance_and_project(organization=organization, project=project, detect=detect) task_agent_client = get_new_task_agent_client(organization=organization) return task_agent_client.get_agent_queues(project=project, queue_name=queue_name, action_filter=action) def show_queue(queue_id, action=None, project=None, organization=None, detect=None): """ Show details of agent queue :param queue_id: Id of the agent queue to get information about. :type queue_id: str :param action: Filter by whether the calling user has use or manage permissions :type action: str """ organization, project = resolve_instance_and_project(organization=organization, project=project, detect=detect) task_agent_client = get_new_task_agent_client(organization=organization) return task_agent_client.get_agent_queue(project=project, queue_id=queue_id, action_filter=action) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/arguments.py000066400000000000000000000144131360605530400312730ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.arguments import enum_choice_list from azure.cli.core.commands.parameters import get_three_state_flag _BUILD_REASON_VALUES = ['all', 'batchedCI', 'buildCompletion', 'checkInShelveset', 'individualCI', 'manual', 'pullRequest', 'schedule', 'triggered', 'userCreated', 'validateShelveset'] _BUILD_RESULT_VALUES = ['canceled', 'failed', 'none', 'partiallySucceeded', 'succeeded'] _BUILD_STATUS_VALUES = ['all', 'cancelling', 'completed', 'inProgress', 'none', 'notStarted', 'postponed'] _PIPELINES_QUERY_ORDER = ['NameAsc', 'NameDesc', 'ModifiedAsc', 'ModifiedDesc', 'None'] _PIPELINES_RUNS_QUERY_ORDER = ['FinishTimeAsc', 'FinishTimeDesc', 'StartTimeAsc', 'StartTimeDesc', 'QueueTimeAsc', 'QueueTimeDesc'] _AGENT_POOL_TYPES = ['automation', 'deployment'] _ACTION_FILTER_TYPES = ['use', 'manage', 'none'] _VAR_GROUPS_QUERY_ORDER = ['Asc', 'Desc'] _FOLDERS_QUERY_ORDER = ['Asc', 'Desc', 'None'] # pylint: disable=too-many-statements def load_build_arguments(self, _): with self.argument_context('pipelines build list') as context: context.argument('definition_ids', nargs='*', type=int) context.argument('tags', nargs='*') context.argument('reason', **enum_choice_list(_BUILD_REASON_VALUES)) context.argument('result', **enum_choice_list(_BUILD_RESULT_VALUES)) context.argument('status', **enum_choice_list(_BUILD_STATUS_VALUES)) with self.argument_context('pipelines build queue') as context: context.argument('definition_id', type=int) context.argument('variables', nargs='*') with self.argument_context('pipelines build definition list') as context: context.argument( 'repository_type', choices=['tfsversioncontrol', 'tfsgit', 'git', 'github', 'githubenterprise', 'bitbucket', 'svn'], type=str.lower) with self.argument_context('pipelines release list') as context: context.argument('definition_id', type=int) with self.argument_context('pipelines release create') as context: context.argument('definition_id', type=int) context.argument('artifact_metadata_list', nargs='*') with self.argument_context('pipelines release definition list') as context: context.argument('artifact_type', choices=['build', 'jenkins', 'github', 'externaltfsbuild', 'git', 'tfvc'], type=str.lower) with self.argument_context('pipelines runs list') as context: context.argument('pipeline_ids', nargs='*', type=int) context.argument('tags', nargs='*') context.argument('reason', **enum_choice_list(_BUILD_REASON_VALUES)) context.argument('result', **enum_choice_list(_BUILD_RESULT_VALUES)) context.argument('status', **enum_choice_list(_BUILD_STATUS_VALUES)) context.argument('query_order', **enum_choice_list(_PIPELINES_RUNS_QUERY_ORDER)) with self.argument_context('pipelines run') as context: context.argument('id', type=int) context.argument('variables', nargs='*') with self.argument_context('pipelines list') as context: context.argument('query_order', **enum_choice_list(_PIPELINES_QUERY_ORDER)) context.argument( 'repository_type', choices=['tfsversioncontrol', 'tfsgit', 'git', 'github', 'githubenterprise', 'bitbucket', 'svn'], type=str.lower) with self.argument_context('pipelines create') as context: context.argument('repository_type', choices=['tfsgit', 'github'], type=str.lower) context.argument('yml_path', options_list=('--yml-path', '--yaml-path')) context.argument('skip_first_run', options_list=['--skip-first-run', '--skip-run'], arg_type=get_three_state_flag()) with self.argument_context('pipelines update') as context: context.argument('yml_path', options_list=('--yml-path', '--yaml-path')) context.argument('name', deprecate_info=context.deprecate(redirect='--id', target='--name', hide=True)) with self.argument_context('pipelines pool') as context: context.argument('pool_id', options_list=('--pool-id', '--id')) context.argument('action', **enum_choice_list(_ACTION_FILTER_TYPES)) context.argument('pool_type', **enum_choice_list(_AGENT_POOL_TYPES)) with self.argument_context('pipelines agent') as context: context.argument('agent_id', options_list=('--agent-id', '--id')) context.argument('include_capabilities', arg_type=get_three_state_flag()) context.argument('include_assigned_request', arg_type=get_three_state_flag()) context.argument('include_last_completed_request', arg_type=get_three_state_flag()) with self.argument_context('pipelines queue') as context: context.argument('queue_id', options_list=('--queue-id', '--id')) context.argument('action', **enum_choice_list(_ACTION_FILTER_TYPES)) with self.argument_context('pipelines variable-group') as context: context.argument('group_id', options_list=('--group-id', '--id')) context.argument('variables', nargs='*') context.argument('query_order', **enum_choice_list(_VAR_GROUPS_QUERY_ORDER)) context.argument('action_filter', options_list=('--action-filter', '--action'), **enum_choice_list(_ACTION_FILTER_TYPES)) context.argument('secret', arg_type=get_three_state_flag()) context.argument('authorize', arg_type=get_three_state_flag()) context.argument('prompt_value', arg_type=get_three_state_flag()) with self.argument_context('pipelines variable') as context: context.argument('secret', arg_type=get_three_state_flag()) context.argument('prompt_value', arg_type=get_three_state_flag()) context.argument('allow_override', arg_type=get_three_state_flag()) with self.argument_context('pipelines folder') as context: context.argument('query_order', **enum_choice_list(_FOLDERS_QUERY_ORDER)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/build.py000066400000000000000000000205531360605530400303670ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from webbrowser import open_new from knack.log import get_logger from azext_devops.devops_sdk.v5_0.build.models import Build, DefinitionReference, AgentPoolQueue from azext_devops.dev.common.git import resolve_git_ref_heads from azext_devops.dev.common.identities import resolve_identity_as_id from azext_devops.dev.common.services import (get_build_client, resolve_instance_and_project) from azext_devops.dev.common.uri import uri_quote from .build_definition import get_definition_id_from_name logger = get_logger(__name__) def build_queue(definition_id=None, definition_name=None, branch=None, variables=None, open=False, # pylint: disable=redefined-builtin organization=None, project=None, detect=None, commit_id=None, queue_id=None): """Request (queue) a build. :param definition_id: ID of the definition to queue. Required if --name is not supplied. :type definition_id: int :param definition_name: Name of the definition to queue. Ignored if --id is supplied. :type definition_name: str :param branch: Branch to build. Required if there is not a default branch set up on the definition. Example: refs/heads/master or master or refs/pull/1/merge :type branch: str :param variables: Space separated "name=value" pairs for the variables you would like to set. :type variables: [str] :param open: Open the build results page in your web browser. :type open: bool :param commit_id: Commit ID of the branch to build. :type commit_id: str :param queue_id: Queue Id of the pool that will be used to queue the build. :type queue_id: str :rtype: :class:` ` """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) if definition_id is None and definition_name is None: raise ValueError('Either the --definition-id argument or the --definition-name argument ' + 'must be supplied for this command.') client = get_build_client(organization) if definition_id is None: definition_id = get_definition_id_from_name(definition_name, client, project) definition_reference = DefinitionReference(id=definition_id) build = Build(definition=definition_reference) build.source_branch = resolve_git_ref_heads(branch) build.source_version = commit_id if queue_id is not None: build.queue = AgentPoolQueue() build.queue.id = queue_id if variables is not None and variables: build.parameters = {} for variable in variables: separator_pos = variable.find('=') if separator_pos >= 0: build.parameters[variable[:separator_pos]] = variable[separator_pos + 1:] else: raise ValueError('The --variables argument should consist of space separated "name=value" pairs.') queued_build = client.queue_build(build=build, project=project) if open: _open_build(queued_build, organization) return queued_build def build_show(id, open=False, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Get the details of a build. :param id: ID of the build. :type id: int :param open: Open the build results page in your web browser. :type open: bool :rtype: :class:` ` """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) build = client.get_build(build_id=id, project=project) if open: _open_build(build, organization) return build def build_list(definition_ids=None, branch=None, organization=None, project=None, detect=None, top=None, result=None, status=None, reason=None, tags=None, requested_for=None): """List build results. :param definition_ids: IDs (space separated) of definitions to list builds for. :type definition_ids: list of int :param branch: Filter by builds for this branch. :type branch: str :param top: Maximum number of builds to list. :type top: int :param result: Limit to builds with this result. :type result: str :param status: Limit to builds with this status. :type status: str :param reason: Limit to builds with this reason. :type reason: str :param tags: Limit to builds with each of the specified tags. Space separated. :type tags: list of str :param requested_for: Limit to builds requested for this user or group. :type requested_for: str :rtype: :class:` ` """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) if definition_ids is not None and definition_ids: definition_ids = list(set(definition_ids)) # make distinct if tags is not None and tags: tags = list(set(tags)) # make distinct builds = client.get_builds(definitions=definition_ids, project=project, branch_name=resolve_git_ref_heads(branch), top=top, result_filter=result, status_filter=status, reason_filter=reason, tag_filters=tags, requested_for=resolve_identity_as_id(requested_for, organization)) return builds def add_build_tags(build_id, tags, organization=None, project=None, detect=None): """Add tag(s) for a build. :param build_id: ID of the build. :type build_id: int :param tags: Tag(s) to be added to the build. [Comma seperated values] :type tags: str :rtype: list of str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_build_client(organization) tags = list(map(str, tags.split(','))) if len(tags) == 1: tags = client.add_build_tag(project=project, build_id=build_id, tag=tags[0]) else: tags = client.add_build_tags(tags=tags, project=project, build_id=build_id) return tags def delete_build_tag(build_id, tag, organization=None, project=None, detect=None): """Delete a build tag. :param build_id: ID of the build. :type build_id: int :param tag: Tag to be deleted from the build. :type tag: str :rtype: list of str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_build_client(organization) tags = client.delete_build_tag(project=project, build_id=build_id, tag=tag) return tags def get_build_tags(build_id, organization=None, project=None, detect=None): """Get tags for a build :param build_id: ID of the build. :type build_id: int :rtype: list of str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_build_client(organization) tags = client.get_build_tags(build_id=build_id, project=project) return tags def _open_build(build, organization): """Open the build results page in your web browser. :param :class:` ` build: :param str organization: """ # https://dev.azure.com/OrgName/ProjectName/_build/index?buildId=1234 project = build.project.name url = organization.rstrip('/') + '/' + uri_quote(project) + '/_build/index?buildid='\ + uri_quote(str(build.id)) logger.debug('Opening web page: %s', url) open_new(url=url) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/build_definition.py000066400000000000000000000133551360605530400326010ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from webbrowser import open_new from knack.log import get_logger from azext_devops.dev.common.services import (get_build_client, get_git_client, resolve_instance_and_project, resolve_instance_project_and_repo) from azext_devops.dev.common.uri import uri_quote from azext_devops.dev.common.uuid import is_uuid logger = get_logger(__name__) def build_definition_list(name=None, top=None, organization=None, project=None, repository=None, repository_type=None, detect=None): """List build definitions. :param name: Limit results to definitions with this name or starting with this name. Examples: "FabCI" or "Fab*" :type name: bool :param top: Maximum number of definitions to list. :type top: int :param repository: Limit results to definitions associated with this repository. :type repository: str :param repository_type: Limit results to definitions associated with this repository type. It is mandatory to pass 'repository' argument along with this argument. :type repository_type: str :rtype: [BuildDefinitionReference] """ organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, repo=repository) client = get_build_client(organization) query_order = 'DefinitionNameAscending' repository_type = None if repository is not None: if repository_type is None: repository_type = 'TfsGit' if repository_type.lower() == 'tfsgit': resolved_repository = _resolve_repository_as_id(repository, organization, project) else: resolved_repository = repository if resolved_repository is None: raise ValueError("Could not find a repository with name '{}', in project '{}'." .format(repository, project)) else: resolved_repository = None definition_references = client.get_definitions(project=project, name=name, repository_id=resolved_repository, repository_type=repository_type, top=top, query_order=query_order) return definition_references def build_definition_show(id=None, name=None, open=False, organization=None, project=None, # pylint: disable=redefined-builtin detect=None): """Get the details of a build definition. :param id: ID of the definition. :type id: int :param name: Name of the definition. Ignored if --id is supplied. :type name: str :param open: Open the definition summary page in your web browser. :type open: bool :rtype: BuildDefinitionReference """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) if id is None: if name is not None: id = get_definition_id_from_name(name, client, project) else: raise ValueError("Either the --id argument or the --name argument must be supplied for this command.") build_definition = client.get_definition(definition_id=id, project=project) if open: _open_definition(build_definition, organization) return build_definition def _open_definition(definition, organization): """Opens the build definition in the default browser. :param :class:` ` definition: :param str organization: """ # https://dev.azure.com/OrgName/ProjectName/_build/index?definitionId=1234 project = definition.project.name url = organization.rstrip('/') + '/' + uri_quote(project) + '/_build/index?definitionId='\ + uri_quote(str(definition.id)) logger.debug('Opening web page: %s', url) open_new(url=url) def fix_path_for_api(path): # Path with no preceeding '\' is not correctly interpreted so hack to add it. if path: if path.startswith('/'): path = path[1:] if not path.startswith('\\'): path = '\\' + path return path def get_definition_id_from_name(name, client, project, path=None): path = fix_path_for_api(path) definition_references = client.get_definitions(project=project, name=name, path=path) if len(definition_references) == 1: return definition_references[0].id if len(definition_references) > 1: if is_uuid(project): project = definition_references[0].project.name message = 'Multiple definitions were found matching name "{name}" in project "{project}". Try '\ + 'supplying the definition ID or folder path to differentiate.' raise ValueError(message.format(name=name, project=project)) raise ValueError('There were no build definitions matching name "{name}" in project "{project}".' .format(name=name, project=project)) def _resolve_repository_as_id(repository, organization, project): if is_uuid(repository): return repository git_client = get_git_client(organization) repositories = git_client.get_repositories(project=project, include_links=False, include_all_urls=False) for found_repository in repositories: if found_repository.name.lower() == repository.lower(): return found_repository.id return None azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/commands.py000066400000000000000000000267001360605530400310710ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType from azext_devops.dev.common.exception_handler import azure_devops_exception_handler from ._format import (transform_build_table_output, transform_builds_table_output, transform_pipeline_run_table_output, transform_pipeline_or_run_table_output, transform_pipeline_runs_table_output, transform_pipeline_table_output, transform_pipelines_table_output, transform_build_tags_output, transform_definition_table_output, transform_definitions_table_output, transform_releases_table_output, transform_release_table_output, transform_release_definitions_table_output, transform_release_definition_table_output, transform_runs_artifact_table_output, transform_pipelines_pools_table_output, transform_pipelines_pool_table_output, transform_pipelines_agents_table_output, transform_pipelines_agent_table_output, transform_pipelines_queues_table_output, transform_pipelines_queue_table_output, transform_pipelines_variable_groups_table_output, transform_pipelines_variable_group_table_output, transform_pipelines_variables_table_output, transform_pipelines_var_group_variables_table_output, transform_pipelines_folders_table_output, transform_pipelines_folder_table_output) buildOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.build#{}', exception_handler=azure_devops_exception_handler ) buildDefOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.build_definition#{}', exception_handler=azure_devops_exception_handler ) buildTaskOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.task#{}', exception_handler=azure_devops_exception_handler ) releaseOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.release#{}', exception_handler=azure_devops_exception_handler ) releaseDefinitionOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.release_definition#{}', exception_handler=azure_devops_exception_handler ) pipelinesOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.pipeline#{}', exception_handler=azure_devops_exception_handler ) pipelineCreateOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.pipeline_create#{}', exception_handler=azure_devops_exception_handler ) pipelinesRunOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.pipeline_run#{}', exception_handler=azure_devops_exception_handler ) pipelineRunArtifactsOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.runs_artifacts#{}', exception_handler=azure_devops_exception_handler ) pipelineAgentPoolQueueOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.agent_pool_queue#{}', exception_handler=azure_devops_exception_handler ) pipelineVariableGroupOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.variable_group#{}', exception_handler=azure_devops_exception_handler ) pipelineVariablesOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.pipeline_variables#{}', exception_handler=azure_devops_exception_handler ) pipelineFoldersOps = CliCommandType( operations_tmpl='azext_devops.dev.pipelines.pipeline_folders#{}', exception_handler=azure_devops_exception_handler ) # pylint: disable=too-many-statements def load_build_commands(self, _): with self.command_group('pipelines', command_type=pipelineCreateOps) as g: g.command('create', 'pipeline_create', table_transformer=transform_pipeline_or_run_table_output, is_preview=True) g.command('update', 'pipeline_update', table_transformer=transform_pipeline_table_output, is_preview=True) with self.command_group('pipelines', command_type=pipelinesOps) as g: g.command('list', 'pipeline_list', table_transformer=transform_pipelines_table_output, is_preview=True) g.command('show', 'pipeline_show', table_transformer=transform_pipeline_table_output, is_preview=True) g.command('delete', 'pipeline_delete', confirmation='Are you sure you want to delete this pipeline?', is_preview=True) g.command('run', 'pipeline_run', table_transformer=transform_pipeline_run_table_output, is_preview=True) with self.command_group('pipelines build', command_type=buildOps) as g: # basic build commands g.command('list', 'build_list', table_transformer=transform_builds_table_output) g.command('queue', 'build_queue', table_transformer=transform_build_table_output) g.command('show', 'build_show', table_transformer=transform_build_table_output) with self.command_group('pipelines build tag', command_type=buildOps) as g: # basic build tag commands g.command('list', 'get_build_tags', table_transformer=transform_build_tags_output) g.command('add', 'add_build_tags', table_transformer=transform_build_tags_output) g.command('delete', 'delete_build_tag', table_transformer=transform_build_tags_output) with self.command_group('pipelines build definition', command_type=buildDefOps) as g: # basic build definition commands g.command('list', 'build_definition_list', table_transformer=transform_definitions_table_output) g.command('show', 'build_definition_show', table_transformer=transform_definition_table_output) with self.command_group('pipelines release', command_type=releaseOps) as g: # basic release commands g.command('list', 'release_list', table_transformer=transform_releases_table_output) g.command('create', 'release_create', table_transformer=transform_release_table_output) g.command('show', 'release_show', table_transformer=transform_release_table_output) with self.command_group('pipelines release definition', command_type=releaseDefinitionOps) as g: # basic release commands g.command('list', 'release_definition_list', table_transformer=transform_release_definitions_table_output) g.command('show', 'release_definition_show', table_transformer=transform_release_definition_table_output) with self.command_group('pipelines runs artifact', command_type=pipelineRunArtifactsOps, is_preview=True) as g: g.command('download', 'run_artifact_download') g.command('list', 'run_artifact_list', table_transformer=transform_runs_artifact_table_output) g.command('upload', 'run_artifact_upload') with self.command_group('pipelines runs tag', command_type=pipelinesRunOps, is_preview=True) as g: g.command('add', 'pipeline_run_add_tag', table_transformer=transform_build_tags_output) g.command('list', 'pipeline_run_get_tags', table_transformer=transform_build_tags_output) g.command('delete', 'pipeline_run_delete_tag', table_transformer=transform_build_tags_output) with self.command_group('pipelines runs', command_type=pipelinesRunOps, is_preview=True) as g: g.command('list', 'pipeline_run_list', table_transformer=transform_pipeline_runs_table_output) g.command('show', 'pipeline_run_show', table_transformer=transform_pipeline_run_table_output) with self.command_group('pipelines pool', command_type=pipelineAgentPoolQueueOps, is_preview=True) as g: g.command('list', 'list_pools', table_transformer=transform_pipelines_pools_table_output) g.command('show', 'show_pool', table_transformer=transform_pipelines_pool_table_output) with self.command_group('pipelines agent', command_type=pipelineAgentPoolQueueOps, is_preview=True) as g: g.command('list', 'list_agents', table_transformer=transform_pipelines_agents_table_output) g.command('show', 'show_agent', table_transformer=transform_pipelines_agent_table_output) with self.command_group('pipelines queue', command_type=pipelineAgentPoolQueueOps, is_preview=True) as g: g.command('list', 'list_queues', table_transformer=transform_pipelines_queues_table_output) g.command('show', 'show_queue', table_transformer=transform_pipelines_queue_table_output) with self.command_group('pipelines variable-group', command_type=pipelineVariableGroupOps, is_preview=True) as g: g.command('create', 'variable_group_create', table_transformer=transform_pipelines_variable_group_table_output) g.command('show', 'variable_group_show', table_transformer=transform_pipelines_variable_group_table_output) g.command('list', 'variable_group_list', table_transformer=transform_pipelines_variable_groups_table_output) g.command('update', 'variable_group_update', table_transformer=transform_pipelines_variable_group_table_output) g.command('delete', 'variable_group_delete', confirmation='Are you sure you want to delete this variable group?') with self.command_group('pipelines variable-group variable', command_type=pipelineVariableGroupOps) as g: g.command('create', 'variable_group_variable_add', table_transformer=transform_pipelines_var_group_variables_table_output) g.command('list', 'variable_group_variable_list', table_transformer=transform_pipelines_var_group_variables_table_output) g.command('update', 'variable_group_variable_update', table_transformer=transform_pipelines_var_group_variables_table_output) g.command('delete', 'variable_group_variable_delete', confirmation='Are you sure you want to delete this variable?') with self.command_group('pipelines variable', command_type=pipelineVariablesOps, is_preview=True) as g: g.command('create', 'pipeline_variable_add', table_transformer=transform_pipelines_variables_table_output) g.command('update', 'pipeline_variable_update', table_transformer=transform_pipelines_variables_table_output) g.command('list', 'pipeline_variable_list', table_transformer=transform_pipelines_variables_table_output) g.command('delete', 'pipeline_variable_delete', confirmation='Are you sure you want to delete this variable?') with self.command_group('pipelines folder', command_type=pipelineFoldersOps, is_preview=True) as g: g.command('create', 'pipeline_folder_create', table_transformer=transform_pipelines_folder_table_output) g.command('delete', 'pipeline_folder_delete', table_transformer=transform_pipelines_folder_table_output, confirmation='This will delete all pipelines in this folder. ' 'Are you sure you want to delete this folder?') g.command('list', 'pipeline_folder_list', table_transformer=transform_pipelines_folders_table_output) g.command('update', 'pipeline_folder_update', table_transformer=transform_pipelines_folder_table_output) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline.py000066400000000000000000000207001360605530400310670ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from webbrowser import open_new from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.services import (get_build_client, get_git_client, resolve_instance_and_project) from azext_devops.dev.common.uri import uri_quote from azext_devops.dev.common.uuid import is_uuid from azext_devops.dev.common.git import resolve_git_ref_heads from azext_devops.devops_sdk.v5_0.build.models import Build, DefinitionReference from .build_definition import get_definition_id_from_name, fix_path_for_api from .pipeline_run import _open_pipeline_run logger = get_logger(__name__) def pipeline_list(name=None, top=None, organization=None, project=None, repository=None, query_order=None, folder_path=None, repository_type=None, detect=None): """ List pipelines. :param name: Limit results to pipelines with this name or starting with this name. Examples: "FabCI" or "Fab*" :type name: str :param top: Maximum number of pipelines to list. :type top: int :param query_order: Order of the results. :type query_order: str :param repository: Limit results to pipelines associated with this repository. :type repository: str :param detect: Automatically detect values for organization and project. Default is "on". :type detect: str :param folder_path: If specified, filters to definitions under this folder. :type folder_path: str :param repository_type: Limit results to pipelines associated with this repository type. It is mandatory to pass 'repository' argument along with this argument. :type repository_type: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) query_order = _resolve_query_order(query_order) if repository is not None: if repository_type is None: repository_type = 'TfsGit' if repository_type.lower() == 'tfsgit': repository = _resolve_repository_as_id(repository, organization, project) if repository is None: raise ValueError("Could not find a repository with name '{}', in project '{}'." .format(repository, project)) folder_path = fix_path_for_api(folder_path) definition_references = client.get_definitions(project=project, name=name, repository_id=repository, repository_type=repository_type, top=top, path=folder_path, query_order=query_order) return definition_references def _resolve_query_order(query_order): if query_order: query_order_vals = ['definitionNameAscending', 'definitionNameDescending', 'lastModifiedAscending', 'lastModifiedDescending', 'none'] for val in query_order_vals: if query_order.lower() in val.lower(): return val logger.warning("Cannot resolve --query-order, continuing with 'none'") return 'none' def pipeline_show(id=None, name=None, open=False, organization=None, project=None, # pylint: disable=redefined-builtin folder_path=None, detect=None): """ Get the details of a pipeline. :param id: ID of the pipeline. :type id: int :param name: Name of the pipeline. Ignored if --id is supplied. :type name: str :param folder_path: Folder path of pipeline. Default is root level folder. :type folder_path: str :param open: Open the pipeline summary page in your web browser. :type open: bool :param detect: Automatically detect values for instance and project. Default is "on". :type detect: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) if id is None: if name is not None: id = get_definition_id_from_name(name, client, project, path=folder_path) else: raise CLIError("Either the --id argument or the --name argument must be supplied for this command.") build_definition = client.get_definition(definition_id=id, project=project) if open: _open_pipeline(build_definition, organization) return build_definition def pipeline_run(id=None, branch=None, commit_id=None, name=None, open=False, variables=None, # pylint: disable=redefined-builtin folder_path=None, organization=None, project=None, detect=None): """ Queue (run) a pipeline. :param id: ID of the pipeline to queue. Required if --name is not supplied. :type id: int :param name: Name of the pipeline to queue. Ignored if --id is supplied. :type name: str :param branch: Name of the branch on which the pipeline run is to be queued. Example: refs/heads/master or master or refs/pull/1/merge :type branch: str :param folder_path: Folder path of pipeline. Default is root level folder. :type folder_path: str :param variables: Space separated "name=value" pairs for the variables you would like to set. :type variables: [str] :param commit_id: Commit-id on which the pipeline run is to be queued. :type commit_id: str :param open: Open the pipeline results page in your web browser. :type open: bool :param detect: Automatically detect organization and project. Default is "on". :type detect: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) if id is None and name is None: raise ValueError('Either the --id argument or the --name argument ' + 'must be supplied for this command.') client = get_build_client(organization) if id is None: id = get_definition_id_from_name(name, client, project, folder_path) definition_reference = DefinitionReference(id=id) branch = resolve_git_ref_heads(branch) build = Build(definition=definition_reference, source_branch=branch, source_version=commit_id) if variables is not None and variables: build.parameters = {} for variable in variables: separator_pos = variable.find('=') if separator_pos >= 0: build.parameters[variable[:separator_pos]] = variable[separator_pos + 1:] else: raise ValueError('The --variables argument should consist of space separated "name=value" pairs.') queued_build = client.queue_build(build=build, project=project) if open: _open_pipeline_run(queued_build, organization) return queued_build def pipeline_delete(id, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """ Delete a pipeline. :param id: ID of the pipeline. :type id: int :param detect: Automatically detect instance and project. Default is "on". :type detect: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) build = client.delete_definition(definition_id=id, project=project) print('Pipeline {id} was deleted successfully.'.format(id=id)) return build def _open_pipeline(definition, organization): """Opens the build definition in the default browser. """ # https://dev.azure.com/OrgName/ProjectName/_build/index?definitionId=1234 project = definition.project.name url = organization.rstrip('/') + '/' + uri_quote(project) + '/_build?definitionId='\ + uri_quote(str(definition.id)) logger.debug('Opening web page: %s', url) open_new(url=url) def _resolve_repository_as_id(repository, organization, project): if is_uuid(repository): return repository git_client = get_git_client(organization) repositories = git_client.get_repositories(project=project, include_links=False, include_all_urls=False) for found_repository in repositories: if found_repository.name.lower() == repository.lower(): return found_repository.id return None azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_create.py000066400000000000000000000621501360605530400324170ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import tempfile import os from knack.log import get_logger from knack.util import CLIError from knack.prompting import prompt from azext_devops.dev.common.services import (get_new_pipeline_client, get_new_cix_client, get_git_client, resolve_instance_and_project, resolve_instance_project_and_repo) from azext_devops.dev.common.uri import uri_parse from azext_devops.dev.common.utils import open_file, delete_dir from azext_devops.dev.common.git import get_remote_url, get_current_branch_name from azext_devops.dev.common.arguments import should_detect from azext_devops.dev.common.prompting import (prompt_user_friendly_choice_list, verify_is_a_tty_or_raise_error, prompt_not_empty) from azext_devops.dev.pipelines.pipeline_create_helpers.github_api_helper import ( push_files_github, get_github_repos_api_url, Files) from azext_devops.dev.pipelines.pipeline_create_helpers.pipelines_resource_provider import ( get_azure_rm_service_connection, get_azure_rm_service_connection_id, get_github_service_endpoint, get_kubernetes_environment_resource, get_container_registry_service_connection, get_webapp_from_list_selection) from azext_devops.dev.pipelines.pipeline_create_helpers.azure_repos_helper import push_files_to_azure_repo from azext_devops.devops_sdk.v5_1.build.models import Build, BuildDefinition, BuildRepository, AgentPoolQueue from .build_definition import get_definition_id_from_name, fix_path_for_api logger = get_logger(__name__) # pylint: disable=too-few-public-methods class YmlOptions: def __init__(self, name, id, content, description='Custom yaml', params=None, path=None, assets=None): # pylint: disable=redefined-builtin self.name = name self.id = id self.description = description self.content = content self.path = path self.params = params self.assets = assets _GITHUB_REPO_TYPE = 'github' _AZURE_GIT_REPO_TYPE = 'tfsgit' # pylint: disable=too-many-statements def pipeline_create(name, description=None, repository=None, branch=None, yml_path=None, repository_type=None, service_connection=None, organization=None, project=None, detect=None, queue_id=None, skip_first_run=None, folder_path=None): """Create a new Azure Pipeline (YAML based) :param name: Name of the new pipeline :type name: str :param description: Description for the new pipeline :type description: str :param repository: Repository for which the pipeline needs to be configured. Can be clone url of the git repository or name of the repository for a Azure Repos or Owner/RepoName in case of GitHub repository. If omitted it will be auto-detected from the remote url of local git repository. If name is mentioned instead of url, --repository-type argument is also required. :type repository: str :param branch: Branch name for which the pipeline will be configured. If omitted, it will be auto-detected from local repository :type branch: str :param yml_path: Path of the pipelines yaml file in the repo (if yaml is already present in the repo). :type yml_path: str :param repository_type: Type of repository. If omitted, it will be auto-detected from remote url of local repository. 'tfsgit' for Azure Repos, 'github' for GitHub repository. :type repository_type: str :param service_connection: Id of the Service connection created for the repository for GitHub repository. Use command az devops service-endpoint -h for creating/listing service_connections. Not required for Azure Repos. :type service_connection: str :param queue_id: Id of the queue in the available agent pools. Will be auto detected if not specified. :type queue_id: str :param skip_first_run: Specify this flag to prevent the first run being triggered by the command. Command will return a pipeline if run is skipped else it will output a pipeline run. :type skip_first_run: bool :param folder_path: Path of the folder where the pipeline needs to be created. Default is root folder. e.g. "user1/test_pipelines" :type folder_path: str """ repository_name = None if repository: organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) else: organization, project, repository_name = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project) # resolve repository if local repo for azure repo if repository_name: repository = repository_name repository_type = _AZURE_GIT_REPO_TYPE # resolve repository from local repo for github repo if not repository: repository = _get_repository_url_from_local_repo(detect=detect) if not repository: raise CLIError('The following arguments are required: --repository.') if not repository_type: repository_type = try_get_repository_type(repository) if not repository_type: raise CLIError('The following arguments are required: --repository-type. ' 'Check command help for valid values.') if not branch and should_detect(detect): branch = get_current_branch_name() if not branch: raise CLIError('The following arguments are required: --branch.') # repository, repository-type, branch should be set by now if not repository_name and is_valid_url(repository): repository_name = _get_repo_name_from_repo_url(repository) else: repository_name = repository # Validate name availability so user does not face name conflicts after going through the whole process if not validate_name_is_available(name, folder_path, organization, project): raise CLIError('Pipeline with name {name} already exists.'.format(name=name)) # Parse repository information according to repository type repo_id = None api_url = None repository_url = None if repository_type.lower() == _GITHUB_REPO_TYPE: repo_id = repository_name repository_url = 'https://github.com/' + repository_name api_url = get_github_repos_api_url(repository_name) if repository_type.lower() == _AZURE_GIT_REPO_TYPE: repo_id = _get_repository_id_from_name(organization, project, repository_name) if not service_connection and repository_type != _AZURE_GIT_REPO_TYPE: service_connection = get_github_service_endpoint(organization, project) new_cix_client = get_new_cix_client(organization=organization) # No yml path => find or recommend yml scenario queue_branch = branch if not yml_path: yml_path, queue_branch = _create_and_get_yml_path(new_cix_client, repository_type, repo_id, repository_name, branch, service_connection, project, organization) if not queue_id: queue_id = _get_agent_queue_by_heuristic(organization=organization, project=project) if queue_id is None: logger.warning('Cannot find a hosted pool queue in the project. Provide a --queue-id in command params.') # Create build definition definition = _create_pipeline_build_object(name, description, repo_id, repository_name, repository_url, api_url, branch, service_connection, repository_type, yml_path, queue_id, folder_path) client = get_new_pipeline_client(organization) created_definition = client.create_definition(definition=definition, project=project) logger.warning('Successfully created a pipeline with Name: %s, Id: %s.', created_definition.name, created_definition.id) if skip_first_run: return created_definition return client.queue_build(build=Build(definition=created_definition, source_branch=queue_branch), project=project) def pipeline_update(name=None, id=None, description=None, new_name=None, # pylint: disable=redefined-builtin branch=None, yml_path=None, queue_id=None, organization=None, project=None, detect=None, new_folder_path=None): """ Update a pipeline :param name: Name of the pipeline to update. :type name: str :param id: Id of the pipeline to update. :type id: str :param new_name: New updated name of the pipeline. :type new_name: str :param description: New description for the pipeline. :type description: str :param branch: Branch name for which the pipeline will be configured. :type branch: str :param yml_path: Path of the pipelines yaml file in the repo. :type yml_path: str :param queue_id: Queue id of the agent pool where the pipeline needs to run. :type queue_id: int :param new_folder_path: New full path of the folder to move the pipeline to. e.g. "user1/production_pipelines" :type new_folder_path: str """ # pylint: disable=too-many-branches organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) pipeline_client = get_new_pipeline_client(organization=organization) if id is None: if name is not None: id = get_definition_id_from_name(name, pipeline_client, project) else: raise CLIError("Either --id or --name argument must be supplied for this command.") definition = pipeline_client.get_definition(definition_id=id, project=project) if new_name: definition.name = new_name if description: definition.description = description if branch: definition.repository.default_branch = branch if queue_id: definition.queue = AgentPoolQueue() definition.queue.id = queue_id if yml_path: definition.process = _create_process_object(yml_path) if new_folder_path: definition.path = new_folder_path return pipeline_client.update_definition(project=project, definition_id=id, definition=definition) def validate_name_is_available(name, path, organization, project): client = get_new_pipeline_client(organization=organization) path = fix_path_for_api(path) definition_references = client.get_definitions(project=project, name=name, path=path) if len(definition_references.value) == 0: return True return False def _get_repository_url_from_local_repo(detect): if should_detect(detect): return get_remote_url(is_github_url_candidate) return None def is_github_url_candidate(url): if url is None: return False components = uri_parse(url.lower()) if components.netloc == 'github.com': return True return False def is_valid_url(url): if ('github.com' in url or 'visualstudio.com' in url or 'dev.azure.com' in url): return True return False def _get_repo_name_from_repo_url(repository_url): """ Should be called with a valid github or azure repo url returns owner/reponame for github repos, repo_name for azure repo type """ repo_type = try_get_repository_type(repository_url) if repo_type == _GITHUB_REPO_TYPE: parsed_url = uri_parse(repository_url) logger.debug('Parsing GitHub url: %s', parsed_url) if parsed_url.scheme == 'https' and parsed_url.netloc == 'github.com': logger.debug('Parsing path in the url to find repo id.') stripped_path = parsed_url.path.strip('/') if stripped_path.endswith('.git'): stripped_path = stripped_path[:-4] return stripped_path if repo_type == _AZURE_GIT_REPO_TYPE: parsed_list = repository_url.split('/') index = 0 for item in parsed_list: if ('visualstudio.com' in item or 'dev.azure.com' in item) and len(parsed_list) > index + 4: return parsed_list[index + 4] index = index + 1 raise CLIError('Could not parse repository url.') def _create_repo_properties_object(service_endpoint, branch, api_url): return { "connectedServiceId": service_endpoint, "defaultBranch": branch, "apiUrl": api_url } def _create_process_object(yaml_path): return { "yamlFilename": yaml_path, "type": 2 } def try_get_repository_type(url): if 'https://github.com' in url: return _GITHUB_REPO_TYPE if 'dev.azure.com' in url or '.visualstudio.com' in url: return _AZURE_GIT_REPO_TYPE return None def _create_and_get_yml_path(cix_client, repository_type, repo_id, repo_name, branch, # pylint: disable=too-many-locals, too-many-statements service_endpoint, project, organization): logger.debug('No yaml file was given. Trying to find the yaml file in the repo.') queue_branch = branch default_yml_exists = False yml_names = [] yml_options = [] configurations = cix_client.get_configurations( project=project, repository_type=repository_type, repository_id=repo_id, branch=branch, service_connection_id=service_endpoint) for configuration in configurations: if configuration.path.strip('/') == 'azure-pipelines.yml': default_yml_exists = True logger.debug('The repo has a yaml pipeline definition. Path: %s', configuration.path) custom_name = 'Existing yaml (path={})'.format(configuration.path) yml_names.append(custom_name) yml_options.append(YmlOptions(name=custom_name, content=configuration.content, id='customid', path=configuration.path)) recommendations = cix_client.get_template_recommendations( project=project, repository_type=repository_type, repository_id=repo_id, branch=branch, service_connection_id=service_endpoint) logger.debug('List of recommended templates..') # sort recommendations from operator import attrgetter recommendations = sorted(recommendations, key=attrgetter('recommended_weight'), reverse=True) for recommendation in recommendations: yml_names.append(recommendation.name) yml_options.append(YmlOptions(name=recommendation.name, content=recommendation.content, id=recommendation.id, description=recommendation.description, params=recommendation.parameters, assets=recommendation.assets)) temp_filename = None files = [] yml_selection_index = 0 proceed_selection = 1 while proceed_selection == 1: proceed_selection = 0 # Clear files since user can change the template now del files[:] yml_selection_index = prompt_user_friendly_choice_list("Which template do you want to use for this pipeline?", yml_names) if yml_options[yml_selection_index].params: yml_options[yml_selection_index].content, yml_options[yml_selection_index].assets = _handle_yml_props( params_required=yml_options[yml_selection_index].params, template_id=yml_options[yml_selection_index].id, cix_client=cix_client, repo_name=repo_name, organization=organization, project=project) temp_dir = tempfile.mkdtemp(prefix='AzurePipelines_') temp_filename = os.path.join(temp_dir, 'azure-pipelines.yml') f = open(temp_filename, mode='w') f.write(yml_options[yml_selection_index].content) f.close() assets = yml_options[yml_selection_index].assets if assets: for asset in assets: files.append(Files(asset.destination_path, asset.content)) view_choice = prompt_user_friendly_choice_list( 'Do you want to view/edit the template yaml before proceeding?', ['Continue with generated yaml', 'View or edit the yaml']) if view_choice == 1: open_file(temp_filename) proceed_selection = prompt_user_friendly_choice_list( 'Do you want to proceed creating a pipeline?', ['Proceed with this yaml', 'Choose another template']) # Read updated data from the file f = open(temp_filename, mode='r') content = f.read() f.close() delete_dir(temp_dir) checkin_path = 'azure-pipelines.yml' if default_yml_exists and not yml_options[yml_selection_index].path: # We need yml path from user logger.warning('A yaml file azure-pipelines.yml already exists in the repository root.') checkin_path = prompt_not_empty( msg='Enter a yaml file path to checkin the new pipeline yaml in the repository? ', help_string='e.g. /new_azure-pipeline.yml to add in the root folder.') print('') files.append(Files(checkin_path, content)) print('Files to be added to your repository ({numfiles})'.format(numfiles=len(files))) count_file = 1 for file in files: print('{index}) {file}'.format(index=count_file, file=file.path)) count_file = count_file + 1 print('') if default_yml_exists and checkin_path.strip('/') == 'azure-pipelines.yml': print('Edits on the existing yaml can be done in the code repository.') else: queue_branch = push_files_to_repository(organization, project, repo_name, branch, files, repository_type) return checkin_path, queue_branch def push_files_to_repository(organization, project, repo_name, branch, files, repository_type): commit_strategy_choice_list = ['Commit directly to the {branch} branch.'.format(branch=branch), 'Create a new branch for this commit and start a pull request.'] commit_choice = prompt_user_friendly_choice_list("How do you want to commit the files to the repository?", commit_strategy_choice_list) commit_direct_to_branch = commit_choice == 0 if repository_type == _GITHUB_REPO_TYPE: return push_files_github(files, repo_name, branch, commit_direct_to_branch) if repository_type == _AZURE_GIT_REPO_TYPE: return push_files_to_azure_repo(files, repo_name, branch, commit_direct_to_branch, organization, project) raise CLIError('File push failed: Repository type not supported.') def _get_pipelines_trigger(repo_type): if repo_type.lower() == _GITHUB_REPO_TYPE: return [{"settingsSourceType": 2, "triggerType": 2}, {"forks": {"enabled": "true", "allowSecrets": "false"}, "settingsSourceType": 2, "triggerType": "pullRequest"}] return [{"settingsSourceType": 2, "triggerType": 2}] def _handle_yml_props(params_required, template_id, cix_client, repo_name, organization, project): logger.warning('The template requires a few inputs. We will help you fill them out') params_to_render = {} for param in params_required: param_name_for_user = param.name # override with more user friendly name if available if param.display_name: param_name_for_user = param.display_name logger.debug('Looking for param %s in props', param.name) prop_found = False if param.default_value: prop_found = True user_input_val = prompt(msg='Enter a value for {param_name} [Press Enter for default: {param_default}]:' .format(param_name=param_name_for_user, param_default=param.default_value)) print('') if user_input_val: params_to_render[param.name] = user_input_val else: params_to_render[param.name] = param.default_value elif _is_intelligent_handling_enabled_for_prop_type(prop_name=param.name, prop_type=param.type): logger.debug('This property is handled intelligently (Name: %s) (Type: %s)', param.name, param.type) fetched_value = fetch_yaml_prop_intelligently(param.name, param.type, organization, project, repo_name) if fetched_value is not None: logger.debug('Auto filling param %s with value %s', param.name, fetched_value) params_to_render[param.name] = fetched_value prop_found = True if not prop_found: input_value = _prompt_for_prop_input(param_name_for_user, param.type) params_to_render[param.name] = input_value prop_found = True rendered_template = cix_client.render_template(template_id=template_id, template_parameters={'tokens': params_to_render}) return rendered_template.content, rendered_template.assets def fetch_yaml_prop_intelligently(prop_name, prop_type, organization, project, repo_name): if prop_type.lower() == 'endpoint:azurerm': return get_azure_rm_service_connection(organization, project) if prop_type.lower() == 'connectedservice:azurerm': return get_azure_rm_service_connection_id(organization, project) if prop_type.lower() == 'environmentresource:kubernetes': return get_kubernetes_environment_resource(organization, project, repo_name) if prop_type.lower() == 'endpoint:containerregistry': return get_container_registry_service_connection(organization, project) if prop_name.lower() == 'webappname': return get_webapp_from_list_selection() return None def _is_intelligent_handling_enabled_for_prop_type(prop_name, prop_type): SMART_HANDLING_FOR_PROP_TYPES = ['connectedservice:azurerm', 'endpoint:azurerm', 'environmentresource:kubernetes', 'endpoint:containerregistry'] SMART_HANDLING_FOR_PROP_NAMES = ['webappname'] if prop_type.lower() in SMART_HANDLING_FOR_PROP_TYPES: return True if prop_name.lower() in SMART_HANDLING_FOR_PROP_NAMES: return True return False def _prompt_for_prop_input(prop_name, prop_type): verify_is_a_tty_or_raise_error('The template requires a few inputs. These cannot be provided as in command ' 'arguments. It can only be input interatively.') val = prompt(msg='Please enter a value for {prop_name}: '.format(prop_name=prop_name), help_string='Value of type {prop_type} is required.'.format(prop_type=prop_type)) print('') return val def _create_pipeline_build_object(name, description, repo_id, repo_name, repository_url, api_url, branch, service_endpoint, repository_type, yml_path, queue_id, path): definition = BuildDefinition() definition.name = name if description: definition.description = description # Set build repo definition.repository = BuildRepository() if repo_id: definition.repository.id = repo_id if repo_name: definition.repository.name = repo_name if repository_url: definition.repository.url = repository_url if branch: definition.repository.default_branch = branch if service_endpoint: definition.repository.properties = _create_repo_properties_object(service_endpoint, branch, api_url) if path: definition.path = path # Hack to avoid the case sensitive GitHub type for service hooks. if repository_type.lower() == _GITHUB_REPO_TYPE: definition.repository.type = 'GitHub' else: definition.repository.type = repository_type # Set build process definition.process = _create_process_object(yml_path) # set agent queue definition.queue = AgentPoolQueue() definition.triggers = _get_pipelines_trigger(repository_type) if queue_id: definition.queue.id = queue_id return definition def _get_repository_id_from_name(organization, project, repository): git_client = get_git_client(organization) repository = git_client.get_repository(project=project, repository_id=repository) return repository.id def _get_agent_queue_by_heuristic(organization, project): """ Tries to detect a queue in the agent pool in a project Returns id of Hosted Ubuntu 16.04, first hosted pool queue, first queue in that order None if no queues are returned """ from azext_devops.dev.common.services import get_new_task_agent_client choosen_queue = None agent_client = get_new_task_agent_client(organization=organization) queues = agent_client.get_agent_queues(project=project) if queues: choosen_queue = queues[0] found_first_hosted_pool_queue = False for queue in queues: if queue.name == 'Hosted Ubuntu 1604': choosen_queue = queue break if not found_first_hosted_pool_queue and queue.pool.is_hosted: choosen_queue = queue found_first_hosted_pool_queue = True logger.debug('Auto detecting agent pool. Queue: %s, Pool: %s', choosen_queue.name, choosen_queue.pool.name) return choosen_queue.id return None azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_create_helpers/000077500000000000000000000000001360605530400335635ustar00rootroot00000000000000__init__.py000066400000000000000000000006321360605530400356160ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_create_helpers# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import pkg_resources pkg_resources.declare_namespace(__name__) azure_repos_helper.py000066400000000000000000000117061360605530400377600ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_create_helpers# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.prompting import prompt_not_empty from azext_devops.dev.common.git import resolve_git_ref_heads from azext_devops.dev.common.services import get_git_client logger = get_logger(__name__) def push_files_to_azure_repo(files, repo_name, branch, commit_to_branch, organization, project, message="Set up CI with Azure Pipelines"): if commit_to_branch: _checkin_files_to_azure_repo(files, repo_name, branch, organization, project, message) return branch # pull request flow new_branch = get_new_azure_repo_branch(organization, project, repo_name, branch) _checkin_files_to_azure_repo(files, repo_name, new_branch, organization, project, message) pr = create_pull_request_azure_repo( organization=organization, project=project, repository=repo_name, source=new_branch, target=branch, message=message) print('Created a Pull Request - {url}'.format(url=pr.url)) return new_branch def get_new_azure_repo_branch(organization, project, repository, source): from azext_devops.dev.repos.ref import list_refs, create_ref # get source ref object id object_id = None branch = resolve_git_ref_heads(source) filter_str = branch[5:] # remove 'refs' to use as filter refs_list = list_refs(filter=filter_str, repository=repository, organization=organization, project=project) for ref in refs_list: if ref.name == branch: object_id = ref.object_id break if not object_id: raise CLIError('Cannot fetch source branch details for branch {br}'.format(br=branch)) # get valid branch name branch_is_valid = False while not branch_is_valid: new_branch = prompt_not_empty(msg='Enter new branch name to create: ') try: create_ref('heads/' + new_branch, object_id, repository, organization, project) branch_is_valid = True except Exception: # pylint: disable=broad-except logger.warning('Not a valid branch name.') return new_branch def create_pull_request_azure_repo(organization, project, repository, source, target, message): from azext_devops.dev.repos.pull_request import create_pull_request pr = create_pull_request(project=project, repository=repository, source_branch=source, target_branch=target, title=message, description=['Creating Azure Pipeline for the repository.'], organization=organization) return pr def _checkin_files_to_azure_repo(files, repo_name, branch, organization, project, message): if files: for file in files: _checkin_file_to_azure_repo(file.path, file.content, repo_name, branch, organization, project, message) else: raise CLIError("No files to checkin.") def _checkin_file_to_azure_repo(path_to_commit, content, repo_name, branch, organization, project, message): logger.warning('Checking in file %s in the Azure repo %s', path_to_commit, repo_name) message = message + ' [skip ci]' git_client = get_git_client(organization=organization) from azext_devops.devops_sdk.v5_0.git.models import GitPush, GitRefUpdate # Get base commit Id all_heads_refs = git_client.get_refs(repository_id=repo_name, project=project, filter='heads/') old_object_id = None for ref in all_heads_refs: if ref.name == resolve_git_ref_heads(branch): old_object_id = ref.object_id if not old_object_id: raise CLIError('Cannot checkin the file. Error in getting the commits info for {branch}'.format(branch=branch)) push_object = GitPush() ref_update = GitRefUpdate() ref_update.name = resolve_git_ref_heads(branch) ref_update.old_object_id = old_object_id push_object.ref_updates = [ref_update] push_object.commits = _get_commits_object(path_to_commit, content, message) git_client.create_push(push=push_object, repository_id=repo_name, project=project) def _get_commits_object(path_to_commit, content, message): return [ { "comment": message, "changes": [ { "changeType": "add", "item": { "path": path_to_commit }, "newContent": { "content": content, "contentType": "rawtext" } } ] } ] github_api_helper.py000066400000000000000000000161371360605530400375400ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_create_helpers# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import requests from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.prompting import prompt_not_empty from azext_devops.dev.common.git import resolve_git_ref_heads, get_branch_name_from_ref logger = get_logger(__name__) _HTTP_NOT_FOUND_STATUS = 404 _HTTP_SUCCESS_STATUS = 200 _HTTP_CREATED_STATUS = 201 class Files: # pylint: disable=too-few-public-methods def __init__(self, path, content): self.path = path self.content = content def get_github_pat_token(): from azext_devops.dev.common.github_credential_manager import GithubCredentialManager github_manager = GithubCredentialManager() return github_manager.get_token() def get_github_repos_api_url(repo_id): return 'https://api.github.com/repos/' + repo_id def push_files_github(files, repo_name, branch, commit_to_branch, message="Set up CI with Azure Pipelines"): if commit_to_branch: commit_files_to_github_branch(files, repo_name, branch, message) return branch # Pull request flow # Create Branch new_branch = create_github_branch(repo=repo_name, source=branch) # Commit files to branch commit_files_to_github_branch(files, repo_name, new_branch, message) # Create PR from new branch pr = create_pr_github(branch, new_branch, repo_name, message) print('Created a Pull Request - {url}'.format(url=pr['url'])) return new_branch def create_pr_github(branch, new_branch, repo_name, message): """ API Documentation - https://developer.github.com/v3/pulls/#create-a-pull-request """ token = get_github_pat_token() create_pr_url = 'https://api.github.com/repos/{repo_id}/pulls'.format(repo_id=repo_name) create_pr_request_body = { "title": message, "head": new_branch, "base": branch } create_response = requests.post(url=create_pr_url, auth=('', token), json=create_pr_request_body, headers=get_application_json_header()) if not create_response.status_code == _HTTP_CREATED_STATUS: raise CLIError('Pull request creation failed. Error: ({err})'.format(err=create_response.reason)) import json return json.loads(create_response.text) def create_github_branch(repo, source): """ API Documentation - https://developer.github.com/v3/git/refs/#create-a-reference """ token = get_github_pat_token() # Validate new branch name is valid branch_is_valid = False while not branch_is_valid: new_branch = prompt_not_empty(msg='Enter new branch name to create: ') ref, is_folder = get_github_branch(repo, new_branch) if not ref and not is_folder: branch_is_valid = True else: logger.warning('Not a valid branch name.') # Get source branch ref ref_item, is_folder = get_github_branch(repo, source) if not ref_item or is_folder: raise CLIError('Branch ({branch}) does not exist.'.format(branch=source)) source_ref = ref_item['object']['sha'] create_github_ref_url = 'https://api.github.com/repos/{repo_id}/git/refs'.format(repo_id=repo) create_github_ref_request_body = { "ref": resolve_git_ref_heads(new_branch), "sha": source_ref } create_response = requests.post(url=create_github_ref_url, auth=('', token), json=create_github_ref_request_body, headers=get_application_json_header()) if not create_response.status_code == _HTTP_CREATED_STATUS: raise CLIError('Branch creation failed. Error: ({err})'.format(err=create_response.reason)) return get_branch_name_from_ref(new_branch) def get_github_branch(repo, branch): """ API Documentation - https://developer.github.com/v3/repos/branches/#get-branch Returns branch, is_folder branch : None if the branch with this name does not exist else branch ref is_folder : True or False """ token = get_github_pat_token() head_ref_name = resolve_git_ref_heads(branch).lower() get_branch_url = 'https://api.github.com/repos/{repo_id}/git/{refs_heads_branch}'.format( repo_id=repo, refs_heads_branch=head_ref_name) get_response = requests.get(get_branch_url, auth=('', token)) if get_response.status_code == _HTTP_NOT_FOUND_STATUS: return None, False if get_response.status_code == _HTTP_SUCCESS_STATUS: import json refs = json.loads(get_response.text) if isinstance(refs, list): if refs[0]['ref'].startswith(head_ref_name + '/'): logger.debug('Branch name is a folder hence invalid branch name.') return None, True # Parse and find correct branch for ref in refs: if ref['ref'] == head_ref_name: return ref, False return None, False if refs['ref'] == head_ref_name: return refs, False raise CLIError('Cannot get branch ({branch})'.format(branch=branch)) def commit_files_to_github_branch(files, repo_name, branch, message): if files: for file in files: commit_file_to_github_branch(file.path, file.content, repo_name, branch, message) else: raise CLIError("No files to checkin.") def get_application_json_header(): return {'Content-Type': 'application/json' + '; charset=utf-8', 'Accept': 'application/json'} def commit_file_to_github_branch(path_to_commit, content, repo_name, branch, message, skip_ci=True): """ API Documentation - https://developer.github.com/v3/repos/contents/#create-a-file """ import base64 if not skip_ci: message = message + ' [skip ci]' headers = get_application_json_header() url_for_github_file_api = 'https://api.github.com/repos/{repo_name}/contents/{path_to_commit}'.format( repo_name=repo_name, path_to_commit=path_to_commit) if path_to_commit and content: path_to_commit = path_to_commit.strip('.') path_to_commit = path_to_commit.strip('/') encoded_content = base64.b64encode(content.encode('utf-8')).decode("utf-8") request_body = { "message": message, "branch": branch, "content": encoded_content } token = get_github_pat_token() logger.warning('Checking in file %s in the Github repository %s', path_to_commit, repo_name) response = requests.put(url_for_github_file_api, auth=('', token), json=request_body, headers=headers) logger.debug(response) if not response.status_code == _HTTP_CREATED_STATUS: raise CLIError('GitHub file checkin failed for file ({file}). Status Code ({code}).'.format( file=path_to_commit, code=response.status_code)) else: raise CLIError('GitHub file checkin failed. File path or content is empty.') pipelines_resource_provider.py000066400000000000000000000423771360605530400417040ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_create_helpers# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.prompting import prompt_user_friendly_choice_list, prompt_not_empty from azext_devops.dev.common.services import ( get_service_endpoint_client, get_new_cix_client, get_default_subscription_info) from azext_devops.dev.pipelines.pipeline_create_helpers.github_api_helper import get_github_pat_token from azext_devops.devops_sdk.v5_1.service_endpoint.models import ServiceEndpoint, EndpointAuthorization logger = get_logger(__name__) def get_github_service_endpoint(organization, project): """ This will try to create a GitHub service connection if there is no existing one in the project GitHub pat token will be asked for interactively or can be provided by setting the Environment variable AZ_DEVOPS_GITHUB_PAT_ENVKEY. Service endpoint connection name is asked as input from the user """ from azext_devops.dev.common.identities import get_current_identity, get_account_from_identity authenticated_user_unique_id = get_account_from_identity(get_current_identity(organization)) se_client = get_service_endpoint_client(organization) existing_service_endpoints = _get_service_endpoints(organization, project, 'github') service_endpoints_choice_list = ['Create new GitHub service connection'] github_service_endpoints = [] choice = 0 for endpoint in existing_service_endpoints: if (endpoint.authorization.scheme == 'InstallationToken' or authenticated_user_unique_id == endpoint.created_by.unique_name): service_endpoints_choice_list.append('{}'.format(endpoint.name)) github_service_endpoints.append(endpoint) if github_service_endpoints: choice = prompt_user_friendly_choice_list( "Which service connection do you want to use to communicate with GitHub?", service_endpoints_choice_list) if choice > 0: logger.debug( 'Using service endpoint index (%s) name (%s)', choice, github_service_endpoints[choice - 1].name) return github_service_endpoints[choice - 1].id logger.debug("Creating a new service endpoint.") github_pat = get_github_pat_token() se_name = prompt_not_empty('Enter a service connection name to create? ') print('') service_endpoint_authorization = EndpointAuthorization( parameters={'accessToken': github_pat}, scheme='PersonalAccessToken') service_endpoint_to_create = ServiceEndpoint( authorization=service_endpoint_authorization, name=se_name, type='github', url='https://github.com/') return se_client.create_service_endpoint(service_endpoint_to_create, project).id def _get_service_endpoints(organization, project, endpoint_type=None): """ Get the list of existing service connections filtered by type if mentioned """ client = get_service_endpoint_client(organization) all_connections = client.get_service_endpoints(project) if endpoint_type is None: return all_connections filtered_connection = [] for connection in all_connections: if connection.type.lower() == endpoint_type.lower(): filtered_connection.append(connection) return filtered_connection def get_azure_rm_service_connection_id(organization, project): azure_rm_connection = get_azure_rm_service_connection(organization, project) return azure_rm_connection['Id'] def get_azure_rm_service_connection(organization, project): logger.debug('Create a new Azure Resource Manager service connection') subscription_id, subscription_name, tenant_id, environment_name = get_default_subscription_info() logger.warning("Using your default Azure subscription %s for creating Azure RM connection.", subscription_name) cix_client = get_new_cix_client(organization=organization) azure_rm_connection_create_obj = get_azure_rm_connection_create_object( subscription_id, subscription_name, environment_name, tenant_id) azure_rm_connection = cix_client.create_resources(creation_parameters=azure_rm_connection_create_obj, project=project) azure_rm_connection_obj = azure_rm_connection.resources['azureRmConnection'] poll_connection_ready(organization, project, azure_rm_connection_obj['Id']) return azure_rm_connection_obj def get_kubernetes_environment_resource(organization, project, repo_name): logger.debug("Creating a new k8s environment resource.") import subprocess import json subscription_id, subscription_name, tenant_id, environment_name = get_default_subscription_info() logger.warning("Using your default Azure subscription %s for fetching AKS clusters.", subscription_name) aks_list = subprocess.check_output('az aks list -o json', shell=True) aks_list = json.loads(aks_list) if aks_list: cluster_choice = 0 cluster_choice_list = [] for aks_clusters in aks_list: cluster_choice_list.append(aks_clusters['name']) cluster_choice = prompt_user_friendly_choice_list( "Which kubernetes cluster do you want to target for this pipeline?", cluster_choice_list) selected_cluster = aks_list[cluster_choice] create_namespace, namespace = get_kubernetes_namespace(organization, project, selected_cluster, subscription_id, subscription_name, tenant_id, environment_name) kubernetes_connection_obj = get_kubernetes_connection_create_object( subscription_id, subscription_name, selected_cluster['id'], selected_cluster['name'], selected_cluster['fqdn'], tenant_id, namespace, create_namespace, environment_name) cix_client = get_new_cix_client(organization=organization) kubernetes_connection = cix_client.create_resources(creation_parameters=kubernetes_connection_obj, project=project) k8s_connection_obj = kubernetes_connection.resources['k8sConnection'] poll_connection_ready(organization, project, k8s_connection_obj['Id']) kubernetes_env_obj = get_kubernetes_resource_create_object( k8s_connection_obj['Name'], selected_cluster['name'], repo_name, k8s_connection_obj['Id'], namespace) kubernetes_environment_resource = cix_client.create_resources(creation_parameters=kubernetes_env_obj, project=project) return kubernetes_environment_resource.resources['k8sResource'] raise CLIError('There are no AKS clusters under your subscription. ' 'Create the clusters or switch to another subscription, verify with ' 'command \'az aks list\' and try again.') def get_kubernetes_namespace(organization, project, cluster, subscription_id, subscription_name, tenant_id, azure_env): choice_list = [] existing_namespace_list = [] choice_list.append("Create new") se_request_obj = get_se_kubernetes_namespace_request_obj(subscription_id, subscription_name, cluster['id'], cluster['name'], cluster['fqdn'], azure_env, tenant_id) se_client = get_service_endpoint_client(organization=organization) se_result = se_client.execute_service_endpoint_request(service_endpoint_request=se_request_obj, project=project, endpoint_id=cluster['name']) if se_result.result: import json for namespace in se_result.result: ns_json_obj = json.loads(namespace) existing_namespace_list.append(ns_json_obj['Value']) choice_list.append(ns_json_obj['Value']) choice = prompt_user_friendly_choice_list("Which kubernetes namespace do you want to target?", choice_list) if choice == 0: create_namespace = True namespace = prompt_not_empty("Enter a name for new namespace to create: ") print('') else: create_namespace = False namespace = existing_namespace_list[choice - 1] return create_namespace, namespace def poll_connection_ready(organization, project, connection_id): import colorama colorama.init() import humanfriendly import time with humanfriendly.Spinner(label="Checking resource readiness") as spinner: se_client = get_service_endpoint_client(organization) while True: spinner.step() time.sleep(0.5) service_endpoint = se_client.get_service_endpoint_details(project, connection_id) if service_endpoint.is_ready: break colorama.deinit() def get_se_kubernetes_namespace_request_obj(subscription_id, subscription_name, cluster_id, cluster_name, fqdn, azure_env, tenant_id): return { "dataSourceDetails": { "dataSourceName": "KubernetesNamespaces", "headers": [ ], "resourceUrl": "", "parameters": { "clusterName": cluster_name } }, "resultTransformationDetails": { "resultTemplate": "{ \"Value\" : \"{{metadata.name}}\", \"DisplayValue\" : \"{{metadata.name}}\" }" }, "serviceEndpointDetails": { "authorization": { "parameters": { "azureEnvironment": azure_env, "azureTenantId": tenant_id }, "scheme": "Kubernetes" }, "data": { "authorizationType": "AzureSubscription", "azureSubscriptionId": subscription_id, "azureSubscriptionName": subscription_name, "clusterId": cluster_id }, "type": "Kubernetes", "url": "https://" + fqdn } } def get_container_registry_service_connection(organization, project): import subprocess import json subscription_id, subscription_name, tenant_id, _environment_name = get_default_subscription_info() logger.warning("Using your default Azure subscription %s for fetching Azure Container Registries.", subscription_name) acr_list = subprocess.check_output('az acr list -o json', shell=True) acr_list = json.loads(acr_list) if acr_list: registry_choice = 0 registry_choice_list = [] for acr_clusters in acr_list: registry_choice_list.append(acr_clusters['name']) registry_choice = prompt_user_friendly_choice_list( "Which Azure Container Registry do you want to use for this pipeline?", registry_choice_list) selected_registry = acr_list[registry_choice] cix_client = get_new_cix_client(organization=organization) acr_connection_obj = get_container_registry_connection_create_object( subscription_id, subscription_name, tenant_id, selected_registry['id'], selected_registry['name'], selected_registry['loginServer']) acr_container_resource = cix_client.create_resources(creation_parameters=acr_connection_obj, project=project) poll_connection_ready(organization, project, acr_container_resource.resources['containerRegistryConnection']['Id']) return acr_container_resource.resources['containerRegistryConnection'] raise CLIError('There is no Azure container registry associated with your subscription. ' 'Create an ACR or switch to another subscription, ' 'verify with command \'az acr list\' and try again.') def get_webapp_from_list_selection(): logger.debug("Fetching web app list to display") import subprocess import json _subscription_id, subscription_name, _tenant_id, _environment_name = get_default_subscription_info() logger.warning("Using your default Azure subscription %s for fetching Web App list.", subscription_name) webapp_list = subprocess.check_output('az webapp list -o json', shell=True) webapp_list = json.loads(webapp_list) if webapp_list: app_choice = 0 app_choice_list = [] for webapp in webapp_list: app_choice_list.append(webapp['name']) app_choice = prompt_user_friendly_choice_list( "Which Web App do you want to target?", app_choice_list) return webapp_list[app_choice]['name'] raise CLIError('There are no Web apps in this subscription. Either create a Web App using this subscription ' 'or change to another subscription. Verify with command \'az webapp list\'.') def get_kubernetes_resource_create_object(resource_name, cluster_name, repo_name, kubernetes_service_connection_id, namespace): return { "k8sResource": { "resourcetocreate": { "name": resource_name, "namespace": namespace, "clusterName": cluster_name, "serviceEndpointId": kubernetes_service_connection_id }, "type": "environmentResource:kubernetes" }, "environment": { "resourcetocreate": { "name": repo_name, "description": "CI/CD setup from this repo: '{reponame}'".format(reponame=repo_name) }, "type": "environment" } } def get_kubernetes_connection_create_object(subscription_id, subscription_name, cluster_id, cluster_name, fqdn, tenant_id, namespace, create_namespace, azure_env): return { "k8sConnection": { "resourcetocreate": { "data": { "authorizationType": "AzureSubscription", "azureSubscriptionId": subscription_id, "azureSubscriptionName": subscription_name, "clusterId": cluster_id, "namespace": namespace, "operation.createOrReuseNamespace": create_namespace }, "name": cluster_name + "-" + namespace, "type": "kubernetes", "url": "https://" + fqdn, "authorization": { "scheme": "Kubernetes", "parameters": { "azureEnvironment": azure_env, "azureTenantId": tenant_id } } }, "type": "endpoint:kubernetes" } } def get_container_registry_connection_create_object(subscription_id, subscription_name, tenant_id, registry_id, registry_name, login_server): return { "containerRegistryConnection": { "resourcetocreate": { "data": { "registrytype": "ACR", "registryId": registry_id, "subscriptionId": subscription_id, "subscriptionName": subscription_name }, "name": registry_name, "type": "dockerregistry", "url": "https://" + login_server, "authorization": { "scheme": "serviceprincipal", "parameters": { "tenantId": tenant_id, "servicePrincipalId": "", "scope": registry_id, "loginServer": login_server } } }, "type": "endpoint:containerRegistry" } } def get_azure_rm_connection_create_object(subscription_id, subscription_name, azure_env, tenant_id): return { "azureRmConnection": { "resourcetocreate": { "data": { "subscriptionId": subscription_id, "subscriptionName": subscription_name, "environment": azure_env, "scopeLevel": "Subscription", "creationMode": "Automatic", "azureSpnRoleAssignmentId": "", "azureSpnPermissions": "", "spnObjectId": "", "appObjectId": "" }, "name": "{sub_name} ({sub_id})".format(sub_name=subscription_name, sub_id=subscription_id), "type": "azurerm", "url": "https://management.azure.com/", "authorization": { "scheme": "ServicePrincipal", "parameters": { "tenantid": tenant_id, "serviceprincipalid": "", "authenticationType": "spnKey", "serviceprincipalkey": "" } } }, "type": "endpoint:azureRm" } } azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_folders.py000066400000000000000000000106021360605530400326050ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.services import resolve_instance_and_project, get_build_client logger = get_logger(__name__) def pipeline_folder_create(path, description=None, organization=None, project=None, detect=None): """ Create a folder. :param path: Full path of the folder. :type path: str :param description: Description of the folder. :type description: str :param project: Name or ID of the team project. :type project: str :param detect: Automatically detect organization and project. Default is "on". :type detect: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) from azext_devops.devops_sdk.v5_0.build.models import Folder folder = Folder() folder.description = description folder.path = path new_folder = client.create_folder(folder=folder, path=path, project=project) return new_folder def pipeline_folder_delete(path, organization=None, project=None, detect=None): """ Delete a folder. :param path: Full path of the folder. :type path: str :param project: Name or ID of the team project. :type project: str :param detect: Automatically detect organization and project. Default is "on". :type detect: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) return client.delete_folder(path=path, project=project) def pipeline_folder_list(path=None, query_order=None, organization=None, project=None, detect=None): """ List all folders. :param path: Full path of the folder. :type path: str :param query_order: Order in which folders are returned. :type query_order: str :param project: Name or ID of the team project. :type project: str :param detect: Automatically detect organization and project. Default is "on". :type detect: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) if query_order: if query_order.lower() == 'asc': query_order = 'folderAscending' elif query_order.lower() == 'desc': query_order = 'folderDescending' return client.get_folders(path=path, query_order=query_order, project=project) def pipeline_folder_update(path, new_path=None, new_description=None, organization=None, project=None, detect=None): """ Update a folder name or description. :param path: Full path of the folder. :type path: str :param new_path: New full path of the folder. :type new_path: str :param new_description: New description of the folder. :type new_description: str :param project: Name or ID of the team project. :type project: str :param detect: Automatically detect organization and project. Default is "on". :type detect: str """ if not new_path and not new_description: raise CLIError('Either --new-path or --new-description should be specified.') organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) folders = client.get_folders(path=path, project=project, query_order='folderAscending') folder_to_update = None # find matching folder if present for folder in folders: if folder.path.strip('\\') == path.strip('\\'): folder_to_update = folder break if not folder_to_update: raise CLIError('Cannot find folder with path {}. Update operation failed.'.format(path)) if new_description: folder_to_update.description = new_description if new_path: folder_to_update.path = new_path return client.update_folder(path=path, folder=folder_to_update, project=project) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_run.py000066400000000000000000000150701360605530400317570ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from azext_devops.dev.common.services import resolve_instance_and_project, get_build_client from azext_devops.dev.common.git import resolve_git_ref_heads from azext_devops.dev.common.identities import resolve_identity_as_id logger = get_logger(__name__) def pipeline_run_show(id, open=False, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """ Show details of a pipeline run. :param id: ID of the pipeline run. :type id: int :param open: Open the build results page in your web browser. :type open: bool :param project: Name or ID of the team project. :type project: str :param detect: Automatically detect organization and project. Default is "on". :type detect: str :rtype: :class:` ` """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) build = client.get_build(build_id=id, project=project) if open: _open_pipeline_run(build, organization) return build def pipeline_run_list(pipeline_ids=None, branch=None, organization=None, project=None, detect=None, top=None, query_order=None, result=None, status=None, reason=None, tags=None, requested_for=None): """ List the pipeline runs in a project. :param pipeline_ids: IDs (space separated) of definitions to list builds for. :type pipeline_ids: int :param branch: Filter by builds for this branch. :type branch: str :param top: Maximum number of builds to list. :type top: int :param query_order: Order of pipeline runs. :type query_order: str :param result: Limit to builds with this result. :type result: str :param status: Limit to builds with this status. :type status: str :param reason: Limit to builds with this reason. :type reason: str :param tags: Limit to builds with each of the specified tags. Space separated. :type tags: list of str :param requested_for: Limit to builds requested for this user or group. :type requested_for: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_build_client(organization) if pipeline_ids is not None and pipeline_ids: pipeline_ids = list(set(pipeline_ids)) # make distinct if tags is not None and tags: tags = list(set(tags)) # make distinct query_order = _resolve_runs_query_order(query_order) builds = client.get_builds(definitions=pipeline_ids, project=project, branch_name=resolve_git_ref_heads(branch), top=top, result_filter=result, status_filter=status, reason_filter=reason, tag_filters=tags, query_order=query_order, requested_for=resolve_identity_as_id(requested_for, organization)) return builds def _resolve_runs_query_order(query_order): if query_order: query_order_vals = ['finishTimeAscending', 'finishTimeDescending', 'queueTimeAscending', 'queueTimeDescending', 'startTimeAscending', 'startTimeDescending'] for val in query_order_vals: if query_order.lower() in val.lower(): return val logger.warning("Cannot resolve --query-order, continuing with None") return None def pipeline_run_add_tag(run_id, tags, organization=None, project=None, detect=None): """ Add tag(s) for a pipeline run. :param run_id: ID of the pipeline run. :type run_id: int :param tags: Tag(s) to be added to the pipeline run. [Comma seperated values] :type tags: str :rtype: list of str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_build_client(organization) tags = list(map(str, tags.split(','))) if len(tags) == 1: tags = client.add_build_tag(project=project, build_id=run_id, tag=tags[0]) else: tags = client.add_build_tags(tags=tags, project=project, build_id=run_id) return tags def pipeline_run_delete_tag(run_id, tag, organization=None, project=None, detect=None): """ Delete a pipeline run tag. :param run_id: ID of the pipeline run. :type run_id: int :param tag: Tag to be deleted from the pipeline run. :type tag: str :rtype: list of str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_build_client(organization) tags = client.delete_build_tag(project=project, build_id=run_id, tag=tag) return tags def pipeline_run_get_tags(run_id, organization=None, project=None, detect=None): """ Get tags for a pipeline run. :param run_id: ID of the pipeline run. :type run_id: int :rtype: list of str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_build_client(organization) tags = client.get_build_tags(build_id=run_id, project=project) return tags def _open_pipeline_run(run, organization): """Open the build results page in your web browser. :param :class:` ` build: :param str organization: """ from webbrowser import open_new from azext_devops.dev.common.uri import uri_quote # https://dev.azure.com/OrgName/ProjectName/_build/results?buildId=1234 project = run.project.name url = organization.rstrip('/') + '/' + uri_quote(project) + '/_build/results?buildid='\ + uri_quote(str(run.id)) logger.debug('Opening web page: %s', url) open_new(url=url) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_utils.py000066400000000000000000000031601360605530400323100ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azext_devops.dev.common.services import get_build_client from azext_devops.devops_sdk.v5_0.build.models import DefinitionResourceReference def set_authorize_resource(authorized, res_id, name, res_type, organization, project): """ param authorized: Boolean value set to authorize or unauthorize resource param id: Id of the resource to authorize param name: Name of the resource to authorize param type: Type of the resource to authorize param organization: Organization URL param project: Project Id """ client = get_build_client(organization=organization) resources = [DefinitionResourceReference(authorized=authorized, id=res_id, name=name, type=res_type)] client.authorize_project_resources(resources=resources, project=project) def get_authorize_resource(res_id, res_type, organization, project): """ param id: Id of the resource to authorize param name: Name of the resource to authorize param type: Type of the resource to authorize param organization: Organization URL param project: Project Id """ client = get_build_client(organization=organization) resource = client.get_project_resources(project=project, id=res_id, type=res_type) if resource: return resource[0].authorized return None azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/pipeline_variables.py000066400000000000000000000260121360605530400331210ustar00rootroot00000000000000 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError from knack.prompting import prompt_pass from azext_devops.dev.common.services import get_build_client, resolve_instance_and_project from azext_devops.dev.pipelines.build_definition import get_definition_id_from_name from azext_devops.dev.common.const import AZ_DEVOPS_PIPELINES_VARIABLES_KEY_PREFIX from azext_devops.dev.common.prompting import verify_is_a_tty_or_raise_error logger = get_logger(__name__) def pipeline_variable_add(name, pipeline_id=None, pipeline_name=None, value=None, allow_override=None, secret=None, organization=None, project=None, detect=None): """Add a variable to a pipeline :param pipeline_id: Id of the pipeline. :type pipeline_id: int :param pipeline_name: Name of the pipeline. Ignored if --pipeline-id parameter is supplied. :type pipeline_name: str :param allow_override: Indicates whether the value can be set at queue time. :type allow_override: bool :param secret: Indicates whether the variable's value is a secret. :type secret: bool :param name: Name of the variable. :type name: str :param value: Value of the variable. For secret variables, if --value parameter is not given, it will be picked from environment variable prefixed with AZURE_DEVOPS_EXT_PIPELINE_VAR_ or user will be prompted to enter it via standard input. e.g. A variable named `MySecret` can be input using environment variable AZURE_DEVOPS_EXT_PIPELINE_VAR_MySecret :type value: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) if pipeline_id is None and pipeline_name is None: raise ValueError('Either the --pipeline-id or --pipeline-name argument ' + 'must be supplied for this command.') pipeline_client = get_build_client(organization) if pipeline_id is None: pipeline_id = get_definition_id_from_name(pipeline_name, pipeline_client, project) # get pipeline definition pipeline_definition = pipeline_client.get_definition(definition_id=pipeline_id, project=project) # Check if the variable already exists if pipeline_definition.variables: for key in pipeline_definition.variables.keys(): if key.lower() == name.lower(): raise CLIError( 'Variable \'{}\' already exists. ' 'Use `az pipelines variable update` command to update the key/value.'.format(key)) else: pipeline_definition.variables = {} # Add the variable to the definition from azext_devops.devops_sdk.v5_0.build.models import BuildDefinitionVariable if not value: if secret: value = _get_value_from_env_or_stdin(var_name=name) else: value = '' logger.debug('--value is being set to \'\', since --value was not speficied.') pipeline_definition.variables[name] = BuildDefinitionVariable(allow_override=allow_override, is_secret=secret, value=value) updated_variables = pipeline_client.update_definition( project=project, definition_id=pipeline_id, definition=pipeline_definition).variables var_name, var_value = _case_insensitive_get(input_dict=updated_variables, search_key=name) return {var_name: var_value} def pipeline_variable_update(name, pipeline_id=None, pipeline_name=None, new_name=None, value=None, allow_override=None, secret=None, prompt_value=None, organization=None, project=None, detect=None): """Update a variable in a pipeline :param pipeline_id: Id of the pipeline. :type pipeline_id: int :param pipeline_name: Name of the pipeline. Ignored if --pipeline-id parameter is supplied. :type pipeline_name: str :param allow_override: Indicates whether the value can be set at queue time. :type allow_override: bool :param secret: Indicates whether the variable's value is a secret. :type secret: bool :param name: Name of the variable. :type name: str :param new_name: New name of the variable. :type new_name: str :param value: New value of the variable. For secret variables, use --prompt-value parameter, to be prompted to enter it via standard input. For non-interactive consoles it can be picked from environment variable prefixed with AZURE_DEVOPS_EXT_PIPELINE_VAR_ e.g. A variable nameed `MySecret` can be input using environment variable AZURE_DEVOPS_EXT_PIPELINE_VAR_MySecret :type value: str :param secret: If the value of the variable is a secret. :type secret: str :param prompt_value: Set it to True to update the value of a secret variable using environment variable or prompt via standard input. :type prompt_value: str """ if not new_name and not value and secret is None and allow_override is None and not prompt_value: raise CLIError('Atleast one of --new-name, --value, --is-secret, --prompt-value or --allow-override ' 'must be specified for update.') organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) if pipeline_id is None and pipeline_name is None: raise ValueError('Either the --pipeline-id or --pipeline-name argument ' + 'must be supplied for this command.') pipeline_client = get_build_client(organization) if pipeline_id is None: pipeline_id = get_definition_id_from_name(pipeline_name, pipeline_client, project) # get pipeline definition pipeline_definition = pipeline_client.get_definition(definition_id=pipeline_id, project=project) old_key = None old_value = None new_key = None # Check if the variable already exists old_key, old_value = _case_insensitive_get(input_dict=pipeline_definition.variables, search_key=name) new_key = new_name if new_name else old_key if old_key: secret = old_value.is_secret if secret is None else secret allow_override = old_value.allow_override if allow_override is None else allow_override if not value and secret and prompt_value: value = _get_value_from_env_or_stdin(var_name=new_key) from azext_devops.devops_sdk.v5_0.build.models import BuildDefinitionVariable if old_key != new_key: existing_key, _ = _case_insensitive_get(input_dict=pipeline_definition.variables, search_key=new_key) if existing_key: raise CLIError('Variable \'{}\' already exists.'.format(existing_key)) pipeline_definition.variables.pop(old_key) pipeline_definition.variables[new_key] = BuildDefinitionVariable( is_secret=secret, value=old_value.value if value is None else value, allow_override=allow_override) updated_variables = pipeline_client.update_definition( project=project, definition_id=pipeline_id, definition=pipeline_definition).variables var_name, var_value = _case_insensitive_get(input_dict=updated_variables, search_key=new_key) return {var_name: var_value} raise CLIError('Variable \'{}\' does not exist.'.format(name)) def pipeline_variable_list(pipeline_id=None, pipeline_name=None, organization=None, project=None, detect=None): """List the variables in a pipeline :param pipeline_id: Id of the pipeline. :type pipeline_id: int :param pipeline_name: Name of the pipeline. Ignored if --pipeline-id parameter is supplied. :type pipeline_name: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) if pipeline_id is None and pipeline_name is None: raise ValueError('Either the --pipeline-id or --pipeline-name argument ' + 'must be supplied for this command.') pipeline_client = get_build_client(organization) if pipeline_id is None: pipeline_id = get_definition_id_from_name(pipeline_name, pipeline_client, project) # get pipeline definition pipeline_definition = pipeline_client.get_definition(definition_id=pipeline_id, project=project) return pipeline_definition.variables def pipeline_variable_delete(name, pipeline_id=None, pipeline_name=None, organization=None, project=None, detect=None): """Delete a variable from pipeline :param pipeline_id: Id of the pipeline. :type pipeline_id: int :param pipeline_name: Name of the pipeline. :type pipeline_name: str :param name: Name of the variable to delete. :type name: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) if pipeline_id is None and pipeline_name is None: raise ValueError('Either the --pipeline-id or --pipeline-name argument ' + 'must be supplied for this command.') pipeline_client = get_build_client(organization) if pipeline_id is None: pipeline_id = get_definition_id_from_name(name, pipeline_client, project) # get pipeline definition pipeline_definition = pipeline_client.get_definition(definition_id=pipeline_id, project=project) key_to_delete = None # Check if the variable already exists key = None if pipeline_definition.variables: for key in pipeline_definition.variables.keys(): if key.lower() == name.lower(): key_to_delete = key break if not key_to_delete: raise CLIError('Variable \'{}\' does not exist. '.format(name)) _ = pipeline_definition.variables.pop(key) _ = pipeline_client.update_definition(project=project, definition_id=pipeline_id, definition=pipeline_definition) print('Deleted variable \'{}\' successfully.'.format(key_to_delete)) def _get_value_from_env_or_stdin(var_name): env_var_name = AZ_DEVOPS_PIPELINES_VARIABLES_KEY_PREFIX + var_name logger.debug('Checking for variable %s in environment variable %s', var_name, env_var_name) import os value = os.getenv(env_var_name, None) logger.debug('Value of Variable %s in environment variable is found %s', var_name, value is not None) if not value: verify_is_a_tty_or_raise_error( 'For non-interactive consoles set environment variable {}, or pipe the value of variable into the command.' .format(env_var_name)) value = prompt_pass(msg=var_name + ': ') return value def _case_insensitive_get(input_dict, search_key): search_key = search_key.lower() if input_dict: for key in input_dict.keys(): if key.lower() == search_key: return key, input_dict[key] return None, None azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/release.py000066400000000000000000000130461360605530400307070ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from webbrowser import open_new from knack.log import get_logger from azext_devops.devops_sdk.v5_0.release.models import ArtifactMetadata, BuildVersion, ReleaseStartMetadata from azext_devops.dev.common.services import (get_release_client, resolve_instance_and_project) from .release_definition import get_definition_id_from_name logger = get_logger(__name__) def release_create(definition_id=None, definition_name=None, artifact_metadata_list=None, description=None, open=False, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Request (create) a release. :param definition_id: ID of the definition to create. Required if --definition-name is not supplied. :type definition_id: int :param definition_name: Name of the definition to create. Ignored if --definition-id is supplied. :type definition_name: str :param open: Open the release results page in your web browser. :type open: bool :param artifact_metadata_list: Space separated "alias=version_id" pairs. :type artifact_metadata_list: [str] :param description: Description of the release. :type description: str :rtype: :class:` ` """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) if definition_id is None and definition_name is None: raise ValueError('Either the --definition-id argument or the --definition-name argument ' + 'must be supplied for this command.') client = get_release_client(organization) if definition_id is None: definition_id = get_definition_id_from_name(definition_name, client, project) artifacts = [] if artifact_metadata_list is not None and artifact_metadata_list: for artifact_metadata in artifact_metadata_list: separator_pos = artifact_metadata.find('=') if separator_pos >= 0: instance_reference = BuildVersion(id=artifact_metadata[separator_pos + 1:]) artifact = ArtifactMetadata(alias=artifact_metadata[:separator_pos], instance_reference=instance_reference) artifacts.append(artifact) else: raise ValueError('The --artifact_meta_data_list argument should consist' 'of space separated "alias=version_id" pairs.' + artifact_metadata) release = ReleaseStartMetadata(definition_id=definition_id, artifacts=artifacts, description=description) created_release = client.create_release(release_start_metadata=release, project=project) if open: _open_release(created_release) return created_release def release_show(id, open=False, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Get the details of a release. :param id: ID of the release. :type id: int :param open: Open the release results page in your web browser. :type open: bool :rtype: :class:` ` """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_release_client(organization) release = client.get_release(release_id=id, project=project) if open: _open_release(release) return release def release_list(definition_id=None, source_branch=None, organization=None, project=None, detect=None, top=None, status=None): """List release results. :param definition_id: ID of definition to list releases for. :type definition_id: int :param branch: Filter by releases for this branch. :type branch: str :param top: Maximum number of releases to list. Default is 50. :type top: int :param status: Limit to releases with this status. :type status: str :param source_branch: Filter releases for this branch. :type source_branch: str :rtype: :class:` ` """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_release_client(organization) releases = client.get_releases(definition_id=definition_id, project=project, source_branch_filter=source_branch, top=top, status_filter=status) return releases def _open_release(release): """Open the release results page in your web browser. :param :class:` ` release: """ url = _get_release_web_url(release) if url is not None and url: logger.debug('Opening web page: %s', url) open_new(url=url) def _get_release_web_url(release): links = release._links # pylint: disable=protected-access if links is not None and links: properties = links.additional_properties if properties is not None and properties: web_url = properties.get('web') if web_url is not None and web_url: return web_url.get('href') return None azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/release_definition.py000066400000000000000000000113471360605530400331210ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from webbrowser import open_new from knack.log import get_logger from azext_devops.dev.common.services import (get_release_client, resolve_instance_and_project) from azext_devops.dev.common.uuid import is_uuid logger = get_logger(__name__) def release_definition_list(name=None, top=None, organization=None, project=None, artifact_type=None, artifact_source_id=None, detect=None): """List release definitions. :param name: Limit results to definitions with this name or contains this name. Example: "FabCI" :type name: str :param top: Maximum number of definitions to list. :type top: int :param artifact_type: Release definitions with given artifactType will be returned. :type artifact_type: str :param artifact_source_id: Limit results to definitions associated with this artifact_source_id. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. :type artifact_source_id: str :rtype: [ReleaseDefinitionReference] """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_release_client(organization) query_order = 'nameAscending' definition_references = client.get_release_definitions( project=project, search_text=name, artifact_source_id=artifact_source_id, artifact_type=artifact_type, top=top, query_order=query_order) return definition_references def release_definition_show(id=None, name=None, open=False, organization=None, project=None, # pylint: disable=redefined-builtin detect=None): """Get the details of a release definition. :param id: ID of the definition. :type id: int :param name: Name of the definition. Ignored if --id is supplied. :type name: str :param open: Open the definition summary page in your web browser. :type open: bool :rtype: ReleaseDefinitionReference """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_release_client(organization) if id is None: if name is not None: id = get_definition_id_from_name(name, client, project) else: raise ValueError("Either the --id argument or the --name argument must be supplied for this command.") release_definition = client.get_release_definition(definition_id=id, project=project) if open: _open_definition(release_definition) return release_definition def _open_definition(definition): """Opens the release definition in the default browser. :param :class:` ` definition: """ url = _get_release_definition_web_url(definition) if url is not None and url: logger.debug('Opening web page: %s', url) open_new(url=url) def get_definition_id_from_name(name, client, project): definition_references = client.get_release_definitions( project=project, search_text=name, is_exact_name_match='true') if len(definition_references) == 1: return definition_references[0].id if len(definition_references) > 1: if is_uuid(project): project = definition_references[0].project.name message = 'Multiple definitions were found matching name "{name}" in project "{project}". Try '\ + 'supplying the definition ID.' raise ValueError(message.format(name=name, project=project)) raise ValueError('There were no release definitions matching name "{name}" in project "{project}".' .format(name=name, project=project)) def _get_release_definition_web_url(definition): links = definition._links # pylint: disable=protected-access if links is not None and links: properties = links.additional_properties if properties is not None and properties: web_url = properties.get('web') if web_url is not None and web_url: return web_url.get('href') return None azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/runs_artifacts.py000066400000000000000000000054111360605530400323130ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from azext_devops.dev.common.services import (get_build_client, resolve_instance_and_project) from azext_devops.dev.common.artifacttool import ArtifactToolInvoker from azext_devops.dev.common.artifacttool_updater import ArtifactToolUpdater from azext_devops.dev.common.external_tool import ProgressReportingExternalToolInvoker logger = get_logger(__name__) def run_artifact_download(run_id, artifact_name, path, organization=None, project=None, detect=None): """ Download a pipeline artifact. :param run_id: ID of the run that the artifact is associated to. :type run_id: int :param artifact_name: Name of the artifact to download. :type artifact_name: string :param path: Path to download the artifact into. :type path: string """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) artifact_tool = ArtifactToolInvoker(ProgressReportingExternalToolInvoker(), ArtifactToolUpdater()) return artifact_tool.download_pipeline_artifact( organization=organization, project=project, run_id=run_id, artifact_name=artifact_name, path=path) def run_artifact_list(run_id, organization=None, project=None, detect=None): """ List artifacts associated with a run. :param run_id: ID of the run that the artifact is associated to. :type run_id: int """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_build_client(organization) artifacts = client.get_artifacts(project=project, build_id=run_id) return artifacts def run_artifact_upload(run_id, artifact_name, path, organization=None, project=None, detect=None): """ Upload a pipeline artifact. :param run_id: ID of the run that the artifact is associated to. :type run_id: int :param artifact_name: Name of the artifact to upload. :type artifact_name: string :param path: Path to upload the artifact from. :type path: string """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) artifact_tool = ArtifactToolInvoker(ProgressReportingExternalToolInvoker(), ArtifactToolUpdater()) return artifact_tool.upload_pipeline_artifact( organization=organization, project=project, run_id=run_id, artifact_name=artifact_name, path=path) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/pipelines/variable_group.py000066400000000000000000000345431360605530400322750ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.services import get_task_agent_client, resolve_instance_and_project from azext_devops.dev.pipelines.pipeline_variables import _case_insensitive_get, _get_value_from_env_or_stdin logger = get_logger(__name__) # pylint: disable=too-few-public-methods class VariableGroupAuthorized(): _attribute_map = { 'variable_group_parameters': {'key': 'variable_group_parameters', 'type': 'VariableGroupParameters'}, 'authorized': {'key': 'authorized', 'type': 'bool'} } def __init__(self, variable_group_parameters, authorized): self.authorized = authorized if authorized is not None else False self.id = variable_group_parameters.id self.description = variable_group_parameters.description self.name = variable_group_parameters.name self.provider_data = variable_group_parameters.provider_data self.type = variable_group_parameters.type self.variables = variable_group_parameters.variables def variable_group_create(name, variables, description=None, authorize=None, organization=None, project=None, detect=None): """Create a variable group :param name: Name of the variable group. :type name: str :param description: Description of the variable group. :type description: str :param authorize: Whether the variable group should be accessible by all pipelines. :type authorize: boolean :param variables: Variables in format key=value space separated pairs. Secret variables should be managed using `az pipelines variable-group variable` commands. :type type: [str] """ group_type = 'Vsts' organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_task_agent_client(organization) from azext_devops.devops_sdk.v5_0.task_agent.models import VariableGroupParameters, VariableValue variables_dict = {} if variables: for variable in variables: key, value = variable.split('=', 1) variables_dict[key] = VariableValue(is_secret=False, value=value) var_group = VariableGroupParameters(name=name, description=description, type=group_type, variables=variables_dict) var_group = client.add_variable_group(group=var_group, project=project) if authorize is not None: from .pipeline_utils import set_authorize_resource set_authorize_resource( authorized=authorize, res_id=var_group.id, name=var_group.name, res_type='variablegroup', organization=organization, project=project) return VariableGroupAuthorized(var_group, authorize) def variable_group_show(group_id, organization=None, project=None, detect=None): """Show variable group details. :param group_id: ID of the variable group. :type group_id: int """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_task_agent_client(organization) var_group = client.get_variable_group(group_id=group_id, project=project) if not var_group: raise CLIError('Variable group with Id {} could not be found.'.format(group_id)) from .pipeline_utils import get_authorize_resource authorized = get_authorize_resource( res_id=var_group.id, res_type='variablegroup', organization=organization, project=project) return VariableGroupAuthorized(var_group, authorized) def variable_group_list(group_name=None, action_filter=None, top=None, continuation_token=None, query_order='Desc', organization=None, project=None, detect=None): """List variable groups :param group_name: Name of the variable group. Wildcards are accepted. e.g. var_group* :type group_name: str :param action_filter: Action filter for the variable group. It specifies the action which can be performed on the variable groups. :type action_filter: str :param top: Number of variable groups to get. :type top: str :param continuation_token: Gets the variable groups after the continuation token provided. :type continuation_token: str :param query_order: Gets the results in the defined order. :type query_order: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) _QUERY_ORDER_ASCENDING = 'idAscending' _QUERY_ORDER_DESCENDING = 'idDescending' query_order = _QUERY_ORDER_DESCENDING if query_order.lower() == 'desc' else _QUERY_ORDER_ASCENDING client = get_task_agent_client(organization) return client.get_variable_groups(project=project, group_name=group_name, action_filter=action_filter, top=top, continuation_token=continuation_token, query_order=query_order) def variable_group_delete(group_id, organization=None, project=None, detect=None): """Delete a variable group :param group_id: Id of the variable group. :type group_id: int """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_task_agent_client(organization) delete_response = client.delete_variable_group(project=project, group_id=group_id) print("Deleted variable group successfully.") return delete_response def variable_group_update(group_id, name=None, description=None, authorize=None, organization=None, project=None, detect=None): """Update a variable group :param group_id: Id of the variable group. :type group_id: int :param name: New name of the variable group. :type name: str :param authorize: Whether the variable group should be accessible by all pipelines. :type authorize: boolean :param description: New description of the variable group. :type description: str """ if not name and not description and authorize is None: raise CLIError("Either --name, --description or --authorize must be specified for update.") organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_task_agent_client(organization) var_group = client.get_variable_group(group_id=group_id, project=project) if not var_group: raise CLIError('Variable group with Id {} could not be found.'.format(group_id)) update = False if name: var_group.name = name update = True if description: var_group.description = description update = True if update: var_group = client.update_variable_group(group=var_group, project=project, group_id=group_id) if authorize is not None: from .pipeline_utils import set_authorize_resource set_authorize_resource( authorized=authorize, res_id=var_group.id, name=var_group.name, res_type='variablegroup', organization=organization, project=project) else: from .pipeline_utils import get_authorize_resource authorize = get_authorize_resource(res_id=var_group.id, res_type='variablegroup', organization=organization, project=project) return VariableGroupAuthorized(var_group, authorize) def variable_group_variable_add(group_id, name, value=None, secret=None, organization=None, project=None, detect=None): """Add a variable to a variable group :param group_id: Id of the variable group. :type group_id: int :param name: Name of the variable. :type name: str :param value: Value of the variable. For secret variables, if --value parameter is not given, it will be picked from environment variable prefixed with AZURE_DEVOPS_EXT_PIPELINE_VAR_ or user will be prompted to enter it via standard input. e.g. PersonalAccessToken can be input using environment variable AZURE_DEVOPS_EXT_PIPELINE_VAR_PersonalAccessToken :type value: str :param secret: If the value of the variable is a secret. :type secret: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_task_agent_client(organization) var_group = client.get_variable_group(group_id=group_id, project=project) if not var_group: raise CLIError('Variable group with Id {} could not be found.'.format(group_id)) # Check if the variable already exists for key in var_group.variables.keys(): if key.lower() == name.lower(): raise CLIError( 'Variable \'{}\' already exists. ' 'Use `az pipelines variable-group variable update` command to update the key/value.'.format(key)) # Add the variable to the variable group. from azext_devops.devops_sdk.v5_0.task_agent.models import VariableValue if not value: if secret: value = _get_value_from_env_or_stdin(var_name=name) else: value = '' logger.debug('--value is being set to \'\', since --value was not speficied.') var_group.variables[name] = VariableValue(is_secret=secret, value=value) updated_variables = client.update_variable_group(group=var_group, project=project, group_id=group_id).variables var_name, var_value = _case_insensitive_get(input_dict=updated_variables, search_key=name) return {var_name: var_value} def variable_group_variable_update(group_id, name, new_name=None, value=None, secret=None, prompt_value=False, organization=None, project=None, detect=None): """Update a variable in a variable group :param group_id: Id of the variable group. :type group_id: int :param name: Name of the variable. :type name: str :param new_name: New name of the variable. :type new_name: str :param value: New value of the variable. For secret variables, if --value parameter is not given, it will be picked from environment variable prefixed with AZURE_DEVOPS_EXT_PIPELINE_VAR_ or user will be prompted to enter it via standard input. e.g. PersonalAccessToken can be input using environment variable AZURE_DEVOPS_EXT_PIPELINE_VAR_PersonalAccessToken :type value: str :param secret: If the value of the variable is a secret. :type secret: str :param prompt_value: Set it to True to update the value of a secret variable using environment variable or prompt via standard input. :type prompt_value: str """ if not new_name and not value and secret is None and not prompt_value: raise CLIError('Atleast one of --new-name, --value or --is-secret, --prompt-value ' 'must be specified for update.') organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_task_agent_client(organization) var_group = client.get_variable_group(group_id=group_id, project=project) if not var_group: raise CLIError('Variable group with Id {} could not be found.'.format(group_id)) old_key = None old_value = None new_key = None # Check if the variable already exists old_key, old_value = _case_insensitive_get(input_dict=var_group.variables, search_key=name) new_key = new_name if new_name else old_key if old_key: secret = old_value.is_secret if secret is None else secret if not value and secret and prompt_value: value = _get_value_from_env_or_stdin(var_name=new_key) from azext_devops.devops_sdk.v5_0.task_agent.models import VariableValue if old_key != new_key: existing_key, _ = _case_insensitive_get(input_dict=var_group.variables, search_key=new_key) if existing_key: raise CLIError('Variable \'{}\' already exists.'.format(existing_key)) var_group.variables.pop(old_key) var_group.variables[new_key] = VariableValue( is_secret=secret, value=old_value.value if value is None else value) updated_variables = client.update_variable_group( group=var_group, project=project, group_id=group_id).variables var_name, var_value = _case_insensitive_get(input_dict=updated_variables, search_key=new_key) return {var_name: var_value} raise CLIError('Variable \'{}\' does not exist. '.format(name)) def variable_group_variable_list(group_id, organization=None, project=None, detect=None): """List the variables in a variable group :param group_id: Id of the variable group. :type group_id: int """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_task_agent_client(organization) var_group = client.get_variable_group(group_id=group_id, project=project) if not var_group: raise CLIError('Variable group with Id {} could not be found.'.format(group_id)) return var_group.variables def variable_group_variable_delete(group_id, name, organization=None, project=None, detect=None): """Delete a variable from variable group :param group_id: Id of the variable group. :type group_id: int :param name: Name of the variable. :type name: str """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) client = get_task_agent_client(organization) var_group = client.get_variable_group(group_id=group_id, project=project) if not var_group: raise CLIError('Variable group with Id {} could not be found.'.format(group_id)) key_to_delete = None # Check if the variable already exists key = None for key in var_group.variables.keys(): if key.lower() == name.lower(): key_to_delete = key break if not key_to_delete: raise CLIError('Variable \'{}\' does not exist. '.format(name)) _ = var_group.variables.pop(key) _ = client.update_variable_group(group=var_group, project=project, group_id=group_id).variables print('Deleted variable \'{}\' successfully.'.format(key_to_delete)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/000077500000000000000000000000001360605530400260515ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/__init__.py000066400000000000000000000007171360605530400301670ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import pkg_resources from ._help import load_repos_help pkg_resources.declare_namespace(__name__) load_repos_help() azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/_format.py000066400000000000000000000262061360605530400300600ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from collections import OrderedDict import dateutil.parser import dateutil.tz _PR_TITLE_TRUNCATION_LENGTH = 50 _WORK_ITEM_TITLE_TRUNCATION_LENGTH = 70 def transform_repo_policies_table_output(result): table_output = [] for item in result: table_output.append(_transform_repo_policy_request_row(item)) return table_output def transform_repo_policy_table_output(result): table_output = [_transform_repo_policy_request_row(result)] return table_output def _transform_repo_policy_request_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = _get_policy_display_name(row) table_row['Is Blocking'] = row['isBlocking'] table_row['Is Enabled'] = row['isEnabled'] # this will break if policy is applied across repo but that is not possible via UI at least now table_row['Repository Id'] = row['settings']['scope'][0]['repositoryId'] if 'refName' in row['settings']['scope'][0]: table_row['Branch'] = row['settings']['scope'][0]['refName'] else: table_row['Branch'] = "All Branches" return table_row def _get_policy_display_name(row): if 'displayName' in row['settings']: return row['settings']['displayName'] return row['type']['displayName'] def transform_pull_requests_table_output(result): table_output = [] for item in result: table_output.append(_transform_pull_request_row(item)) return table_output def transform_pull_request_table_output(result): table_output = [_transform_pull_request_row(result)] return table_output def _transform_pull_request_row(row): table_row = OrderedDict() table_row['ID'] = row['pullRequestId'] table_row['Created'] = dateutil.parser.parse(row['creationDate']).astimezone(dateutil.tz.tzlocal()).date() table_row['Creator'] = row['createdBy']['uniqueName'] title = row['title'] if len(title) > _PR_TITLE_TRUNCATION_LENGTH: title = title[0:_PR_TITLE_TRUNCATION_LENGTH - 3] + '...' table_row['Title'] = title table_row['Status'] = row['status'].capitalize() table_row['IsDraft'] = str(row['isDraft']).capitalize() table_row['Repository'] = row['repository']['name'] return table_row def transform_reviewers_table_output(result): table_output = [] for item in sorted(result, key=_get_reviewer_table_key): table_output.append(_transform_reviewer_row(item)) return table_output def transform_reviewer_table_output(result): table_output = [_transform_reviewer_row(result)] return table_output def _get_reviewer_table_key(row): if row['isRequired']: key = '0' else: key = '1' key += row['displayName'].lower() return key _UNIQUE_NAME_GROUP_PREFIX = 'vstfs:///' def _transform_reviewer_row(row): table_row = OrderedDict() table_row['Name'] = row['displayName'] if row['uniqueName'][0:len(_UNIQUE_NAME_GROUP_PREFIX)] != _UNIQUE_NAME_GROUP_PREFIX: table_row['Email'] = row['uniqueName'] else: table_row['Email'] = ' ' table_row['ID'] = row['id'] table_row['Vote'] = _get_vote_from_vote_number(int(row['vote'])) if row['isRequired']: table_row['Required'] = 'True' else: table_row['Required'] = 'False' return table_row def transform_work_items_table_output(result): table_output = [] for item in result: table_output.append(_transform_work_items_row(item)) return table_output def transform_work_item_table_output(result): table_output = [_transform_work_items_row(result)] return table_output def _transform_work_items_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] if 'fields' in row: if 'System.WorkItemType' in row['fields']: table_row['Type'] = row['fields']['System.WorkItemType'] else: table_row['Type'] = ' ' if 'System.AssignedTo' in row['fields']: table_row['Assigned To'] = row['fields']['System.AssignedTo'] else: table_row['Assigned To'] = ' ' if 'System.State' in row['fields']: table_row['State'] = row['fields']['System.State'] else: table_row['State'] = ' ' if 'System.Title' in row['fields']: title = row['fields']['System.Title'] if len(title) > _WORK_ITEM_TITLE_TRUNCATION_LENGTH: title = title[0:_WORK_ITEM_TITLE_TRUNCATION_LENGTH - 3] + '...' table_row['Title'] = title else: table_row['Title'] = ' ' else: table_row['Assigned To'] = ' ' table_row['State'] = ' ' table_row['Title'] = ' ' return table_row def _get_vote_from_vote_number(number): if number == 10: return 'Approved' if number == 5: return 'Approved with suggestions' if number == -5: return 'Waiting for author' if number == -10: return 'Rejected' return ' ' def transform_policies_table_output(result): from azext_devops.dev.common.identities import (ensure_display_names_in_cache, get_display_name_from_identity_id) from azext_devops.dev.common.services import get_first_vss_instance_uri table_output = [] reviewer_ids = [] for item in result: reviewer_id = get_required_reviewer_from_evaluation_row(item) if reviewer_id is not None: reviewer_ids.append(get_required_reviewer_from_evaluation_row(item)) organization = get_first_vss_instance_uri() ensure_display_names_in_cache(organization, reviewer_ids) for item in result: reviewer_id = get_required_reviewer_from_evaluation_row(item) if reviewer_id is not None: display_name = get_display_name_from_identity_id(organization, reviewer_id) else: display_name = None if display_name is not None: table_output.append(_transform_policy_row(item, display_name)) else: table_output.append(_transform_policy_row(item)) return sorted(table_output, key=_get_policy_table_key) def get_required_reviewer_from_evaluation_row(row): if 'requiredReviewerIds' in row['configuration']['settings'] and len( row['configuration']['settings']['requiredReviewerIds']) == 1: return row['configuration']['settings']['requiredReviewerIds'][0] return None def transform_policy_table_output(result): table_output = [_transform_policy_row(result)] return table_output def _get_policy_table_key(row): if row['Blocking'] == 'True': key = '0' else: key = '1' key += row['Policy'].lower() return key def _transform_policy_row(row, identity_display_name=None): table_row = OrderedDict() table_row['Evaluation ID'] = row['evaluationId'] table_row['Policy'] = _build_policy_name(row, identity_display_name) if row['configuration']['isBlocking']: table_row['Blocking'] = 'True' else: table_row['Blocking'] = 'False' table_row['Status'] = _convert_policy_status(row['status']) if row['context'] and 'isExpired' in row['context']: if row['context']['isExpired']: table_row['Expired'] = 'True' else: table_row['Expired'] = 'False' else: # Not Applicable table_row['Expired'] = ' ' if row['context'] and 'buildId' in row['context'] and row['context']['buildId'] is not None: table_row['Build ID'] = row['context']['buildId'] else: table_row['Build ID'] = ' ' return table_row def _build_policy_name(row, identity_display_name=None): policy = row['configuration']['type']['displayName'] if 'displayName' in row['configuration']['settings']\ and row['configuration']['settings']['displayName'] is not None: policy += ' (' + row['configuration']['settings']['displayName'] + ')' if 'minimumApproverCount' in row['configuration']['settings']\ and row['configuration']['settings']['minimumApproverCount'] is not None: policy += ' (' + str(row['configuration']['settings']['minimumApproverCount']) + ')' if identity_display_name is not None and 'requiredReviewerIds' in row['configuration']['settings']: if len(row['configuration']['settings']['requiredReviewerIds']) > 1: policy += ' (' + str(len(row['configuration']['settings']['requiredReviewerIds'])) + ')' elif len(row['configuration']['settings']['requiredReviewerIds']) == 1: policy += ' (' + identity_display_name + ')' return policy def _convert_policy_status(status): if status == 'queued': return ' ' return status.capitalize() def transform_refs_table_output(result): table_output = [] for item in sorted(result, key=_get_repo_key): table_output.append(_transform_ref_row(item)) return table_output def transform_ref_table_output(result): table_output = [_transform_ref_row(result)] return table_output def _transform_ref_row(row): from azext_devops.dev.common.git import get_ref_name_from_ref table_row = OrderedDict() if 'objectId' in row: table_row['Object ID'] = row['objectId'] if ('oldObjectId' in row) and ('newObjectId' in row): old_id = row['oldObjectId'] new_id = row['newObjectId'] if old_id == '0000000000000000000000000000000000000000': table_row['Object ID'] = new_id elif new_id == '0000000000000000000000000000000000000000': table_row['Object ID'] = old_id else: table_row['Old Object ID'] = old_id table_row['New Object ID'] = new_id table_row['Name'] = get_ref_name_from_ref(row['name']) table_row['Success'] = row['success'] if 'success' in row else None table_row['Update Status'] = row['updateStatus'] if 'updateStatus' in row else None return table_row def transform_repos_table_output(result): table_output = [] for item in sorted(result, key=_get_repo_key): table_output.append(_transform_repo_row(item)) return table_output def transform_repo_table_output(result): table_output = [_transform_repo_row(result)] return table_output def transform_repo_import_table_output(result): table_output = OrderedDict() table_output['Name'] = result['repository']['name'] table_output['Project'] = result['repository']['project']['name'] table_output['Import Status'] = result['status'] return table_output def _transform_repo_row(row): from azext_devops.dev.common.git import get_branch_name_from_ref table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] if row['defaultBranch']: table_row['Default Branch'] = get_branch_name_from_ref(row['defaultBranch']) else: table_row['Default Branch'] = ' ' table_row['Project'] = row['project']['name'] return table_row def _get_repo_key(repo_row): return repo_row['name'] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/_help.py000066400000000000000000000047631360605530400275240ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.help_files import helps def load_repos_help(): helps['repos'] = """ type: group short-summary: Manage Azure Repos. long-summary: This command group is a part of the azure-devops extension. """ helps['repos pr'] = """ type: group short-summary: Manage pull requests. long-summary: """ helps['repos pr policy'] = """ type: group short-summary: Manage pull request policy. long-summary: """ helps['repos pr reviewer'] = """ type: group short-summary: Manage pull request reviewers. long-summary: """ helps['repos pr work-item'] = """ type: group short-summary: Manage work items associated with pull requests. long-summary: """ helps['repos import'] = """ type: group short-summary: Manage Git repositories import long-summary: """ helps['repos policy'] = """ type: group short-summary: Manage branch policy. long-summary: """ helps['repos policy approver-count'] = """ type: group short-summary: Manage approver count policy. long-summary: """ helps['repos policy build'] = """ type: group short-summary: Manage build policy. long-summary: """ helps['repos policy comment-required'] = """ type: group short-summary: Manage comment required policy. long-summary: """ helps['repos policy file-size'] = """ type: group short-summary: Manage file size policy. long-summary: """ helps['repos policy merge-strategy'] = """ type: group short-summary: Manage merge strategy policy. long-summary: """ helps['repos policy required-reviewer'] = """ type: group short-summary: Manage required reviewer policy. long-summary: """ helps['repos policy work-item-linking'] = """ type: group short-summary: Manage work item linking policy. long-summary: """ helps['repos policy case-enforcement'] = """ type: group short-summary: Manage case enforcement policy. long-summary: """ helps['repos ref'] = """ type: group short-summary: Manage Git references. long-summary: """ azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/arguments.py000066400000000000000000000233441360605530400304360ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.arguments import enum_choice_list from azure.cli.core.commands.parameters import get_enum_type, get_three_state_flag # CUSTOM CHOICE LISTS _BRANCH_MATCH_KIND_VALUES = ['prefix', 'exact'] _VOTE_VALUES = ['approve', 'approve-with-suggestions', 'reset', 'wait-for-author', 'reject'] _PR_STATUS_VALUES = ['all', 'active', 'completed', 'abandoned'] _PR_TARGET_STATUS_VALUES = ['active', 'completed', 'abandoned'] # pylint: disable=too-many-statements def load_code_arguments(self, _): with self.argument_context('repos') as context: context.argument('repository', options_list=('--repository', '-r')) context.argument('reviewers', nargs='*') with self.argument_context('repos policy') as context: context.argument('policy_configuration', options_list=('--policy-configuration', '--config'), help='Local file path for configuration file. ' + 'Please use / backslash when typing in directory path. ') context.argument('policy_id', options_list=('--policy-id', '--id'), help='ID of the policy.') context.argument('repository_id', help='Id of the repository on which to apply the policy') context.argument('branch', help='Branch on which this policy should be applied. For example: master') context.argument('branch_match_type', arg_type=get_enum_type(_BRANCH_MATCH_KIND_VALUES), help='Determines how the branch argument is used to apply a policy. ' + 'If value is \'exact\', the policy will be applied on a branch which has an ' + 'exact match on the --branch argument. ' + 'If value is \'prefix\' the policy is applied across all branch folders that ' + 'match the prefix provided by the --branch argument.') context.argument('blocking', arg_type=get_three_state_flag(), help='Whether the policy should be blocking or not') context.argument('enabled', arg_type=get_three_state_flag(), help='Whether the policy is enabled or not') context.argument('path_filter', help='Filter path(s) on which the policy is applied. ' + 'Supports absolute paths, wildcards and multiple paths separated by \';\'. ' + 'Example: /WebApp/Models/Data.cs, /WebApp/* or *.cs,' + '/WebApp/Models/Data.cs;ClientApp/Models/Data.cs') with self.argument_context('repos policy list') as context: context.argument('branch', help='Branch name to filter results by exact match of branch name. ' + 'The --repository-id parameter is required to use the branch filter. ' + 'For example: --branch master') context.argument('repository_id', help='ID of the repository to filter results by exact match of the repository ID. ' + 'For example --repository-ID e556f204-53c9-4153-9cd9-ef41a11e3345') with self.argument_context('repos policy approver-count') as context: context.argument('minimum_approver_count', help='Minimum number of approvers required. For example: 2') context.argument('creator_vote_counts', arg_type=get_three_state_flag(), help='Whether the creator\'s vote counts or not.') context.argument('allow_downvotes', arg_type=get_three_state_flag(), help='Whether to allow downvotes or not.') context.argument('reset_on_source_push', arg_type=get_three_state_flag(), help='Whether to reset source on push.') with self.argument_context('repos policy merge-strategy') as context: context.argument('use_squash_merge', arg_type=get_three_state_flag(), help='Whether to squash merge always. ' 'This option does not work for allowing other merge types.', deprecate_info=context.deprecate(redirect='--allow-squash', target='--use-squash-merge', hide=True)) context.argument('allow_squash', arg_type=get_three_state_flag(), help='Squash merge - Creates a linear history by condensing the source branch commits ' 'into a single new commit on the target branch.') context.argument('allow_rebase', arg_type=get_three_state_flag(), help='Rebase and fast-forward - Creates a linear history by replaying the source branch ' 'commits onto the target without a merge commit.') context.argument('allow_no_fast_forward', arg_type=get_three_state_flag(), help='Basic merge (no fast-forward) - Preserves nonlinear history exactly as it happened ' 'during development.') context.argument('allow_rebase_merge', arg_type=get_three_state_flag(), help='Rebase with merge commit - Creates a semi-linear history by replaying the source ' 'branch commits onto the target and then creating a merge commit.') with self.argument_context('repos policy build') as context: context.argument('build_definition_id', help='Build Definition Id.') context.argument('queue_on_source_update_only', arg_type=get_three_state_flag(), help='Queue Only on source update.') context.argument('manual_queue_only', arg_type=get_three_state_flag(), help='Whether to allow only manual queue of builds.') context.argument('display_name', help='Display name for this build policy to identify the policy. ' + 'For example: \'Manual queue policy\'') context.argument('valid_duration', help='Policy validity duration (in minutes).') with self.argument_context('repos policy file-size') as context: context.argument('maximum_git_blob_size', help='Maximum git blob size in bytes. ' + 'For example, to specify a 10byte limit, --maximum-git-blob-size 10.') context.argument('use_uncompressed_size', arg_type=get_three_state_flag(), help='Whether to use uncompressed size.') with self.argument_context('repos policy required-reviewer') as context: context.argument('required_reviewer_ids', help='Required reviewers email addresses separated by \';\'. ' + 'For example: john@contoso.com;alice@contoso.com') context.argument('message', help='Message.') with self.argument_context('repos pr') as context: context.argument('description', type=str, options_list=('--description', '-d'), nargs='*') context.argument('source_branch', options_list=('--source-branch', '-s')) context.argument('target_branch', options_list=('--target-branch', '-t')) context.argument('title', type=str) with self.argument_context('repos pr create') as context: context.argument('work_items', nargs='*') context.argument('draft', arg_type=get_three_state_flag()) context.argument('auto_complete', arg_type=get_three_state_flag()) context.argument('squash', arg_type=get_three_state_flag()) context.argument('delete_source_branch', arg_type=get_three_state_flag()) context.argument('bypass_policy', arg_type=get_three_state_flag()) context.argument('transition_work_items', arg_type=get_three_state_flag()) with self.argument_context('repos pr list') as context: context.argument('status', **enum_choice_list(_PR_STATUS_VALUES)) with self.argument_context('repos pr reviewer') as context: context.argument('reviewers', nargs='+') with self.argument_context('repos pr work-item') as context: context.argument('work_items', nargs='+') with self.argument_context('repos pr update') as context: context.argument('auto_complete', arg_type=get_three_state_flag()) context.argument('squash', arg_type=get_three_state_flag()) context.argument('delete_source_branch', arg_type=get_three_state_flag()) context.argument('bypass_policy', arg_type=get_three_state_flag()) context.argument('transition_work_items', arg_type=get_three_state_flag()) context.argument('draft', arg_type=get_three_state_flag()) context.argument('status', **enum_choice_list(_PR_TARGET_STATUS_VALUES)) with self.argument_context('repos pr policy') as context: context.argument('evaluation_id', options_list=('--evaluation-id', '-e')) with self.argument_context('repos pr set-vote') as context: context.argument('vote', **enum_choice_list(_VOTE_VALUES)) with self.argument_context('repos delete') as context: context.argument('yes', options_list=['--yes', '-y'], action='store_true', help='Do not prompt for confirmation.') with self.argument_context('repos import create') as context: context.argument('git_source_url', options_list=('--git-source-url', '--git-url')) with self.argument_context('repos ref') as context: context.argument('repository', options_list=('--repository', '-r')) context.argument('object_id', options_list=('--object-id')) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/commands.py000066400000000000000000000177251360605530400302400ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType from azext_devops.dev.common.exception_handler import azure_devops_exception_handler from ._format import (transform_pull_request_table_output, transform_pull_requests_table_output, transform_repo_table_output, transform_repos_table_output, transform_ref_table_output, transform_refs_table_output, transform_reviewers_table_output, transform_reviewer_table_output, transform_policies_table_output, transform_policy_table_output, transform_work_items_table_output, transform_repo_import_table_output, transform_repo_policy_table_output, transform_repo_policies_table_output) reposPullRequestOps = CliCommandType( operations_tmpl='azext_devops.dev.repos.pull_request#{}', exception_handler=azure_devops_exception_handler ) reposRefOps = CliCommandType( operations_tmpl='azext_devops.dev.repos.ref#{}', exception_handler=azure_devops_exception_handler ) reposRepositoryOps = CliCommandType( operations_tmpl='azext_devops.dev.repos.repository#{}', exception_handler=azure_devops_exception_handler ) reposImportOps = CliCommandType( operations_tmpl='azext_devops.dev.repos.import_request#{}', exception_handler=azure_devops_exception_handler ) policyOps = CliCommandType( operations_tmpl='azext_devops.dev.repos.policy#{}', exception_handler=azure_devops_exception_handler ) def load_code_commands(self, _): # pylint: disable=too-many-statements with self.command_group('repos', command_type=reposRepositoryOps) as g: # repository commands g.command('create', 'create_repo', table_transformer=transform_repo_table_output) g.command('delete', 'delete_repo', confirmation='Are you sure you want to delete this repository?') g.command('list', 'list_repos', table_transformer=transform_repos_table_output) g.command('show', 'show_repo', table_transformer=transform_repo_table_output) g.command('update', 'update_repo', table_transformer=transform_repo_table_output) with self.command_group('repos policy', command_type=policyOps) as g: # repository/ branch policies g.command('list', 'list_policy', table_transformer=transform_repo_policies_table_output) g.command('show', 'get_policy', table_transformer=transform_repo_policy_table_output) g.command('delete', 'delete_policy', confirmation='Are you sure you want to delete this policy?') g.command('create', 'create_policy_configuration_file', table_transformer=transform_repo_policy_table_output) g.command('update', 'update_policy_configuration_file', table_transformer=transform_repo_policy_table_output) g.command('approver-count create', 'create_policy_approver_count', table_transformer=transform_repo_policy_table_output) g.command('approver-count update', 'update_policy_approver_count', table_transformer=transform_repo_policy_table_output) g.command('merge-strategy create', 'create_policy_merge_strategy', table_transformer=transform_repo_policy_table_output) g.command('merge-strategy update', 'update_policy_merge_strategy', table_transformer=transform_repo_policy_table_output) g.command('build create', 'create_policy_build', table_transformer=transform_repo_policy_table_output) g.command('build update', 'update_policy_build', table_transformer=transform_repo_policy_table_output) g.command('comment-required create', 'create_policy_comment_required', table_transformer=transform_repo_policy_table_output) g.command('comment-required update', 'update_policy_comment_required', table_transformer=transform_repo_policy_table_output) g.command('work-item-linking create', 'create_policy_work_item_linking', table_transformer=transform_repo_policy_table_output) g.command('work-item-linking update', 'update_policy_work_item_linking', table_transformer=transform_repo_policy_table_output) g.command('file-size create', 'create_policy_file_size', table_transformer=transform_repo_policy_table_output) g.command('file-size update', 'update_policy_file_size', table_transformer=transform_repo_policy_table_output) g.command('required-reviewer create', 'create_policy_required_reviewer', table_transformer=transform_repo_policy_table_output) g.command('required-reviewer update', 'update_policy_required_reviewer', table_transformer=transform_repo_policy_table_output) g.command('case-enforcement create', 'create_policy_case_enforcement', table_transformer=transform_repo_policy_table_output) g.command('case-enforcement update', 'update_policy_case_enforcement', table_transformer=transform_repo_policy_table_output) with self.command_group('repos pr', command_type=reposPullRequestOps) as g: # basic pr commands g.command('create', 'create_pull_request', table_transformer=transform_pull_request_table_output) g.command('update', 'update_pull_request', table_transformer=transform_pull_request_table_output) g.command('show', 'show_pull_request', table_transformer=transform_pull_request_table_output) g.command('list', 'list_pull_requests', table_transformer=transform_pull_requests_table_output) g.command('checkout', 'checkout') # pr reviewer commands g.command('reviewer add', 'create_pull_request_reviewers', table_transformer=transform_reviewers_table_output) g.command('reviewer list', 'list_pull_request_reviewers', table_transformer=transform_reviewers_table_output) g.command('reviewer remove', 'delete_pull_request_reviewers', table_transformer=transform_reviewers_table_output) # pr work item commands g.command('work-item add', 'add_pull_request_work_items', table_transformer=transform_work_items_table_output) g.command('work-item list', 'list_pull_request_work_items', table_transformer=transform_work_items_table_output) g.command('work-item remove', 'remove_pull_request_work_items', table_transformer=transform_work_items_table_output) # pr set-vote commands g.command('set-vote', 'vote_pull_request', table_transformer=transform_reviewer_table_output) # pr policy commands g.command('policy list', 'list_pr_policies', table_transformer=transform_policies_table_output) g.command('policy queue', 'queue_pr_policy', table_transformer=transform_policy_table_output) with self.command_group('repos import', command_type=reposImportOps) as g: # import request g.command('create', 'create_import_request', table_transformer=transform_repo_import_table_output) with self.command_group('repos ref', command_type=reposRefOps) as g: # refs commands g.command('create', 'create_ref', table_transformer=transform_ref_table_output) g.command('delete', 'delete_ref', table_transformer=transform_ref_table_output) g.command('list', 'list_refs', table_transformer=transform_refs_table_output) g.command('lock', 'lock_ref', table_transformer=transform_ref_table_output) g.command('unlock', 'unlock_ref', table_transformer=transform_ref_table_output) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/git_alias.py000066400000000000000000000026461360605530400303670ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azext_devops.dev.common.git import is_git_alias_setup, setup_git_alias, clear_git_alias def setup_git_aliases(local=False): """Configure aliases for Git (to enable commands like 'git pr list') :param local: Sets the alias in the local git config rather than the global config. :type local: bool """ for key in git_aliases: setup_git_alias(key, git_aliases[key], local=local) def clear_git_aliases(local=False): """ :param local: Checks the alias in the local git config rather than the global config. :type local: bool """ for key in git_aliases: if is_git_alias_setup(key, git_aliases[key], local=local): clear_git_alias(alias=key, local=local) def are_git_aliases_setup(local=False): """ :param local: Checks the alias in the local git config rather than the global config. :type local: bool """ for key in git_aliases: if not is_git_alias_setup(key, git_aliases[key], local=local): return False return True git_aliases = {'pr': 'repos pr', 'repo': 'repos'} azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/import_request.py000066400000000000000000000113201360605530400315020ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import time from knack.prompting import prompt_pass from azext_devops.devops_sdk.v5_0.service_endpoint.models import ServiceEndpoint, EndpointAuthorization from azext_devops.devops_sdk.v5_0.git.models import GitImportRequestParameters from azext_devops.devops_sdk.v5_0.git.models import GitImportGitSource from azext_devops.devops_sdk.v5_0.git.models import GitImportRequest from azext_devops.dev.common.services import (get_git_client, resolve_instance_project_and_repo, get_service_endpoint_client) from azext_devops.dev.common.const import GIT_SOURCE_PASSWORD_OR_PAT from azext_devops.dev.common.prompting import verify_is_a_tty_or_raise_error def create_import_request(git_source_url, project=None, repository=None, requires_authorization=False, user_name=None, git_service_endpoint_id=None, organization=None, detect=None): """Create a git import request (currently only supports import from public git source) :param repository: Name or ID of the repository to create the import request in. :type repository: str :param git_source_url: Url of the source git repository. :type git_source_url: str :param requires_authorization: Flag to tell if source git repository is private. :type requires_authorization: bool :param user_name: User name in case source git repository is private. :type user_name: str :param git_service_endpoint_id: Service Endpoint for connection to external endpoint. :type git_service_endpoint_id: str """ organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, repo=repository, repo_required=True) delete_se_after_import = False password = None import random import string import os if requires_authorization and git_service_endpoint_id is None: delete_se_after_import = True if GIT_SOURCE_PASSWORD_OR_PAT in os.environ: password = os.environ[GIT_SOURCE_PASSWORD_OR_PAT] else: error_message = 'Please specify target git password / PAT in ' + GIT_SOURCE_PASSWORD_OR_PAT +\ ' environment variable in non-interactive mode.' verify_is_a_tty_or_raise_error(error_message) password = prompt_pass('Git Password / PAT:', confirm=True) service_endpoint_authorization = EndpointAuthorization( parameters={'password': password, 'username': user_name}, scheme='UsernamePassword') service_endpoint_to_create = ServiceEndpoint( authorization=service_endpoint_authorization, name=''.join(random.choice(string.ascii_uppercase + string.digits) for _ in range(10)), type='git', url=git_source_url) client = get_service_endpoint_client(organization) se_created = client.create_service_endpoint(service_endpoint_to_create, project) git_service_endpoint_id = se_created.id client = get_git_client(organization) gitImportGitSource = GitImportGitSource(overwrite=False, url=git_source_url) gitImportRequestParameter = GitImportRequestParameters( delete_service_endpoint_after_import_is_done=delete_se_after_import, git_source=gitImportGitSource, service_endpoint_id=git_service_endpoint_id, tfvc_source=None) gitImportRequest = GitImportRequest(parameters=gitImportRequestParameter) importRequest = client.create_import_request(import_request=gitImportRequest, project=project, repository_id=repository) return _wait_for_import_request(client, project, repository, importRequest.import_request_id) def _wait_for_import_request(client, project, repository, import_request_id, interval_seconds=5): import_request = client.get_import_request(project, repository, import_request_id) while not _has_import_request_completed(import_request): time.sleep(interval_seconds) import_request = client.get_import_request(project, repository, import_request_id) return import_request def _has_import_request_completed(import_request): status = import_request.status.lower() return status in ('completed', 'failed', 'abandoned') azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/policy.py000066400000000000000000000754471360605530400277430ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # pylint: disable=line-too-long # This file a lot of these are intentional because that makes grouping variables easy from knack.util import CLIError from knack.log import get_logger from azext_devops.devops_sdk.v5_0.policy.models import PolicyConfiguration from azext_devops.dev.common.git import resolve_git_ref_heads from azext_devops.dev.common.services import (get_policy_client, resolve_instance_and_project) from azext_devops.dev.common.identities import resolve_identity_as_id logger = get_logger(__name__) def list_policy(organization=None, project=None, repository_id=None, branch=None, detect=None): """List all policies in a project. :param repository_id: Id of the repository. :type repository_id: string :param branch: Branch. (--repository-id is required) :type branch: string :rtype: [PolicyConfiguration] """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) if branch is not None and repository_id is None: raise CLIError('--repository-id is required with --branch') scope = None if repository_id is not None: repository_id = repository_id.replace('-', '') scope = repository_id if branch is not None: branch = resolve_git_ref_heads(branch) scope = scope + ':' + branch policy_client = get_policy_client(organization) return policy_client.get_policy_configurations(project=project, scope=scope) def get_policy(policy_id, organization=None, project=None, detect=None): """Show policy details. """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) return policy_client.get_policy_configuration(project=project, configuration_id=policy_id) def delete_policy(policy_id, organization=None, project=None, detect=None): """Delete a policy. """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) return policy_client.delete_policy_configuration(project=project, configuration_id=policy_id) def create_policy_configuration_file(policy_configuration, organization=None, project=None, detect=None): '''Create a policy using a configuration file. Recommended when creating policies using multiple scopes for a policy. See https://aka.ms/azure-devops-cli-docs-policy-file for more information. ''' organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) with open(policy_configuration) as f: import json configuration = json.load(f) return policy_client.create_policy_configuration(configuration=configuration, project=project) def update_policy_configuration_file(policy_id, policy_configuration, organization=None, project=None, detect=None): """Update a policy using a configuration file. Recommended when creating policies using multiple scopes for a policy. See https://aka.ms/azure-devops-cli-docs-policy-file for more information. """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) with open(policy_configuration) as f: import json configuration = json.load(f) return policy_client.update_policy_configuration( configuration=configuration, project=project, configuration_id=policy_id) def create_policy_approver_count(repository_id, branch, blocking, enabled, minimum_approver_count, creator_vote_counts, allow_downvotes, reset_on_source_push, branch_match_type='exact', organization=None, project=None, detect=None): """Create approver count policy """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) param_name_array = ['minimumApproverCount', 'creatorVoteCounts', 'allowDownvotes', 'resetOnSourcePush'] param_value_array = [minimum_approver_count, creator_vote_counts, allow_downvotes, reset_on_source_push] configuration = create_configuration_object(repository_id, branch, blocking, enabled, 'fa4e907d-c16b-4a4c-9dfa-4906e5d171dd', param_name_array, param_value_array, branch_match_type) return policy_client.create_policy_configuration(configuration=configuration, project=project) def update_policy_approver_count(policy_id, repository_id=None, branch=None, blocking=None, enabled=None, branch_match_type=None, minimum_approver_count=None, creator_vote_counts=None, allow_downvotes=None, reset_on_source_push=None, organization=None, project=None, detect=None): """Update approver count policy """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) current_policy = policy_client.get_policy_configuration(project=project, configuration_id=policy_id) param_name_array = ['minimumApproverCount', 'creatorVoteCounts', 'allowDownvotes', 'resetOnSourcePush'] current_setting = current_policy.settings current_scope = current_policy.settings['scope'][0] param_value_array = [ minimum_approver_count if minimum_approver_count is not None else current_setting.get('minimumApproverCount', None), creator_vote_counts if creator_vote_counts is not None else current_setting.get('creatorVoteCounts', None), allow_downvotes if allow_downvotes is not None else current_setting.get('allowDownvotes', None), reset_on_source_push if reset_on_source_push is not None else current_setting.get('resetOnSourcePush', None) ] updated_configuration = create_configuration_object( repository_id or current_scope['repositoryId'], branch or current_scope['refName'], blocking if blocking is not None else current_policy.is_blocking, enabled if enabled is not None else current_policy.is_enabled, 'fa4e907d-c16b-4a4c-9dfa-4906e5d171dd', param_name_array, param_value_array, branch_match_type or current_scope['matchKind'] ) return policy_client.update_policy_configuration( configuration=updated_configuration, project=project, configuration_id=policy_id ) def create_policy_required_reviewer(repository_id, branch, blocking, enabled, message, required_reviewer_ids, branch_match_type='exact', path_filter=None, organization=None, project=None, detect=None): """Create required reviewer policy """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) requiredReviewerIds = resolveIdentityMailsToIds(required_reviewer_ids, organization) policy_client = get_policy_client(organization) param_name_array = ['requiredReviewerIds', 'message', 'filenamePatterns'] param_value_array = [requiredReviewerIds, message, createFileNamePatterns(path_filter)] configuration = create_configuration_object(repository_id, branch, blocking, enabled, 'fd2167ab-b0be-447a-8ec8-39368250530e', param_name_array, param_value_array, branch_match_type) return policy_client.create_policy_configuration(configuration=configuration, project=project) def update_policy_required_reviewer(policy_id, repository_id=None, branch=None, branch_match_type=None, blocking=None, enabled=None, message=None, required_reviewer_ids=None, path_filter=None, organization=None, project=None, detect=None): """Update required reviewer policy """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) current_policy = policy_client.get_policy_configuration(project=project, configuration_id=policy_id) param_name_array = ['requiredReviewerIds', 'message', 'filenamePatterns'] requiredReviewerIds = resolveIdentityMailsToIds(required_reviewer_ids, organization) current_setting = current_policy.settings current_scope = current_policy.settings['scope'][0] param_value_array = [ requiredReviewerIds or current_setting.get('requiredReviewerIds', None), message or current_setting.get('message', None), createFileNamePatterns(path_filter) or current_setting.get('filenamePatterns', None) ] updated_configuration = create_configuration_object( repository_id or current_scope['repositoryId'], branch or current_scope['refName'], blocking if blocking is not None else current_policy.is_blocking, enabled if enabled is not None else current_policy.is_enabled, 'fd2167ab-b0be-447a-8ec8-39368250530e', param_name_array, param_value_array, branch_match_type or current_scope['matchKind'] ) return policy_client.update_policy_configuration( configuration=updated_configuration, project=project, configuration_id=policy_id ) _MERGE_POLICY_DEPRECATED_OPTION_ERROR = '--use-squash-merge has been deprecated to align with the new merge '\ 'strategies in Azure Repos. Use --allow-squash instead. Refer '\ 'https://aka.ms/merge-types for more information.' def create_policy_merge_strategy(repository_id, branch, blocking, enabled, use_squash_merge=None, allow_squash=None, allow_rebase=None, allow_rebase_merge=None, allow_no_fast_forward=None, branch_match_type='exact', organization=None, project=None, detect=None): """Create merge strategy policy """ if (use_squash_merge is None and not allow_squash and not allow_rebase_merge and not allow_rebase and not allow_no_fast_forward): raise CLIError("Atleast one merge type must be enabled.") organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) if use_squash_merge is None: param_name_array = ['allowSquash', 'allowRebase', 'allowRebaseMerge', 'allowNoFastForward'] param_value_array = [allow_squash, allow_rebase, allow_rebase_merge, allow_no_fast_forward] for i, value in enumerate(param_value_array): if value is None: param_value_array[i] = False else: if allow_rebase or allow_no_fast_forward or allow_rebase_merge or allow_squash: raise CLIError(_MERGE_POLICY_DEPRECATED_OPTION_ERROR) param_name_array = ['useSquashMerge'] param_value_array = [use_squash_merge] configuration = create_configuration_object(repository_id, branch, blocking, enabled, 'fa4e907d-c16b-4a4c-9dfa-4916e5d171ab', param_name_array, param_value_array, branch_match_type) return policy_client.create_policy_configuration(configuration=configuration, project=project) def update_policy_merge_strategy(policy_id, repository_id=None, branch=None, branch_match_type=None, blocking=None, enabled=None, use_squash_merge=None, allow_squash=None, allow_rebase=None, allow_rebase_merge=None, allow_no_fast_forward=None, organization=None, project=None, detect=None): """Update merge strategy policy """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) current_policy = policy_client.get_policy_configuration(project=project, configuration_id=policy_id) current_setting = current_policy.settings current_scope = current_policy.settings['scope'][0] current_setting_new_merge_values_array = [ current_setting.get('allowSquash', None), current_setting.get('allowRebase', None), current_setting.get('allowRebaseMerge', None), current_setting.get('allowNoFastForward', None)] is_new_merge_type_update = ( allow_squash is not None or allow_no_fast_forward is not None or allow_rebase is not None or allow_rebase_merge is not None) if is_new_merge_type_update: if use_squash_merge is not None: raise CLIError(_MERGE_POLICY_DEPRECATED_OPTION_ERROR) # Update is trying to set some new merge type (this should consider useSquashMerge as deprecated) param_name_array = ['allowSquash', 'allowRebase', 'allowRebaseMerge', 'allowNoFastForward'] param_value_array = [ allow_squash if allow_squash is not None else current_setting.get( 'allowSquash', current_setting.get('useSquashMerge', None)), allow_rebase if allow_rebase is not None else current_setting.get('allowRebase', None), allow_rebase_merge if allow_rebase_merge is not None else current_setting.get('allowRebaseMerge', None), allow_no_fast_forward if allow_no_fast_forward is not None else current_setting.get( 'allowNoFastForward', None) ] # We cannot send setting as None in the API for i, value in enumerate(param_value_array): if value is None: param_value_array[i] = False # API does not fail but the update is rejected if the last setting is being set to false. # So this check prevents it from client side. if not [i for i, value in enumerate(param_value_array) if value]: raise CLIError("Atleast one merge type must be enabled.") # Update is trying to set legacy option elif use_squash_merge is not None: # Moving from non legacy to legacy - NOT ALLOWED if [i for i, value in enumerate(current_setting_new_merge_values_array) if value is not None]: raise CLIError(_MERGE_POLICY_DEPRECATED_OPTION_ERROR) # Changing from legacy to legacy param_name_array = ['useSquashMerge'] param_value_array = [use_squash_merge] # No update to merge types only other options are getting updated else: # Current setting is new values type if [i for i, value in enumerate(current_setting_new_merge_values_array) if value is not None]: param_name_array = ['allowSquash', 'allowRebase', 'allowRebaseMerge', 'allowNoFastForward'] param_value_array = current_setting_new_merge_values_array # We cannot send setting as None in the API for i, value in enumerate(param_value_array): if value is None: param_value_array[i] = False # Current setting is legacy option else: param_name_array = ['useSquashMerge'] param_value_array = [current_setting.get('useSquashMerge', False)] updated_configuration = create_configuration_object( repository_id or current_scope['repositoryId'], branch or current_scope['refName'], blocking if blocking is not None else current_policy.is_blocking, enabled if enabled is not None else current_policy.is_enabled, 'fa4e907d-c16b-4a4c-9dfa-4916e5d171ab', param_name_array, param_value_array, branch_match_type or current_scope['matchKind'] ) return policy_client.update_policy_configuration( configuration=updated_configuration, project=project, configuration_id=policy_id ) def create_policy_build(repository_id, branch, blocking, enabled, build_definition_id, queue_on_source_update_only, manual_queue_only, display_name, valid_duration, path_filter=None, branch_match_type='exact', organization=None, project=None, detect=None): """Create build policy """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) param_name_array = [ 'buildDefinitionId', 'queueOnSourceUpdateOnly', 'manualQueueOnly', 'displayName', 'validDuration', 'filenamePatterns'] param_value_array = [ build_definition_id, queue_on_source_update_only, manual_queue_only, display_name, valid_duration, createFileNamePatterns(path_filter)] configuration = create_configuration_object(repository_id, branch, blocking, enabled, '0609b952-1397-4640-95ec-e00a01b2c241', param_name_array, param_value_array, branch_match_type) return policy_client.create_policy_configuration(configuration=configuration, project=project) def update_policy_build(policy_id, repository_id=None, branch=None, branch_match_type=None, blocking=None, enabled=None, build_definition_id=None, queue_on_source_update_only=None, manual_queue_only=None, display_name=None, valid_duration=None, path_filter=None, organization=None, project=None, detect=None): """Update build policy """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) current_policy = policy_client.get_policy_configuration(project=project, configuration_id=policy_id) param_name_array = [ 'buildDefinitionId', 'queueOnSourceUpdateOnly', 'manualQueueOnly', 'displayName', 'validDuration', 'filenamePatterns'] current_setting = current_policy.settings current_scope = current_policy.settings['scope'][0] param_value_array = [ build_definition_id or current_setting.get('buildDefinitionId', None), queue_on_source_update_only if queue_on_source_update_only is not None else current_setting.get('queueOnSourceUpdateOnly', None), manual_queue_only if manual_queue_only is not None else current_setting.get('manualQueueOnly', None), display_name or current_setting.get('displayName', None), valid_duration or current_setting.get('validDuration', None), createFileNamePatterns(path_filter) or current_setting.get('filenamePatterns', None) ] updated_configuration = create_configuration_object( repository_id or current_scope['repositoryId'], branch or current_scope['refName'], blocking if blocking is not None else current_policy.is_blocking, enabled if enabled is not None else current_policy.is_enabled, '0609b952-1397-4640-95ec-e00a01b2c241', param_name_array, param_value_array, branch_match_type or current_scope['matchKind'] ) return policy_client.update_policy_configuration( configuration=updated_configuration, project=project, configuration_id=policy_id ) def create_policy_file_size(repository_id, blocking, enabled, maximum_git_blob_size, use_uncompressed_size, organization=None, project=None, detect=None): """Create file size policy """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) param_name_array = ['maximumGitBlobSizeInBytes', 'useUncompressedSize'] param_value_array = [maximum_git_blob_size, use_uncompressed_size] configuration = create_configuration_object(repository_id, None, blocking, enabled, '2e26e725-8201-4edd-8bf5-978563c34a80', param_name_array, param_value_array) return policy_client.create_policy_configuration(configuration=configuration, project=project) def update_policy_file_size(policy_id, repository_id=None, blocking=None, enabled=None, maximum_git_blob_size=None, use_uncompressed_size=None, organization=None, project=None, detect=None): """Update file size policy """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) current_policy = policy_client.get_policy_configuration(project=project, configuration_id=policy_id) param_name_array = ['maximumGitBlobSizeInBytes', 'useUncompressedSize'] current_setting = current_policy.settings current_scope = current_policy.settings['scope'][0] param_value_array = [ maximum_git_blob_size or current_setting.get('maximumGitBlobSizeInBytes', None), use_uncompressed_size if use_uncompressed_size is not None else current_setting.get('useUncompressedSize', None) ] updated_configuration = create_configuration_object( repository_id or current_scope['repositoryId'], None, blocking if blocking is not None else current_policy.is_blocking, enabled if enabled is not None else current_policy.is_enabled, '2e26e725-8201-4edd-8bf5-978563c34a80', param_name_array, param_value_array ) return policy_client.update_policy_configuration( configuration=updated_configuration, project=project, configuration_id=policy_id ) def create_policy_comment_required(repository_id, branch, blocking, enabled, branch_match_type='exact', organization=None, project=None, detect=None): """Create comment resolution required policy. """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) configuration = create_configuration_object(repository_id, branch, blocking, enabled, 'c6a1889d-b943-4856-b76f-9e46bb6b0df2', [], [], branch_match_type) return policy_client.create_policy_configuration(configuration=configuration, project=project) def update_policy_comment_required(policy_id, repository_id=None, branch=None, branch_match_type=None, blocking=None, enabled=None, organization=None, project=None, detect=None): """Update comment resolution required policy. """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) current_policy = policy_client.get_policy_configuration(project=project, configuration_id=policy_id) current_scope = current_policy.settings['scope'][0] updated_configuration = create_configuration_object( repository_id or current_scope['repositoryId'], branch or current_scope['refName'], blocking if blocking is not None else current_policy.is_blocking, enabled if enabled is not None else current_policy.is_enabled, 'c6a1889d-b943-4856-b76f-9e46bb6b0df2', [], [], branch_match_type or current_scope['matchKind'] ) return policy_client.update_policy_configuration( configuration=updated_configuration, project=project, configuration_id=policy_id ) def create_policy_work_item_linking(repository_id, branch, blocking, enabled, branch_match_type='exact', organization=None, project=None, detect=None): """Create work item linking policy. """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) configuration = create_configuration_object(repository_id, branch, blocking, enabled, '40e92b44-2fe1-4dd6-b3d8-74a9c21d0c6e', [], [], branch_match_type) return policy_client.create_policy_configuration(configuration=configuration, project=project) def update_policy_work_item_linking(policy_id, repository_id=None, branch=None, branch_match_type=None, blocking=None, enabled=None, organization=None, project=None, detect=None): """Update work item linking policy. """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) current_policy = policy_client.get_policy_configuration(project=project, configuration_id=policy_id) current_scope = current_policy.settings['scope'][0] updated_configuration = create_configuration_object( repository_id or current_scope['repositoryId'], branch or current_scope['refName'], blocking if blocking is not None else current_policy.is_blocking, enabled if enabled is not None else current_policy.is_enabled, '40e92b44-2fe1-4dd6-b3d8-74a9c21d0c6e', [], [], branch_match_type or current_scope['matchKind'] ) return policy_client.update_policy_configuration( configuration=updated_configuration, project=project, configuration_id=policy_id ) def create_policy_case_enforcement(repository_id, blocking, enabled, organization=None, project=None, detect=None): """Create case enforcement policy. """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) configuration = create_configuration_object(repository_id, None, blocking, enabled, '40e92b44-2fe1-4dd6-b3d8-74a9c21d0c6e', ['enforceConsistentCase'], ['true']) return policy_client.create_policy_configuration(configuration=configuration, project=project) def update_policy_case_enforcement(policy_id, repository_id=None, blocking=None, enabled=None, organization=None, project=None, detect=None): """Update case enforcement policy. """ organization, project = resolve_instance_and_project( detect=detect, organization=organization, project=project) policy_client = get_policy_client(organization) current_policy = policy_client.get_policy_configuration(project=project, configuration_id=policy_id) current_scope = current_policy.settings['scope'][0] updated_configuration = create_configuration_object( repository_id or current_scope['repositoryId'], None, blocking if blocking is not None else current_policy.is_blocking, enabled if enabled is not None else current_policy.is_enabled, '40e92b44-2fe1-4dd6-b3d8-74a9c21d0c6e', ['enforceConsistentCase'], ['true'] ) return policy_client.update_policy_configuration( configuration=updated_configuration, project=project, configuration_id=policy_id ) def create_configuration_object(repository_id, branch, blocking, enabled, policy_type_id, param_name_array, param_value_array, branch_match_type='exact'): branch = resolve_git_ref_heads(branch) policyConfiguration = PolicyConfiguration(is_blocking=blocking, is_enabled=enabled) scope = createScope(repository_id, branch, branch_match_type) policyConfiguration.settings = { 'scope': scope } policyConfiguration.type = { 'id': policy_type_id } index = 0 for param in param_name_array: policyConfiguration.settings[param] = param_value_array[index] index = index + 1 return policyConfiguration def createFileNamePatterns(filePatterns): if filePatterns is None: return [] return filePatterns.split(';') def createScope(repository_id, branch, branch_match_type): scope = [ { 'repositoryId': repository_id, 'refName': branch, 'matchKind': branch_match_type } ] if branch is None: scope = [ { 'repositoryId': repository_id, } ] return scope def resolveIdentityMailsToIds(mailList, organization): if mailList is None: return [] logger.debug('mail list %s ', mailList) if not mailList or (not mailList.strip()): return None idList = [] for mail in mailList.split(';'): mailStripped = mail.strip() logger.debug('trying to resolve %s', mailStripped) identityId = resolve_identity_as_id(mailStripped, organization) logger.debug('got id as %s', identityId) idList.append(identityId) return idList azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/pull_request.py000066400000000000000000000766501360605530400311650ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import webbrowser from knack.log import get_logger from knack.util import CLIError from azext_devops.devops_sdk.exceptions import AzureDevOpsClientRequestError from azext_devops.devops_sdk.v5_0.git.models import (GitPullRequest, GitPullRequestCompletionOptions, GitPullRequestSearchCriteria, IdentityRef, IdentityRefWithVote, ResourceRef, GitRefFavorite) from azext_devops.devops_sdk.v5_0.work_item_tracking.models import JsonPatchOperation, WorkItemRelation from azext_devops.dev.common.arguments import should_detect from azext_devops.dev.common.git import get_current_branch_name, resolve_git_ref_heads, fetch_remote_and_checkout from azext_devops.dev.common.identities import ME, resolve_identity_as_id from azext_devops.dev.common.uri import uri_quote from azext_devops.dev.common.uuid import EMPTY_UUID from azext_devops.dev.common.services import (get_git_client, get_policy_client, get_work_item_tracking_client, resolve_instance, resolve_instance_project_and_repo, get_vsts_info_from_current_remote_url) logger = get_logger(__name__) def show_pull_request(id, open=False, organization=None, detect=None): # pylint: disable=redefined-builtin """Get the details of a pull request. :param id: ID of the pull request. :type id: int :param open: Open the pull request in your web browser. :type open: bool :rtype: :class:`GitPullRequest ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_git_client(organization) pr = client.get_pull_request_by_id(id) pr = client.get_pull_request(project=pr.repository.project.id, repository_id=pr.repository.id, pull_request_id=id, include_commits=False, include_work_item_refs=True) if open: _open_pull_request(pr, organization) return pr def list_pull_requests(repository=None, creator=None, include_links=False, reviewer=None, source_branch=None, status=None, target_branch=None, project=None, skip=None, top=None, organization=None, detect=None): """List pull requests. :param repository: Name or ID of the repository. :type repository: str :param creator: Limit results to pull requests created by this user. :type creator: str :param include_links: Include _links for each pull request. :type include_links: bool :param reviewer: Limit results to pull requests where this user is a reviewer. :type reviewer: str :param source_branch: Limit results to pull requests that originate from this source branch. :type source_branch: str :param status: Limit results to pull requests with this status. :type status: str :param target_branch: Limit results to pull requests that target this branch. :type target_branch: str :param skip: Number of pull requests to skip. :type skip: int :param top: Maximum number of pull requests to list. :type top: int :rtype: list of :class:`VssJsonCollectionWrapper ` """ organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, repo=repository) search_criteria = GitPullRequestSearchCriteria( creator_id=resolve_identity_as_id(creator, organization), include_links=include_links, reviewer_id=resolve_identity_as_id(reviewer, organization), source_ref_name=resolve_git_ref_heads(source_branch), status=status, target_ref_name=resolve_git_ref_heads(target_branch)) client = get_git_client(organization) if repository is None: pr_list = client.get_pull_requests_by_project(project=project, search_criteria=search_criteria, skip=skip, top=top) else: pr_list = client.get_pull_requests(project=project, repository_id=repository, search_criteria=search_criteria, skip=skip, top=top) return pr_list # pylint: disable=too-many-locals def create_pull_request(project=None, repository=None, source_branch=None, target_branch=None, title=None, description=None, auto_complete=False, squash=False, delete_source_branch=False, bypass_policy=False, bypass_policy_reason=None, merge_commit_message=None, reviewers=None, work_items=None, draft=None, open=False, organization=None, detect=None, transition_work_items=False): # pylint: disable=redefined-builtin """Create a pull request. :param project: Name or ID of the team project. :type project: str :param repository: Name or ID of the repository to create the pull request in. :type repository: str :param source_branch: Name of the source branch. Example: "dev". :type source_branch: str :param target_branch: Name of the target branch. If not specified, defaults to the default branch of the target repository. :type target_branch: str :param title: Title for the new pull request. :type title: str :param draft: Use this flag to create the pull request in draft/work in progress mode. :type draft: bool :param description: Description for the new pull request. Can include markdown. Each value sent to this arg will be a new line. For example: --description "First Line" "Second Line" :type description: list of str :param auto_complete: Set the pull request to complete automatically when all policies have passed and the source branch can be merged into the target branch. :type auto_complete: bool :param squash: Squash the commits in the source branch when merging into the target branch. :type squash: bool :param delete_source_branch: Delete the source branch after the pull request has been completed and merged into the target branch. :type delete_source_branch: bool :param bypass_policy: Bypass required policies (if any) and completes the pull request once it can be merged. :type bypass_policy: bool :param bypass_policy_reason: Reason for bypassing the required policies. :type bypass_policy_reason: str :param merge_commit_message: Message displayed when commits are merged. :type merge_commit_message: str :param reviewers: Additional users or groups to include as reviewers on the new pull request. Space separated. :type reviewers: list of str :param work_items: IDs of the work items to link to the new pull request. Space separated. :type work_items: list of str :param open: Open the pull request in your web browser. :type open: bool :param transition_work_items: Transition any work items linked to the pull request into the next logical state. (e.g. Active -> Resolved) :type transition_work_items: bool :rtype: :class:`GitPullRequest ` """ organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, repo=repository) source_branch, target_branch = _get_branches_for_pull_request( organization, project, repository, source_branch, target_branch, detect) client = get_git_client(organization) multi_line_description = None if description is not None: multi_line_description = '\n'.join(description) pr = GitPullRequest(description=multi_line_description, source_ref_name=source_branch, target_ref_name=target_branch) if draft is not None: pr.is_draft = draft if title is not None: pr.title = title else: pr.title = 'Merge ' + source_branch + ' to ' + target_branch pr.source_ref_name = resolve_git_ref_heads(source_branch) pr.target_ref_name = resolve_git_ref_heads(target_branch) if pr.source_ref_name == pr.target_ref_name: raise CLIError('The source branch, "{}", can not be the same as the target branch.'.format (pr.source_ref_name)) pr.reviewers = _resolve_reviewers_as_refs(reviewers, organization) if work_items is not None and work_items: resolved_work_items = [] for work_item in work_items: resolved_work_items.append(ResourceRef(id=work_item)) pr.work_item_refs = resolved_work_items pr = client.create_pull_request(git_pull_request_to_create=pr, project=project, repository_id=repository) title_from_commit = None if title is None: # if title wasn't specified and only one commit, we will set the PR title to the comment of that commit commits = client.get_pull_request_commits(repository_id=repository, pull_request_id=pr.pull_request_id, project=project) if len(commits) == 1: title_from_commit = commits[0].comment set_completion_options = (bypass_policy or bypass_policy_reason is not None or squash or merge_commit_message is not None or delete_source_branch or transition_work_items) if auto_complete or set_completion_options or title_from_commit is not None: pr_for_update = GitPullRequest() if auto_complete: # auto-complete will not get set on create, so a subsequent update is required. pr_for_update.auto_complete_set_by = IdentityRef(id=resolve_identity_as_id(ME, organization)) if set_completion_options: completion_options = GitPullRequestCompletionOptions() completion_options.bypass_policy = bypass_policy completion_options.bypass_reason = bypass_policy_reason completion_options.delete_source_branch = delete_source_branch completion_options.squash_merge = squash completion_options.merge_commit_message = merge_commit_message completion_options.transition_work_items = transition_work_items pr_for_update.completion_options = completion_options if title_from_commit is not None: pr_for_update.title = title_from_commit pr = client.update_pull_request(git_pull_request_to_update=pr_for_update, project=pr.repository.project.id, repository_id=pr.repository.id, pull_request_id=pr.pull_request_id) if open: _open_pull_request(pr, organization) return pr def _get_branches_for_pull_request(organization, project, repository, source_branch, target_branch, detect): if should_detect(detect): if source_branch is None: source_branch = get_current_branch_name() if source_branch is None: raise ValueError('The source branch could not be detected,' 'please provide the --source-branch argument.') else: if source_branch is None: raise ValueError('--source-branch is a required argument.') if target_branch is None: if project is not None and repository is not None: target_branch = _get_default_branch(organization, project, repository) if target_branch is None: raise ValueError('The target branch could not be detected,' 'please provide the --target-branch argument.') return source_branch, target_branch def update_pull_request(id, title=None, description=None, auto_complete=None, # pylint: disable=redefined-builtin squash=None, delete_source_branch=None, bypass_policy=None, draft=None, bypass_policy_reason=None, merge_commit_message=None, organization=None, detect=None, transition_work_items=None, status=None): """Update a pull request. :param id: ID of the pull request. :type id: int :param title: New title for the pull request. :type title: str :param description: New description for the pull request. Can include markdown. Each value sent to this arg will be a new line. For example: --description "First Line" "Second Line" :type description: list of str :param auto_complete: Set the pull request to complete automatically when all policies have passed and the source branch can be merged into the target branch. :type auto_complete: bool :param squash: Squash the commits in the source branch when merging into the target branch. :type squash: bool :param delete_source_branch: Delete the source branch after the pull request has been completed and merged into the target branch. :type delete_source_branch: bool :param bypass_policy: Bypass required policies (if any) and completes the pull request once it can be merged. :type bypass_policy: bool :param bypass_policy_reason: Reason for bypassing the required policies. :type bypass_policy_reason: str :param draft: Publish the PR or convert to draft mode. :type draft: bool :param merge_commit_message: Message displayed when commits are merged. :type merge_commit_message: str :param transition_work_items: Transition any work items linked to the pull request into the next logical state. (e.g. Active -> Resolved) :type transition_work_items: bool :param status: Set the new state of pull request. :type status: str :rtype: :class:`GitPullRequest ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_git_client(organization) existing_pr = client.get_pull_request_by_id(id) if description is not None: multi_line_description = '\n'.join(description) else: multi_line_description = None pr = GitPullRequest(title=title, description=multi_line_description) if (bypass_policy is not None or # pylint: disable=too-many-boolean-expressions bypass_policy_reason is not None or squash is not None or merge_commit_message is not None or delete_source_branch is not None or transition_work_items is not None): completion_options = existing_pr.completion_options if completion_options is None: completion_options = GitPullRequestCompletionOptions() if bypass_policy is not None: completion_options.bypass_policy = bypass_policy if bypass_policy_reason is not None: completion_options.bypass_reason = bypass_policy_reason if delete_source_branch is not None: completion_options.delete_source_branch = delete_source_branch if squash is not None: completion_options.squash_merge = squash if merge_commit_message is not None: completion_options.merge_commit_message = merge_commit_message if transition_work_items is not None: completion_options.transition_work_items = transition_work_items pr.completion_options = completion_options if auto_complete is not None: if auto_complete: pr.auto_complete_set_by = IdentityRef(id=resolve_identity_as_id(ME, organization)) else: pr.auto_complete_set_by = IdentityRef(id=EMPTY_UUID) if draft is not None: pr.is_draft = draft if status is not None: pr.status = status if status == 'completed': pr.last_merge_source_commit = existing_pr.last_merge_source_commit if not pr.completion_options: pr.completion_options = existing_pr.completion_options pr = client.update_pull_request(git_pull_request_to_update=pr, project=existing_pr.repository.project.name, repository_id=existing_pr.repository.name, pull_request_id=id) return pr def create_pull_request_reviewers(id, reviewers, organization=None, detect=None): # pylint: disable=redefined-builtin """Add one or more reviewers to a pull request. :param id: ID of the pull request. :type id: int :param reviewers: Users or groups to include as reviewers on a pull request. Space separated. :type reviewers: list of str :rtype: list of :class:`IdentityRefWithVote ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_git_client(organization) pr = client.get_pull_request_by_id(id) resolved_reviewers = _resolve_reviewers_as_refs(reviewers, organization) identities = client.create_pull_request_reviewers(reviewers=resolved_reviewers, project=pr.repository.project.id, repository_id=pr.repository.id, pull_request_id=id) return identities def delete_pull_request_reviewers(id, reviewers, organization=None, detect=None): # pylint: disable=redefined-builtin """Remove one or more reviewers from a pull request. :param id: ID of the pull request. :type id: int :param reviewers: Users or groups to remove as reviewers on a pull request. Space separated. :type reviewers: list of str :rtype: list of :class:`IdentityRefWithVote ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_git_client(organization) pr = client.get_pull_request_by_id(id) resolved_reviewers = _resolve_reviewers_as_ids(reviewers, organization) for reviewer in resolved_reviewers: client.delete_pull_request_reviewer(project=pr.repository.project.id, repository_id=pr.repository.id, pull_request_id=id, reviewer_id=reviewer) return client.get_pull_request_reviewers(project=pr.repository.project.id, repository_id=pr.repository.id, pull_request_id=id) def list_pull_request_reviewers(id, organization=None, detect=None): # pylint: disable=redefined-builtin """List reviewers of a pull request. :param id: ID of the pull request. :type id: int :rtype: list of :class:`IdentityRefWithVote ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_git_client(organization) pr = client.get_pull_request_by_id(id) return client.get_pull_request_reviewers(project=pr.repository.project.id, repository_id=pr.repository.id, pull_request_id=id) def add_pull_request_work_items(id, work_items, organization=None, detect=None): # pylint: disable=redefined-builtin """Link one or more work items to a pull request. :param id: ID of the pull request. :type id: int :param work_items: IDs of the work items to link. Space separated. :type work_items: list of int :rtype: list of :class:`AssociatedWorkItem ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_git_client(organization) existing_pr = client.get_pull_request_by_id(id) if work_items is not None and work_items: work_items = list(set(work_items)) # make distinct wit_client = get_work_item_tracking_client(organization) pr_url = 'vstfs:///Git/PullRequestId/{project}%2F{repo}%2F{id}'.format( project=existing_pr.repository.project.id, repo=existing_pr.repository.id, id=id) for work_item_id in work_items: patch_document = [] patch_operation = JsonPatchOperation() patch_operation.op = 0 patch_operation.path = '/relations/-' patch_operation.value = WorkItemRelation() patch_operation.value.attributes = {'name': 'Pull Request'} patch_operation.value.rel = 'ArtifactLink' patch_operation.value.url = pr_url patch_document.append(patch_operation) try: wit_client.update_work_item(document=patch_document, id=work_item_id) except AzureDevOpsClientRequestError as ex: logger.debug(ex, exc_info=True) message = ex.args[0] if message != 'Relation already exists.': raise CLIError(ex) refs = client.get_pull_request_work_item_refs(project=existing_pr.repository.project.id, repository_id=existing_pr.repository.id, pull_request_id=id) ids = [] for ref in refs: ids.append(ref.id) return wit_client.get_work_items(ids=ids) def checkout(id, remote_name='origin'): # pylint: disable=redefined-builtin """Checkout the PR source branch locally, if no local changes are present :param id: ID of the pull request. :type id: int :param remote_name: Name of git remote against which PR is raised :type remote_name: str """ git_info = get_vsts_info_from_current_remote_url() organization = git_info.uri if not organization: raise CLIError('This command should be used from a valid Azure DevOps git repository only') client = get_git_client(organization) pr = client.get_pull_request_by_id(id) # favorite the ref refFavoriteRequest = GitRefFavorite(name=pr.source_ref_name, repository_id=pr.repository.id, type=2) try: client.create_favorite(favorite=refFavoriteRequest, project=pr.repository.project.id) except Exception as ex: # pylint: disable=broad-except if 'is already a favorite for user' not in str(ex): raise ex fetch_remote_and_checkout(pr.source_ref_name, remote_name) def remove_pull_request_work_items(id, work_items, organization=None, detect=None): # pylint: disable=redefined-builtin """Unlink one or more work items from a pull request. :param id: ID of the pull request. :type id: int :param work_items: IDs of the work items to unlink. Space separated. :type work_items: list of int :rtype: list of :class:`AssociatedWorkItem ` """ # pylint: disable=too-many-nested-blocks organization = resolve_instance(detect=detect, organization=organization) client = get_git_client(organization) existing_pr = client.get_pull_request_by_id(id) if work_items is not None and work_items: work_items = list(set(work_items)) # make distinct wit_client = get_work_item_tracking_client(organization) work_items_full = wit_client.get_work_items(ids=work_items, expand=1) if work_items_full: url = 'vstfs:///Git/PullRequestId/{project}%2F{repo}%2F{id}'.format( project=existing_pr.repository.project.id, repo=existing_pr.repository.id, id=id) for work_item in work_items_full: if work_item.relations is not None: index = 0 for relation in work_item.relations: if relation.url == url: patch_document = [] patch_test_operation = JsonPatchOperation() patch_test_operation.op = 'test' patch_test_operation.path = '/rev' patch_test_operation.value = work_item.rev patch_document.append(patch_test_operation) patch_operation = JsonPatchOperation() patch_operation.op = 1 patch_operation.path = '/relations/{index}'.format(index=index) patch_document.append(patch_operation) wit_client.update_work_item(document=patch_document, id=work_item.id) else: index += 1 refs = client.get_pull_request_work_item_refs(project=existing_pr.repository.project.id, repository_id=existing_pr.repository.id, pull_request_id=id) if refs: ids = [] for ref in refs: ids.append(ref.id) if ids: return wit_client.get_work_items(ids=ids) return None def list_pull_request_work_items(id, organization=None, detect=None): # pylint: disable=redefined-builtin """List linked work items for a pull request. :param id: ID of the pull request. :type id: int :rtype: list of :class:`AssociatedWorkItem ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_git_client(organization) pr = client.get_pull_request_by_id(id) refs = client.get_pull_request_work_item_refs(project=pr.repository.project.id, repository_id=pr.repository.id, pull_request_id=id) if refs: ids = [] for ref in refs: ids.append(ref.id) wit_client = get_work_item_tracking_client(organization) return wit_client.get_work_items(ids=ids) return refs def vote_pull_request(id, vote, organization=None, detect=None): # pylint: disable=redefined-builtin """Vote on a pull request. :param id: ID of the pull request. :type id: int :param vote: New vote value for the pull request. :type vote: int :rtype: :class:`IdentityRefWithVote ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_git_client(organization) pr = client.get_pull_request_by_id(id) resolved_reviewer = IdentityRefWithVote(id=resolve_identity_as_id(ME, organization)) resolved_reviewer.vote = _convert_vote_to_int(vote) created_reviewer = client.create_pull_request_reviewer(project=pr.repository.project.id, repository_id=pr.repository.id, pull_request_id=id, reviewer_id=resolved_reviewer.id, reviewer=resolved_reviewer) return created_reviewer def _convert_vote_to_int(vote): if vote.lower() == 'approve': return 10 if vote.lower() == 'approve-with-suggestions': return 5 if vote.lower() == 'reset': return 0 if vote.lower() == 'wait-for-author': return -5 if vote.lower() == 'reject': return -10 raise CLIError('"{vote}" is an invalid value for a pull request vote.'.format(vote=vote)) def list_pr_policies(id, organization=None, detect=None, top=None, skip=None): # pylint: disable=redefined-builtin """List policies of a pull request. :param id: ID of the pull request. :type id: int :param top: Maximum number of policies to list. :type top: int :param skip: Number of policies to skip. :type skip: int :rtype: list of :class:`PolicyEvaluationRecord ` """ organization = resolve_instance(detect=detect, organization=organization) git_client = get_git_client(organization) pr = git_client.get_pull_request_by_id(id) policy_client = get_policy_client(organization) artifact_id = "vstfs:///CodeReview/CodeReviewId/{project_id}/{pull_request_id}".format( project_id=pr.repository.project.id, pull_request_id=id) return policy_client.get_policy_evaluations(project=pr.repository.project.id, artifact_id=artifact_id, top=top, skip=skip) def queue_pr_policy(id, evaluation_id, organization=None, detect=None): # pylint: disable=redefined-builtin """Queue an evaluation of a policy for a pull request. :param id: ID of the pull request. :type id: int :param evaluation_id: ID of the policy evaluation to queue. :type evaluation_id: str :rtype: :class:`PolicyEvaluationRecord ` """ organization = resolve_instance(detect=detect, organization=organization) git_client = get_git_client(organization) pr = git_client.get_pull_request_by_id(id) policy_client = get_policy_client(organization) return policy_client.requeue_policy_evaluation(project=pr.repository.project.id, evaluation_id=evaluation_id) def _resolve_reviewers_as_refs(reviewers, organization): """Takes a list containing identity names, emails, and ids, and return a list of IdentityRefWithVote objects. :rtype: list of :class:`IdentityRefWithVote ` """ resolved_reviewers = None if reviewers is not None and reviewers: resolved_reviewers = [] for reviewer in reviewers: resolved_reviewers.append(IdentityRefWithVote(id=resolve_identity_as_id(reviewer, organization))) return resolved_reviewers def _resolve_reviewers_as_ids(reviewers, organization): """Takes a list containing identity names, emails, and ids, and returns a list of IdentityRefWithVote objects. """ resolved_reviewers = None if reviewers is not None and reviewers: resolved_reviewers = [] for reviewer in reviewers: resolved_reviewers.append(resolve_identity_as_id(reviewer, organization)) return resolved_reviewers def _open_pull_request(pull_request, organization): """Opens the pull request in the default browser. :param pull_request: The pull request to open. :type pull_request: str """ url = organization.rstrip('/') + '/' + uri_quote(pull_request.repository.project.name)\ + '/_git/' + uri_quote(pull_request.repository.name) + '/pullrequest/'\ + str(pull_request.pull_request_id) webbrowser.open_new(url=url) def _get_default_branch(organization, project, repository): client = get_git_client(organization) repo = client.get_repository(project=project, repository_id=repository) return repo.default_branch azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/ref.py000066400000000000000000000122501360605530400271770ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from azext_devops.devops_sdk.v5_0.git.models import GitRefUpdate from azext_devops.dev.common.git import resolve_git_refs from azext_devops.dev.common.services import (get_git_client, resolve_instance_project_and_repo) logger = get_logger(__name__) # pylint: disable=redefined-builtin def list_refs(filter=None, repository=None, organization=None, project=None, detect=None): """List the references. :param str filter: A filter to apply to the refs (starts with). Example: head or heads/ for the branches. :param str repository: Name or ID of the repository. :param str project: Name or ID of the project. :param str detect: Automatically detect organization and project. Default is "on". """ organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, repo=repository) client = get_git_client(organization) return client.get_refs(repository_id=repository, project=project, filter=filter) def create_ref(name, object_id, repository=None, organization=None, project=None, detect=None): """Create a reference. :param str name: Name of the reference to create (example: heads/my_branch or tags/my_tag). :param str object_id: Id of the object to create the reference from. :param str repository: Name or ID of the repository. :param str project: Name or ID of the project. :param str detect: Automatically detect organization and project. Default is "on". """ organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, repo=repository) client = get_git_client(organization) # by default, the create method does not support setting the is_locked value # to True. ref_update = GitRefUpdate(is_locked=False, name=resolve_git_refs(name), new_object_id=object_id, old_object_id='0000000000000000000000000000000000000000') return client.update_refs(ref_updates=[ref_update], repository_id=repository, project=project)[0] def delete_ref(name, object_id, repository=None, organization=None, project=None, detect=None): """Delete a reference. :param str name: Name of the reference to delete (example: heads/my_branch). :param str object_id: Id of the reference to delete. :param str repository: Name or ID of the repository. :param str project: Name or ID of the project. :param str detect: Automatically detect organization and project. Default is "on". """ organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, repo=repository) client = get_git_client(organization) ref_update = GitRefUpdate(name=resolve_git_refs(name), new_object_id='0000000000000000000000000000000000000000', old_object_id=object_id) return client.update_refs(ref_updates=[ref_update], repository_id=repository, project=project)[0] def lock_ref(name, repository=None, organization=None, project=None, detect=None): """Lock a reference. :param str name: Name of the reference to update (example: heads/my_branch). :param str repository: Name or ID of the repository. :param str project: Name or ID of the project. :param str detect: Automatically detect organization and project. Default is "on". """ return _update_ref(name, True, repository, organization, project, detect) def unlock_ref(name, repository=None, organization=None, project=None, detect=None): """Unlock a reference. :param str name: Name of the reference to update (example: heads/my_branch). :param str repository: Name or ID of the repository. :param str project: Name or ID of the project. :param str detect: Automatically detect organization and project. Default is "on". """ return _update_ref(name, False, repository, organization, project, detect) def _update_ref(name, locked, repository, organization, project, detect): organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, repo=repository) client = get_git_client(organization) ref_update = GitRefUpdate(is_locked=locked) return client.update_ref(new_ref_info=ref_update, repository_id=repository, filter=name, project=project) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/repos/repository.py000066400000000000000000000127001360605530400306420ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function import webbrowser from knack.util import CLIError from knack.log import get_logger from azext_devops.devops_sdk.v5_0.git.models import GitRepositoryCreateOptions from azext_devops.dev.common.services import (get_git_client, resolve_instance_and_project, resolve_instance_project_and_repo) from azext_devops.dev.common.git import resolve_git_ref_heads from azext_devops.dev.common.uri import uri_quote logger = get_logger(__name__) def create_repo(name, organization=None, project=None, detect=None, open=False): # pylint: disable=redefined-builtin """Create a Git repository in a team project. :param name: Name for the new repository. :type name: str :param open: Open the repository page in your web browser. :type open: bool :rtype: :class:` ` """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) git_client = get_git_client(organization) create_options = GitRepositoryCreateOptions() create_options.name = name repository = git_client.create_repository(git_repository_to_create=create_options, project=project) if open: _open_repository(repository, organization) return repository def delete_repo(id, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Delete a Git repository in a team project. :param id: ID of the repository. :type id: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) git_client = get_git_client(organization) delete_response = git_client.delete_repository(project=project, repository_id=id) print('Deleted repository {}'.format(id)) return delete_response def list_repos(organization=None, project=None, detect=None): """List Git repositories of a team project. """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) git_client = get_git_client(organization) repository = git_client.get_repositories(project=project) return repository def update_repo(repository, default_branch=None, name=None, organization=None, project=None, detect=None): """Update the Git repository. :param repository: Name or ID of the repository. :type repository: str :param name: New name for the repository. :type name: str :param default_branch: Default branch to be set for the repository. Example: 'refs/heads/live' or 'live'. :type default_branch: str """ if not default_branch and not name: raise CLIError("Either --default-branch or --name (for rename) must be provided to update repository.") organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, project_required=True, repo=repository) git_client = get_git_client(organization) # Get the repo to be updated repository = git_client.get_repository(project=project, repository_id=repository) if default_branch: default_branch = resolve_git_ref_heads(default_branch) repository.default_branch = default_branch if name: repository.name = name repository = git_client.update_repository( project=project, repository_id=repository.id, new_repository_info=repository) return repository def show_repo(repository, organization=None, project=None, detect=None, open=False): # pylint: disable=redefined-builtin """Get the details of a Git repository. :param repository: Name or ID of the repository. :type repository: str :param open: Open the repository page in your web browser. :type open: bool :rtype: :class:` ` """ organization, project, repository = resolve_instance_project_and_repo( detect=detect, organization=organization, project=project, project_required=True, repo=repository) git_client = get_git_client(organization) repository = git_client.get_repository(project=project, repository_id=repository) if open: _open_repository(repository, organization) return repository def _open_repository(repository, organization): """Opens the pull request in the default browser. :param repository: The repository to open. :type repository: str """ url = organization.rstrip('/') + '/' + uri_quote(repository.project.name)\ + '/_git/' + uri_quote(repository.name) logger.debug('Opening web page: %s', url) webbrowser.open_new(url=url) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/000077500000000000000000000000001360605530400256475ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/__init__.py000066400000000000000000000004571360605530400277660ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. from ._help import load_team_help load_team_help() azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/_format.py000066400000000000000000000272351360605530400276610ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function from collections import OrderedDict from knack.util import CLIError from azext_devops.dev.common.format import trim_for_display, date_time_to_only_date def transform_extension_search_results_table_output(result): table_output = [] for item in result: table_output.append(_transform_extension_search_result_row(item)) return table_output def _transform_extension_search_result_row(row): table_row = OrderedDict() table_row['Publisher Name'] = row['publisher']['publisherName'] table_row['Extension Name'] = row['extensionName'] table_row['Name'] = row['displayName'] return table_row def transform_extension_table_output(result): table_output = [_transform_extension_row(result)] return table_output def transform_extensions_table_output(result): table_output = [] for item in sorted(result, key=_get_extension_key): table_output.append(_transform_extension_row(item)) return table_output def _transform_extension_row(row): table_row = OrderedDict() table_row['Publisher Id'] = trim_for_display(row['publisherId'], 10) table_row['Extension Id'] = trim_for_display(row['extensionId'], 20) table_row['Name'] = trim_for_display(row['extensionName'], 20) table_row['Version '] = trim_for_display(row['version'], 20) table_row['Last Updated '] = date_time_to_only_date(row['lastPublished']) table_row['States'] = trim_for_display(row['installState']['flags'], 20) table_row['Flags'] = trim_for_display(row['flags'], 20) return table_row def transform_projects_table_output(result): table_output = [] for item in sorted(result['value'], key=_get_project_key): table_output.append(_transform_project_row(item)) return table_output def transform_project_table_output(result): table_output = [_transform_project_row(result)] return table_output def _transform_project_row(row): from .project import (PROCESS_TEMPLATE_CAPABILITY_NAME, VERSION_CONTROL_CAPABILITY_NAME, VERSION_CONTROL_CAPABILITY_ATTRIBUTE_NAME) table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Visibility'] = row['visibility'].capitalize() if 'capabilities' in row: capabilities = row['capabilities'] if PROCESS_TEMPLATE_CAPABILITY_NAME in capabilities: process_capabilities = capabilities[PROCESS_TEMPLATE_CAPABILITY_NAME] if 'templateName' in process_capabilities: table_row['Process'] = process_capabilities['templateName'] if VERSION_CONTROL_CAPABILITY_NAME in capabilities: version_capabilities = capabilities[VERSION_CONTROL_CAPABILITY_NAME] if VERSION_CONTROL_CAPABILITY_ATTRIBUTE_NAME in version_capabilities: table_row['Source Control'] = version_capabilities[VERSION_CONTROL_CAPABILITY_ATTRIBUTE_NAME] return table_row def transform_service_endpoints_table_output(result): table_output = [] for item in sorted(result, key=_get_service_endpoint_key): table_output.append(_transform_service_endpoint_row(item)) return table_output def _transform_service_endpoint_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Type'] = row['type'] table_row['Is Ready'] = row['isReady'] table_row['Created By'] = row['createdBy']['displayName'] return table_row def transform_authorized_service_endpoint_table_output(result): table_output = [] table_output.append(_transform_authorized_service_endpoint_row(result)) return table_output def _transform_authorized_service_endpoint_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Allow Pipelines'] = row['authorized'] table_row['Name'] = row['name'] table_row['Type'] = row['type'] table_row['Is Ready'] = row['isReady'] table_row['Created By'] = row['createdBy']['displayName'] return table_row def transform_groups_table_output(result): table_output = [] if result['continuationToken'] is not None: print('Showing only 500 groups. ' + 'To list next set of groups use this token as --continuation-token argument and run the command again.' + ' TOKEN:', result['continuationToken']) for item in result['graphGroups']: table_output.append(_transform_group_row(item)) return table_output def transform_group_table_output(result): table_output = [_transform_group_show_table_output(result)] return table_output def _transform_group_show_table_output(row): table_row = OrderedDict() table_row['Name'] = row['principalName'] table_row['Description'] = row['description'] return table_row def _transform_group_row(row): table_row = OrderedDict() table_row['Name'] = row['principalName'] table_row['Descriptor'] = row['descriptor'] return table_row def transform_memberships_table_output(result): table_output = [] for item in result: table_output.append(_transform_membership_row(result[item])) return table_output def transform_membership_table_output(result): table_output = [] for item in result: table_row = OrderedDict() row = result[item] if row['subjectKind'] == 'user': table_row['Name'] = row['displayName'] else: table_row['Name'] = row['principalName'] table_row['Type'] = row['subjectKind'] table_row['Email'] = row['mailAddress'] table_output.append(table_row) return table_output def _transform_membership_row(row): table_row = OrderedDict() if row['subjectKind'] == 'user': table_row['Name'] = row['displayName'] else: table_row['Name'] = row['principalName'] table_row['Type'] = row['subjectKind'] table_row['Email'] = row['mailAddress'] table_row['Descriptor'] = row['descriptor'] return table_row def transform_namespaces_table_output(result): table_output = [] for item in result: table_output.append(_transform_namespace_row(item)) return table_output def _transform_namespace_row(row): table_row = OrderedDict() table_row['Id'] = row['namespaceId'] table_row['Name'] = row['name'] return table_row def transform_namespace_table_output(result): table_output = [] for item in result[0]['actions']: table_output.append(_transform_namespace_details_row(item)) return table_output def _transform_namespace_details_row(row): table_row = OrderedDict() table_row['Name'] = row['name'] table_row['Permission Description'] = row['displayName'] table_row['Permission Bit'] = row['bit'] return table_row def transform_acl_output(result): table_output = [] for item in result: table_output.append(_transform_acl_details_row(item)) return table_output def _transform_acl_details_row(row): if len(row['acesDictionary']) > 1: raise CLIError('More than one entry found in Aces dictionary for this user/group.') table_row = OrderedDict() table_row['token'] = row['token'] ace = list(row['acesDictionary'].values())[0] if row['includeExtendedInfo']: if ace['extendedInfo']['effectiveAllow'] is not None: table_row['Effective Allow'] = ace['extendedInfo']['effectiveAllow'] else: table_row['Effective Allow'] = 0 if ace['extendedInfo']['effectiveDeny'] is not None: table_row['Effective Deny'] = ace['extendedInfo']['effectiveDeny'] else: table_row['Effective Deny'] = 0 return table_row def transform_resolve_permission_bits(result): table_output = [] ace_entry = list(result[0]['acesDictionary'].values())[0] permissions = ace_entry['resolvedPermissions'] for permission in permissions: table_output.append(_transform_resolve_bits_row(permission)) return table_output def _transform_resolve_bits_row(row): table_row = OrderedDict() table_row['Name'] = row['name'] table_row['Bit'] = row['bit'] table_row['Permission Description'] = row['displayName'] table_row['Permission Value'] = row['effectivePermission'] return table_row def transform_teams_table_output(result): table_output = [] for item in sorted(result, key=_get_team_key): table_output.append(_transform_team_row(item)) return table_output def transform_team_table_output(result): table_output = [_transform_team_row(result)] return table_output def _transform_team_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Description'] = row['description'] return table_row def transform_wikis_table_output(result): table_output = [] for item in sorted(result, key=_get_wiki_key): table_output.append(_transform_wiki_row(item)) return table_output def transform_wiki_table_output(result): table_output = [_transform_wiki_row(result)] return table_output def _transform_wiki_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Name'] = row['name'] table_row['Type'] = row['type'] return table_row def transform_wiki_page_table_output(result): table_output = [_transform_wiki_page_row(result)] return table_output def _transform_wiki_page_row(row): table_row = OrderedDict() table_row['ETag'] = row['eTag'] table_row['Page Path'] = '\'{}\''.format(row['page']['path']) table_row['Is Parent'] = row['page']['isParentPage'] table_row['order'] = row['page']['order'] return table_row def transform_team_members_table_output(result): table_output = [] for item in sorted(result, key=_get_member_key): table_output.append(_transform_team_member_row(item)) return table_output def _transform_team_member_row(row): table_row = OrderedDict() table_row['ID'] = row['identity']['id'] table_row['Name'] = row['identity']['displayName'] table_row['Email'] = row['identity']['uniqueName'] return table_row def transform_users_table_output(result): members = result['members'] table_output = [] for item in members: table_output.append(_transform_user_row(item)) return table_output def transform_user_table_output(result): table_output = [_transform_user_row(result)] return table_output def _transform_user_row(row): table_row = OrderedDict() table_row['ID'] = row['id'] table_row['Display Name'] = row['user']['displayName'] table_row['Email'] = row['user']['mailAddress'] table_row['License Type'] = row['accessLevel']['accountLicenseType'] table_row['Access Level'] = row['accessLevel']['licenseDisplayName'] table_row['Status'] = row['accessLevel']['status'] return table_row def _get_extension_key(extension): return extension['extensionName'].lower() def _get_permission_key(permission_row): return permission_row['displayName'].lower() def _get_service_endpoint_key(service_endpoint_row): return service_endpoint_row['name'].lower() def _get_project_key(project_row): return project_row['name'].lower() def _get_team_key(team_row): return team_row['name'].lower() def _get_wiki_key(wiki_row): return wiki_row['name'].lower() def _get_member_key(member_row): return member_row['identity']['uniqueName'].lower() azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/_help.py000066400000000000000000000207251360605530400273160ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.help_files import helps def load_team_help(): helps['devops'] = """ type: group short-summary: Manage Azure DevOps organization level operations. long-summary: | Related Groups az pipelines: Manage Azure Pipelines az boards: Manage Azure Boards az repos: Manage Azure Repos az artifacts: Manage Azure Artifacts """ helps['devops project'] = """ type: group short-summary: Manage team projects. """ helps['devops service-endpoint'] = """ type: group short-summary: Manage service endpoints/connections """ helps['devops service-endpoint create'] = """ type: command short-summary: Create a service endpoint using configuration file. long-summary: You can learn more about this at https://aka.ms/azure-devops-service-endpoint-config """ helps['devops service-endpoint azurerm'] = """ type: group short-summary: Manage Azure RM service endpoints/connections """ helps['devops service-endpoint azurerm create'] = """ type: command short-summary: Create an Azure RM type service endpoint. long-summary: For automation, set service principal password/secret in AZURE_DEVOPS_EXT_AZURE_RM_SERVICE_PRINCIPAL_KEY environment variable. You can learn more about this at https://aka.ms/azure-devops-cli-azurerm-service-endpoint """ helps['devops service-endpoint github'] = """ type: group short-summary: Manage GitHub service endpoints/connections """ helps['devops service-endpoint github create'] = """ type: command short-summary: Create a GitHub service endpoint. long-summary: For automation, set GitHub PAT token in AZURE_DEVOPS_EXT_GITHUB_PAT environment variable. You can learn more about this at https://aka.ms/azure-devops-cli-service-endpoint """ helps['devops security'] = """ type: group short-summary: Manage security related operations """ helps['devops security group'] = """ type: group short-summary: Manage security groups """ helps['devops security group create'] = """ type: command short-summary: Create a new Azure DevOps group. long-summary: examples: - name: Create an Azure DevOps Group with name and description text: | az devops security group create --name 'Some group name' --description 'Something to describe this group' - name: Add an existing AAD group to an Azure DevOps group text: | Get object ID of an existing AAD group az ad group show -g '{Group Name}' az devops security group create --origin-id '{Object ID}' --groups 'vssgp.someDescriptorForGroup' - name: Add an existing AAD group to an Azure DevOps group with AAD group Email ID text: | az devops security group create --email-id '{Email ID of AAD group}' --groups 'vssgp.someDescriptorForGroup' - name: Create a new Azure DevOps group and add it to existing Azure DevOps groups. text: | az devops security group create --name 'Some group name' --groups 'vssgp.someDescriptorForGroupOne,vssgp.someDescriptorForGroupTwo' """ helps['devops security group membership'] = """ type: group short-summary: Manage memberships for security groups """ helps['devops security permission'] = """ type: group short-summary: Manage security permissions """ helps['devops security permission namespace'] = """ type: group short-summary: Manage security namespaces """ helps['devops security permission update'] = """ type: command short-summary: Assign allow or deny permission to given user/group. long-summary: Learn more at https://aka.ms/azure-devops-cli-security-permission examples: - name: Assign view, edit and delete permission for team projects. text: | az devops security permission update --allow-bit 7 --namespace-id\ 52d39943-cb85-4d7f-8fa8-c6baac873819 --subject user@fabrikam.com\ --token "$PROJECT:vstfs:///Classification/TeamProject/e479xxxx-2be8-xxxx-bb0b-3a0209cxxxx" You would need to add the bit value of the various permission bits to simultaneously allow/deny multiple permissions. """ helps['devops team'] = """ type: group short-summary: Manage teams """ helps['devops user'] = """ type: group short-summary: Manage users """ helps['devops extension'] = """ type: group short-summary: Manage extensions """ helps['devops invoke'] = """ type: command short-summary: This command will invoke request for any DevOps area and resource. Please use only json output as the response of this command is not fixed. Helpful docs - https://docs.microsoft.com/en-us/rest/api/azure/devops/ long-summary: examples: - name: Discover areas related to 'Wiki' text: | az devops invoke --query "[?contains(area,'wiki')]" - name: Get all wikis in a project text: | az devops invoke --area wiki --resource wikis --route-parameters project={Project Name} -o json az devops invoke --area wiki --resource wikis --route-parameters project=WikiIssue -o json - name: Add page to a wiki text: | az devops invoke --area wiki --resource pages --route-parameters project={Project Name} wikiIdentifier={Wiki Id} --in-file {Full File Path containing text to add to wiki} --query-parameters path={Page Path In Wiki} --http-method PUT --api-version 5.1-preview -o json az devops invoke --area wiki --resource pages --route-parameters project=WikiIssue wikiIdentifier=e479f402-2be8-4953-bb0b-3a0209cbc2d2 --in-file D:/temp/createWikiRequestBody.txt --encoding 'utf-8' --query-parameters path=sample738 --http-method PUT --api-version 5.1-preview -o json """ helps['devops wiki'] = """ type: group short-summary: Manage wikis """ helps['devops wiki create'] = """ type: command examples: - name: Create a project wiki text: | az devops wiki create --name myprojectwiki - name: Create a code wiki from a folder in a code repository text: | az devops wiki create --name WIKI_NAME --type codewiki --version BRANCH_NAME --repository REPO_NAME --mapped-path PATH_TO_PUBLISH """ helps['devops wiki list'] = """ type: command examples: - name: List all wikis for a project text: | az devops wiki list - name: List all wikis in the organization text: | az devops wiki list --scope organization """ helps['devops wiki page'] = """ type: group short-summary: Manage wiki pages """ helps['devops wiki page create'] = """ type: command examples: - name: Create a new page with path 'my page' in a wiki named 'myprojectwiki' with inline content text: | az devops wiki page create --path 'my page' --wiki myprojectwiki --content "Hello World" - name: Create a new page with path 'my page' in a wiki named 'myprojectwiki' with content from a file text: | az devops wiki page create --path 'my page' --wiki myprojectwiki --file-path a.txt\ --encoding utf-8 """ helps['devops wiki page update'] = """ type: command examples: - name: Update content of page with path 'my page' in a wiki named 'myprojectwiki' with inline content text: | az devops wiki page update --path 'my page' --wiki myprojectwiki --content "Hello World"\ --version 4ae78ad5835cb7dd55072fe210c9ee7eb6d6413b - name: Update content of page with path 'my page' in a wiki with content from a file text: | az devops wiki page update --path 'my page' --wiki myprojectwiki --file-path a.txt\ --encoding utf-8 --version 4ae78ad5835cb7dd55072fe210c9ee7eb6d6413b """ azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/arguments.py000066400000000000000000000246511360605530400302360ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.arguments import enum_choice_list from azure.cli.core.commands.parameters import get_enum_type, get_three_state_flag from azext_devops.dev.common.utils import FILE_ENCODING_TYPES # CUSTOM CHOICE LISTS _SOURCE_CONTROL_VALUES = ['git', 'tfvc'] _WIKI_TYPE_VALUES = ['projectwiki', 'codewiki'] _SCOPE_VALUES = ['project', 'organization'] _PROJECT_VISIBILITY_VALUES = ['private', 'public'] _STATE_VALUES = ['invalid', 'unchanged', 'all', 'new', 'wellformed', 'deleting', 'createpending'] _PROJECT_GET_STATE_VALUE_FILTER = ['all', 'createPending', 'deleted', 'deleting', 'new', 'unchanged', 'wellFormed'] _HTTP_METHOD_VALUES = ['GET', 'POST', 'PATCH', 'DELETE', 'OPTIONS', 'PUT', 'HEAD'] _LICENSE_TYPES = ['advanced', 'earlyAdopter', 'express', 'professional', 'stakeholder'] _RELATIONSHIP_TYPES = ['members', 'memberof'] _FILE_ENCODING_TYPE_VALUES = FILE_ENCODING_TYPES def load_global_args(context): context.argument('organization', options_list=('--organization', '--org'), help='Azure DevOps organization URL. You can configure the default organization using ' 'az devops configure -d organization=ORG_URL. Required if not configured as ' 'default or picked up via git config. Example: https://dev.azure.com/MyOrganizationName/') context.argument('detect', arg_type=get_three_state_flag(), help='Automatically detect organization.') context.argument('project', options_list=('--project', '-p'), help='Name or ID of the project. You can configure the default project using ' 'az devops configure -d project=NAME_OR_ID. Required if not configured as ' 'default or picked up via git config.') # pylint: disable=too-many-statements def load_team_arguments(self, _): with self.argument_context('devops login') as context: context.argument('organization', help='Azure DevOps organization URL. Example: https://dev.azure.com/MyOrganizationName') with self.argument_context('devops logout') as context: context.argument('organization', help='Azure DevOps organization URL. Example: https://dev.azure.com/MyOrganizationName/. ' 'If no organization is specified, all organizations will be logged out.') with self.argument_context('devops configure') as context: context.argument('defaults', options_list=('--defaults', '-d'), nargs='*') context.argument('use_git_aliases', arg_type=get_three_state_flag()) context.argument('list_config', options_list=('--list', '-l')) with self.argument_context('devops') as context: context.argument('repository', options_list=('--repository', '-r')) with self.argument_context('devops project') as context: context.argument('process', options_list=('--process', '-p')) context.argument('source_control', options_list=('--source-control', '-s'), **enum_choice_list(_SOURCE_CONTROL_VALUES)) context.argument('description', options_list=('--description', '-d')) context.argument('state', **enum_choice_list(_STATE_VALUES)) context.argument('visibility', **enum_choice_list(_PROJECT_VISIBILITY_VALUES)) with self.argument_context('devops project delete') as context: context.argument('yes', options_list=['--yes', '-y'], action='store_true', help='Do not prompt for confirmation.') with self.argument_context('devops project list') as context: context.argument('state_filter', arg_type=get_enum_type(_PROJECT_GET_STATE_VALUE_FILTER), help='State filter.') context.argument('continuation_token', help='Continuation token. ' 'This can be retrived from previous run of this command if more results are present.') context.argument('get_default_team_image_url', arg_type=get_three_state_flag(), help='Whether to get default team image url or not.') with self.argument_context('devops service-endpoint create') as context: context.argument('encoding', help='Encoding of the input file.', **enum_choice_list(_FILE_ENCODING_TYPE_VALUES)) with self.argument_context('devops service-endpoint update') as context: context.argument('enable_for_all', help='Allow all pipelines to access this service endpoint.', arg_type=get_three_state_flag()) with self.argument_context('devops invoke') as context: context.argument('route_parameters', nargs='*', help='Specifies the list of route parameters') context.argument('query_parameters', nargs='*', help='Specifies the list of query parameters') context.argument('http_method', arg_type=get_enum_type(_HTTP_METHOD_VALUES), help='Specifies the method used for the request.') context.argument('media_type', help='Specifies the content type of the request.') context.argument('accept_media_type', help='Specifies the content type of the response.') context.argument('in_file', help='Path and file name to the file that contains the contents of the request.') context.argument('encoding', help='Encoding of the input file. Used in conjunction with --in-file.', **enum_choice_list(_FILE_ENCODING_TYPE_VALUES)) context.argument('out_file', help='Path and file name to the file for which this function saves the response body.') context.argument('area', help='The area to find the resource.') context.argument('resource', help='The name of the resource to operate on.') context.argument('api_version', help='The version of the API to target') with self.argument_context('devops user') as context: context.argument('license_type', arg_type=get_enum_type(_LICENSE_TYPES)) with self.argument_context('devops user add') as context: context.argument('send_email_invite', arg_type=get_three_state_flag(), help='Whether to send email invite for new user or not.') with self.argument_context('devops security group create') as context: context.argument('project', help='Name or ID of the project in which Azure DevOps group should be created.') context.argument('scope', **enum_choice_list(_SCOPE_VALUES)) with self.argument_context('devops security group list') as context: context.argument('project', help='List groups for a particular project') context.argument('scope', **enum_choice_list(_SCOPE_VALUES)) with self.argument_context('devops security group membership') as context: context.argument('relationship', arg_type=get_enum_type(_RELATIONSHIP_TYPES), help='Get member of/members for this group.') with self.argument_context('devops security permission') as context: context.argument('namespace_id', options_list=('--namespace-id', '--id'), help='ID of security namespace') context.argument('token', help='Security token.') context.argument('subject', help='User Email ID or Group descriptor') with self.argument_context('devops security permission update') as context: context.argument('merge', arg_type=get_three_state_flag(), help='If set, the existing ACE has its allow and deny merged with \ the incoming ACE\'s allow and deny. If unset, the existing ACE is displaced.') context.argument('allow_bit', type=int, help='Allow bit or addition of bits. Required if --deny-bit is missing.') context.argument('deny_bit', type=int, help='Deny bit or addition of bits. Required if --allow-bit is missing.') with self.argument_context('devops security permission reset') as context: context.argument('permission_bit', type=int, help='Permission bit or addition of permission bits which needs to be reset\ for given user/group and token.') with self.argument_context('devops extension') as context: context.argument('include_built_in', arg_type=get_three_state_flag(), help='Include built in extensions.') context.argument('include_disabled', arg_type=get_three_state_flag(), help='Include disabled extensions.') context.argument('publisher_id', help='Publisher Id. This will map to publisher-name \ in the az devops extension search output. ') context.argument('extension_id', help='Extension Id. This will map to extension-name \ in the az devops extension search output.') context.argument('search_query', options_list=('--search-query', '-q'), help='Search term') with self.argument_context('devops') as context: load_global_args(context) with self.argument_context('repos') as context: load_global_args(context) with self.argument_context('artifacts') as context: load_global_args(context) with self.argument_context('boards') as context: load_global_args(context) with self.argument_context('pipelines') as context: load_global_args(context) with self.argument_context('devops wiki') as context: context.argument('wiki_type', options_list=('--wiki-type', '--type'), **enum_choice_list(_WIKI_TYPE_VALUES)) context.argument('version', options_list=('--version', '-v')) context.argument('encoding', **enum_choice_list(_FILE_ENCODING_TYPE_VALUES)) with self.argument_context('devops wiki list') as context: context.argument('scope', **enum_choice_list(_SCOPE_VALUES)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/commands.py000066400000000000000000000242661360605530400300340ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azure.cli.core.commands import CliCommandType from azext_devops.dev.common.exception_handler import azure_devops_exception_handler from ._format import (transform_project_table_output, transform_projects_table_output, transform_service_endpoints_table_output, transform_authorized_service_endpoint_table_output, transform_groups_table_output, transform_group_table_output, transform_memberships_table_output, transform_membership_table_output, transform_namespaces_table_output, transform_namespace_table_output, transform_acl_output, transform_resolve_permission_bits, transform_team_table_output, transform_teams_table_output, transform_team_members_table_output, transform_users_table_output, transform_user_table_output, transform_extension_table_output, transform_extensions_table_output, transform_extension_search_results_table_output, transform_wiki_table_output, transform_wikis_table_output, transform_wiki_page_table_output) projectOps = CliCommandType( operations_tmpl='azext_devops.dev.team.project#{}', exception_handler=azure_devops_exception_handler ) configureOps = CliCommandType( operations_tmpl='azext_devops.dev.team.configure#{}', exception_handler=azure_devops_exception_handler ) feedbackOps = CliCommandType( operations_tmpl='azext_devops.dev.team.feedback#{}', exception_handler=azure_devops_exception_handler ) credentialsOps = CliCommandType( operations_tmpl='azext_devops.dev.team.credentials#{}', exception_handler=azure_devops_exception_handler ) service_endpointOps = CliCommandType( operations_tmpl='azext_devops.dev.team.service_endpoint#{}', exception_handler=azure_devops_exception_handler ) teamOps = CliCommandType( operations_tmpl='azext_devops.dev.team.team#{}', exception_handler=azure_devops_exception_handler ) invokeOps = CliCommandType( operations_tmpl='azext_devops.dev.team.invoke#{}', exception_handler=azure_devops_exception_handler ) userOps = CliCommandType( operations_tmpl='azext_devops.dev.team.user#{}', exception_handler=azure_devops_exception_handler ) extensionOps = CliCommandType( operations_tmpl='azext_devops.dev.team.extension#{}', exception_handler=azure_devops_exception_handler ) security_groupOps = CliCommandType( operations_tmpl='azext_devops.dev.team.security_group#{}', exception_handler=azure_devops_exception_handler ) security_permissionOps = CliCommandType( operations_tmpl='azext_devops.dev.team.security_permission#{}', exception_handler=azure_devops_exception_handler ) wikiOps = CliCommandType( operations_tmpl='azext_devops.dev.team.wiki#{}', exception_handler=azure_devops_exception_handler ) # pylint: disable=too-many-statements def load_team_commands(self, _): with self.command_group('devops', command_type=credentialsOps) as g: g.command('login', 'credential_set') g.command('logout', 'credential_clear') with self.command_group('devops', command_type=feedbackOps) as g: g.command('feedback', 'feedback', deprecate_info=g.deprecate(redirect='az feedback', hide=True)) with self.command_group('devops', command_type=configureOps) as g: g.command('configure', 'configure') with self.command_group('devops project', command_type=projectOps) as g: g.command('create', 'create_project', table_transformer=transform_project_table_output) g.command('delete', 'delete_project', confirmation='Are you sure you want to delete this project?') g.command('show', 'show_project', table_transformer=transform_project_table_output) g.command('list', 'list_projects', table_transformer=transform_projects_table_output) with self.command_group('devops service-endpoint', command_type=service_endpointOps) as g: g.command('list', 'list_service_endpoints', table_transformer=transform_service_endpoints_table_output) g.command('show', 'show_service_endpoint') # no table transform because type is not well defined g.command('create', 'create_service_endpoint', is_preview=True) g.command('update', 'update_service_endpoint', is_preview=True, table_transformer=transform_authorized_service_endpoint_table_output) g.command('azurerm create', 'create_azurerm_service_endpoint') g.command('github create', 'create_github_service_endpoint') g.command('delete', 'delete_service_endpoint', confirmation='Are you sure you want to delete this service-endpoint?') with self.command_group('devops team', command_type=teamOps) as g: g.command('create', 'create_team', table_transformer=transform_team_table_output) g.command('delete', 'delete_team', confirmation='Are you sure you want to delete this team?') g.command('show', 'get_team', table_transformer=transform_team_table_output) g.command('list', 'get_teams', table_transformer=transform_teams_table_output) g.command('list-member', 'get_team_members', table_transformer=transform_team_members_table_output) g.command('update', 'update_team', table_transformer=transform_team_table_output) with self.command_group('devops', command_type=invokeOps) as g: g.command('invoke', 'invoke') with self.command_group('devops user', command_type=userOps) as g: g.command('list', 'get_user_entitlements', table_transformer=transform_users_table_output) g.command('show', 'get_user_entitlement', table_transformer=transform_user_table_output) g.command('remove', 'delete_user_entitlement', confirmation='Are you sure you want to remove this user?') g.command('update', 'update_user_entitlement', table_transformer=transform_user_table_output) g.command('add', 'add_user_entitlement', table_transformer=transform_user_table_output) with self.command_group('devops extension', command_type=extensionOps) as g: g.command('list', 'list_extensions', table_transformer=transform_extensions_table_output) g.command('uninstall', 'uninstall_extension', confirmation='Are you sure you want to uninstall this extension?') g.command('install', 'install_extension', table_transformer=transform_extension_table_output) g.command('show', 'get_extension', table_transformer=transform_extension_table_output) g.command('enable', 'enable_extension', table_transformer=transform_extension_table_output) g.command('disable', 'disable_extension', table_transformer=transform_extension_table_output) g.command('search', 'search_extensions', table_transformer=transform_extension_search_results_table_output) with self.command_group('devops security group', command_type=security_groupOps) as g: g.command('list', 'list_groups', table_transformer=transform_groups_table_output) g.command('show', 'get_group', table_transformer=transform_group_table_output) g.command('update', 'update_group', table_transformer=transform_group_table_output) g.command('create', 'create_group', table_transformer=transform_group_table_output) g.command('delete', 'delete_group', confirmation='Are you sure you want to delete this group?') with self.command_group('devops security group membership', command_type=security_groupOps) as g: g.command('list', 'list_memberships', table_transformer=transform_memberships_table_output) g.command('add', 'add_membership', table_transformer=transform_membership_table_output) g.command('remove', 'remove_membership', confirmation='Are you sure you want to delete this relationship?') with self.command_group('devops security permission', command_type=security_permissionOps, is_preview=True) as g: g.command('list', 'list_tokens', table_transformer=transform_acl_output) g.command('update', 'update_permissions', table_transformer=transform_resolve_permission_bits) g.command('reset-all', 'reset_all_permissions', confirmation='Are you sure you want to reset all explicit permissions for this user/group and token?') g.command('reset', 'reset_permissions', table_transformer=transform_resolve_permission_bits) g.command('show', 'show_permissions', table_transformer=transform_resolve_permission_bits) with self.command_group('devops security permission namespace', command_type=security_permissionOps) as g: g.command('list', 'list_namespaces', table_transformer=transform_namespaces_table_output) g.command('show', 'show_namespace', table_transformer=transform_namespace_table_output) with self.command_group('devops wiki', command_type=wikiOps) as g: g.command('create', 'create_wiki', table_transformer=transform_wiki_table_output) g.command('list', 'list_wiki', table_transformer=transform_wikis_table_output) g.command('show', 'show_wiki', table_transformer=transform_wiki_table_output) g.command('delete', 'delete_wiki', table_transformer=transform_wiki_table_output, confirmation='Are you sure you want to delete this wiki?') with self.command_group('devops wiki page', command_type=wikiOps) as g: g.command('create', 'add_page', table_transformer=transform_wiki_page_table_output) g.command('update', 'update_page', table_transformer=transform_wiki_page_table_output) g.command('show', 'get_page', table_transformer=transform_wiki_page_table_output) g.command('delete', 'delete_page', confirmation='Are you sure you want to delete this wiki page?') azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/configure.py000066400000000000000000000116161360605530400302070ustar00rootroot00000000000000# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function import os from knack.config import get_config_parser from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.config import (set_global_config_value, AZ_DEVOPS_GLOBAL_CONFIG_PATH) from azext_devops.dev.common.const import (CLI_ENV_VARIABLE_PREFIX, DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT, DEVOPS_TEAM_PROJECT_DEFAULT) from azext_devops.dev.common.uri import is_valid_url logger = get_logger(__name__) CONFIG_VALID_DEFAULT_KEYS_LIST = [DEVOPS_ORGANIZATION_DEFAULT, DEVOPS_TEAM_PROJECT_DEFAULT] def configure(defaults=None, use_git_aliases=None, list_config=False): """Configure the Azure DevOps CLI or view your configuration. :param defaults: Space separated 'name=value' pairs for common arguments defaults, e.g. '--defaults project=my-project-name organization=https://dev.azure.com/organizationName arg=value'. Use '' to clear the defaults, e.g. --defaults project=''. :type defaults: str :param use_git_aliases: Set to 'true' to configure Git aliases global git config file (to enable commands like "git pr list"). Set to 'false' to remove any aliases set by the tool. :type use_git_aliases: str :param list_config: Lists the contents of the config file. :type list_config: bool """ if defaults is None and use_git_aliases is None and list_config is False: raise CLIError('usage error: atleast one of the options must be specified.' 'For list of supported options see help using -h flag.') if defaults: for default in defaults: parts = default.split('=', 1) if len(parts) == 1: raise CLIError('usage error: --defaults STRING=STRING STRING=STRING ...') if parts[0] not in CONFIG_VALID_DEFAULT_KEYS_LIST: raise CLIError('usage error: invalid default value setup. Supported values are {}.' .format(CONFIG_VALID_DEFAULT_KEYS_LIST)) _validate_configuration(key=parts[0], value=parts[1]) set_global_config_value(section=DEFAULTS_SECTION, option=parts[0], value=parts[1]) if use_git_aliases is not None: from azext_devops.dev.repos.git_alias import setup_git_aliases, clear_git_aliases if use_git_aliases: setup_git_aliases() else: clear_git_aliases() if list_config: print_current_configuration() def print_current_configuration(file_config=None): from azext_devops.dev.repos.git_alias import are_git_aliases_setup if file_config is None: file_config = get_config_parser() file_config.read([AZ_DEVOPS_GLOBAL_CONFIG_PATH]) for section in file_config.sections(): print() print('[{}]'.format(section)) for option in file_config.options(section): print('{} = {}'.format(option, file_config.get(section, option))) # Print if git alias is setup or not is_git_alias_setup = MSG_NO if are_git_aliases_setup(): is_git_alias_setup = MSG_YES print('{} = {}'.format(MSG_GIT_ALIAS_SETUP, is_git_alias_setup)) env_vars = [ev for ev in os.environ if ev.startswith(CLI_ENV_VARIABLE_PREFIX)] if env_vars: print(MSG_HEADING_ENV_VARS) print('\n'.join(['{}'.format(ev) for ev in env_vars])) def _validate_configuration(key, value): if key == DEVOPS_ORGANIZATION_DEFAULT: # value can be '' or a valid url if not value == '' and not is_valid_url(value): raise CLIError('Organization should be a valid Azure DevOps or Azure DevOps Server repository url. ' 'See command help for details.') MSG_INTRO = '\nWelcome to the Azure DevOps CLI! This command will guide you through setting some default values.\n' MSG_CLOSING = '\nYou\'re all set! Here are some commands to try:\n' \ ' $ az devops login\n' \ ' $ az repos pr list\n{}' \ ' $ az devops feedback\n' MSG_CLOSING_GIT_COMMAND = ' $ git pr list\n' MSG_GIT_ALIAS_SETUP = '\nUse git alias' MSG_GLOBAL_SETTINGS_LOCATION = 'Your settings can be found at {}' MSG_HEADING_CURRENT_CONFIG_INFO = 'Your current configuration is as follows:' MSG_HEADING_ENV_VARS = '\nEnvironment variables:' MSG_PROMPT_MANAGE_GLOBAL = '\nDo you wish to change your settings?' MSG_PROMPT_GIT_ALIAS = '\nConfigure aliases for Git (to enable commands like "git pr list")?' MSG_PROMPT_CLEAR_GIT_ALIAS = '\nGit aliases are configured, would you like to clear them?' MSG_YES = 'Yes' MSG_NO = 'No' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/const.py000066400000000000000000000004551360605530400273530ustar00rootroot00000000000000 # service endpoint authorization parameters SERVICE_ENDPOINT_AUTHORIZATION_PERSONAL_ACCESS_TOKEN = 'PersonalAccessToken' SERVICE_ENDPOINT_AUTHORIZATION_SERVICE_PRINCIPAL = 'ServicePrincipal' # service endpoint types SERVICE_ENDPOINT_TYPE_GITHUB = 'github' SERVICE_ENDPOINT_TYPE_AZURE_RM = 'azurerm' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/credentials.py000066400000000000000000000132431360605530400305210ustar00rootroot00000000000000# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function import sys from knack.log import get_logger from knack.prompting import NoTTYException, prompt_pass from knack.util import CLIError from msrest.authentication import BasicAuthentication from azext_devops.dev.common._credentials import clear_credential, set_credential from azext_devops.dev.common.services import _get_connection, get_base_url logger = get_logger(__name__) def credential_set(organization=None): """Set the credential (PAT) to use for a particular organization. Refer https://aka.ms/azure-devops-cli-auth for more information on providing PAT as input. """ token = _get_pat_token() if organization is not None: organization = get_base_url(organization) logger.info("Creating connection with personal access token.") _verify_token(organization=organization, token=token) try: set_credential(organization=organization, token=token) except Exception as ex: # pylint: disable=bare-except logger.warning("Unable to use secure credential store in this environment.") logger.warning("Please refer to alternate methods at https://aka.ms/azure-devops-cli-auth") logger.warning("using Environment variable") logger.warning("or use 'az login'") raise CLIError(ex) _check_and_set_default_organization(organization) def credential_clear(organization=None): """Clear the credential for all or a particular organization :param organization: Azure Devops organization URL. Example: https://dev.azure.com/MyOrganizationName/. If no organization is specified, all organizations will be logged out. :type organization: str """ if organization is not None: organization = get_base_url(organization) clear_credential(organization) if organization is not None: print('The credential was successfully cleared.') else: print('Logged out of all Azure DevOps organizations.') _check_and_clear_default_organization(organization) def _verify_token(organization, token): credentials = BasicAuthentication('', token) connection = _get_connection(organization, credentials) vstsDir = 'azext_devops.devops_sdk.' location_client = connection.get_client(vstsDir + 'v5_0.location.location_client.LocationClient') try: connection_data = location_client.get_connection_data() except Exception as ex2: logger.debug(ex2, exc_info=True) raise CLIError("Failed to authenticate using the supplied token.") # An organization with public project enabled will not throw any exception for invalid token. # Hence, handle anonymous user case here. if connection_data.authenticated_user.id == _ANONYMOUS_USER_ID: raise CLIError("Failed to authenticate using the supplied token.") def _get_pat_token(): try: token = prompt_pass('Token: ', confirm=False, help_string="The token (PAT) to authenticate with.") while len(token) <= 1: logger.warning('Please provide a PAT token.') logger.warning('If you are using CTRL + V to paste the token, it won\'t work ' 'on windows command prompt or powershell - ' 'https://github.com/microsoft/knack/issues/160.') logger.warning('Use right click or console menu to paste the token.') token = prompt_pass('Token: ', confirm=False, help_string="The token (PAT) to authenticate with.") except NoTTYException: logger.info("Getting PAT token in non-interactive mode.") token = sys.stdin.readline().rstrip() return token # Sets organization if the default is not set def _check_and_set_default_organization(organization): if organization is not None: from azext_devops.dev.common.config import azdevops_config from azext_devops.dev.common.const import DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT from .configure import configure current_org_default = None if azdevops_config.has_option(DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT): current_org_default = azdevops_config.get(DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT) if current_org_default is None or current_org_default == '': configure(defaults=['organization={}'.format(organization)]) logger.debug("Setting this organization as default. No default was set earlier.") else: logger.debug("Another organization is already set as default.") # Clears organization if the default is set to same def _check_and_clear_default_organization(organization): if organization is not None: from azext_devops.dev.common.config import azdevops_config from azext_devops.dev.common.const import DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT from .configure import configure current_org_default = None if azdevops_config.has_option(DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT): current_org_default = azdevops_config.get(DEFAULTS_SECTION, DEVOPS_ORGANIZATION_DEFAULT) if current_org_default == organization: configure(defaults=["organization="]) logger.debug("Resetting default organization.") else: logger.debug("Default org not reset. Different organization is set as default.") _ANONYMOUS_USER_ID = 'aaaaaaaa-aaaa-aaaa-aaaa-aaaaaaaaaaaa' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/extension.py000066400000000000000000000170261360605530400302430ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.services import (get_extension_client, resolve_instance) logger = get_logger(__name__) def search_extensions(search_query): """ Search extensions from marketplace """ from msrest.universal_http import ClientRequest from msrest.service_client import ServiceClient from msrest import Configuration from azext_devops.version import VERSION config = Configuration(base_url=None) config.add_user_agent('devOpsCli/{}'.format(VERSION)) client = ServiceClient(creds=None, config=config) request = ClientRequest(method='POST', url='https://marketplace.visualstudio.com/_apis/public/gallery/extensionquery') search_request = { 'assetTypes': [ 'Microsoft.VisualStudio.Services.Icons.Default', 'Microsoft.VisualStudio.Services.Icons.Branding', 'Microsoft.VisualStudio.Services.Icons.Small' ], 'filters': [ { 'criteria': [ { 'filterType': 8, 'value': 'Microsoft.VisualStudio.Services' }, { 'filterType': 8, 'value': 'Microsoft.VisualStudio.Services.Integration' }, { 'filterType': 8, 'value': 'Microsoft.VisualStudio.Services.Cloud' }, { 'filterType': 8, 'value': 'Microsoft.TeamFoundation.Server' }, { 'filterType': 8, 'value': 'Microsoft.TeamFoundation.Server.Integration' }, { 'filterType': 8, 'value': 'Microsoft.VisualStudio.Services.Cloud.Integration' }, { 'filterType': 8, 'value': 'Microsoft.VisualStudio.Services.Resource.Cloud' }, { 'filterType': 10, 'value': search_query }, { 'filterType': 12, 'value': '37888' } ], 'direction': 2, 'pageSize': 50, 'pageNumber': 1, 'sortBy': 0, 'sortOrder': 0, 'pagingToken': None } ], 'flags': 870 } headers = {'Content-Type': 'application/json' + '; charset=utf-8', 'Accept': 'application/json' + ';api-version=' + '5.0-preview.1'} response = client.send(request=request, headers=headers, content=search_request) response_json = response.json() return response_json['results'][0]['extensions'] def list_extensions(include_built_in=None, include_disabled=None, organization=None, detect=None): """ List extensions installed in an organization """ if include_built_in is None: include_built_in = True if include_disabled is None: include_disabled = True organization = resolve_instance(detect=detect, organization=organization) extension_client = get_extension_client(organization) extensions = extension_client.get_installed_extensions(include_disabled_extensions=include_disabled) if not include_built_in: filteredResult = [] for extension in extensions: if 'builtIn' not in str(extension.flags): filteredResult.append(extension) extensions = filteredResult return extensions def get_extension(publisher_id, extension_id, organization=None, detect=None): """ Get detail of single extension """ organization = resolve_instance(detect=detect, organization=organization) extension_client = get_extension_client(organization) return extension_client.get_installed_extension_by_name(publisher_name=publisher_id, extension_name=extension_id) def install_extension(publisher_id, extension_id, organization=None, detect=None): """ Install an extension """ organization = resolve_instance(detect=detect, organization=organization) extension_client = get_extension_client(organization) return extension_client.install_extension_by_name(publisher_name=publisher_id, extension_name=extension_id) def uninstall_extension(publisher_id, extension_id, organization=None, detect=None): """ Uninstall an extension """ organization = resolve_instance(detect=detect, organization=organization) extension_client = get_extension_client(organization) return extension_client.uninstall_extension_by_name(publisher_name=publisher_id, extension_name=extension_id) def enable_extension(publisher_id, extension_id, organization=None, detect=None): """ Enable an extension """ return _update_extension_state(disable=False, enable=True, publisher_id=publisher_id, extension_id=extension_id, organization=organization, detect=detect) def disable_extension(publisher_id, extension_id, organization=None, detect=None): """ Disable an extension """ return _update_extension_state(disable=True, enable=False, publisher_id=publisher_id, extension_id=extension_id, organization=organization, detect=detect) def _update_extension_state(disable, enable, publisher_id, extension_id, organization=None, detect=None): organization = resolve_instance(detect=detect, organization=organization) extension_client = get_extension_client(organization) current_extension = extension_client.get_installed_extension_by_name( publisher_name=publisher_id, extension_name=extension_id) state_from_service = str(current_extension.install_state.flags) logger.info('state received from service') logger.info(state_from_service) if disable: flags = [x.strip() for x in state_from_service.split(',')] if 'disabled' in flags: raise CLIError('Extension is already in disabled state') flags.append('disabled') updated_state = ', '.join(flags) if enable: flags = [x.strip() for x in state_from_service.split(',')] if 'disabled' not in flags: raise CLIError('Extension is already in enabled state') flags.remove('disabled') updated_state = ', '.join(flags) current_extension.install_state.flags = updated_state return extension_client.update_installed_extension(current_extension) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/feedback.py000066400000000000000000000013221360605530400277430ustar00rootroot00000000000000# coding=utf-8 # -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function def feedback(): """Displays information on how to provide feedback to the Azure DevOps CLI team. """ url = 'https://aka.ms/azure-devops-cli-feedback' print('Thank you for taking the time to share your feedback. Please submit your feedback on the following web ' + 'page: {url}'.format(url=url)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/invoke.py000066400000000000000000000133761360605530400275260ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function from knack.log import get_logger from knack.util import CLIError from azext_devops.dev.common.services import (resolve_instance, get_connection) from azext_devops.devops_sdk.client import Client logger = get_logger(__name__) # pylint: disable=too-many-locals, too-many-statements, inconsistent-return-statements, protected-access, too-many-branches def invoke(area=None, resource=None, route_parameters=None, query_parameters=None, api_version='5.0', http_method='GET', in_file=None, encoding='utf-8', media_type='application/json', accept_media_type='application/json', out_file=None, organization=None, detect=None): logger.info('route_parameter received is %s', route_parameters) version = apiVersionToFloat(api_version) organization = resolve_instance(detect=detect, organization=organization) connection = get_connection(organization) request_body = None if in_file: from os import path if not path.exists(in_file): raise CLIError('--in-file does not point to a valid file location') from azext_devops.dev.common.utils import read_file_content in_file_content = read_file_content(file_path=in_file, encoding=encoding) import json request_body = json.loads(in_file_content) resource_areas = connection._get_resource_areas(force=True) if(not area and not resource): print('Please wait a couple of seconds while we fetch all required information.') service_list = [] for x in resource_areas: if x.location_url not in service_list: service_list.append(x.location_url) resource_locations = [] for x in service_list: try: logger.info('trying to get locations from %s', x) clientMock = Client(x, connection._creds) resource_location_on_this_service = clientMock._get_resource_locations(all_host_types=True) resource_locations.extend(resource_location_on_this_service) except: # pylint: disable=bare-except logger.info('Failed to get location for %s', x) return resource_locations client_url = '' if not resource_areas: # this is for on-prem client_url = connection.base_url for resource_area in resource_areas: if resource_area.name.lower() == area.lower(): client_url = resource_area.location_url if not client_url: raise CLIError('--area is not present in current organization') client = Client(client_url, connection._creds) # there can be multiple resource/ area with different version so this version comparision is needed location_id = '' current_version = 0.0 resource_locations = client._get_resource_locations(all_host_types=True) for resource_location in resource_locations: if (resource.lower() == resource_location.resource_name.lower() and area.lower() == resource_location.area.lower()): current_maxVersion = float(resource_location.max_version) if current_maxVersion > current_version and version >= current_version: location_id = resource_location.id current_version = current_maxVersion if not location_id: raise CLIError('--resource and --api-version combination is not correct') route_values = stringToDict(route_parameters) query_values = stringToDict(query_parameters) response = client._send(http_method=http_method, location_id=location_id, version=api_version, query_parameters=query_values, route_values=route_values, media_type=media_type, accept_media_type=accept_media_type, content=request_body) logger.info('content type header') logger.info(response.headers.get("content-type")) is_content_available = True if not response.headers.get("content-type"): logger.info('Content type header is None.') is_content_available = False elif 'json' in response.headers.get("content-type") and not out_file: return response.json() # Only handle out file scenario if the content is available (content-type is not None) if is_content_available: if not out_file: raise CLIError('Response is not json, you need to provide --out-file where it can be written') import os if os.path.exists(out_file): raise CLIError('Out file already exists, please give a new name.') open(out_file, "a").close() with open(out_file, 'ab') as f: for chunk in client._client.stream_download(response, callback=None): f.write(chunk) def apiVersionToFloat(apiVersion): apiVersion = apiVersion.replace('-preview', '') return float(apiVersion) def stringToDict(inputList): if not inputList: return {} result = {} for inputSet in inputList: parts = inputSet.split('=', 1) if len(parts) != 2: raise CLIError('%s is not valid it needs to be in format param=value' % (inputSet)) key = parts[0] value = parts[1] result[key] = value return result azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/project.py000066400000000000000000000153071360605530400276750ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function import webbrowser from knack.log import get_logger from knack.util import CLIError from azext_devops.devops_sdk.v5_0.core.models import TeamProject from azext_devops.dev.common.operations import wait_for_long_running_operation from azext_devops.dev.common.services import (get_core_client, get_core_client_v51, resolve_instance) from azext_devops.dev.common.uri import uri_quote logger = get_logger(__name__) def create_project(name, organization=None, process=None, source_control='git', description=None, visibility='private', detect=None, open=False): # pylint: disable=redefined-builtin """Create a team project. :param name: Name of the new project. :type name: str :param process: Process to use. Default if not specified. :type process: str :param source_control: Source control type of the initial code repository created. :type source_control: str :param description: Description for the new project. :type description: str :param visibility: Project visibility. :type visibility: str :param open: Open the team project in the default web browser. :type open: bool :rtype: :class:` ` """ organization = resolve_instance(detect=detect, organization=organization) team_project = TeamProject() team_project.name = name team_project.description = description # private is the only allowed value by vsts right now. team_project.visibility = visibility core_client = get_core_client(organization) # get process template id process_id = None process_list = core_client.get_processes() if process is not None: process_lower = process.lower() for prc in process_list: if prc.name.lower() == process_lower: process_id = prc.id break if process_id is None: raise CLIError('Could not find a process template with name: "{}"'.format(name)) if process_id is None: for prc in process_list: if prc.is_default: process_id = prc.id break if process_id is None: raise CLIError('Could not find a default process template: "{}"'.format(name)) # build capabilities version_control_capabilities = {VERSION_CONTROL_CAPABILITY_ATTRIBUTE_NAME: source_control} process_capabilities = {PROCESS_TEMPLATE_CAPABILITY_TEMPLATE_TYPE_ID_ATTRIBUTE_NAME: process_id} team_project.capabilities = {VERSION_CONTROL_CAPABILITY_NAME: version_control_capabilities, PROCESS_TEMPLATE_CAPABILITY_NAME: process_capabilities} # queue project creation operation_reference = core_client.queue_create_project(project_to_create=team_project) operation = wait_for_long_running_operation(organization, operation_reference.id, 1) status = operation.status.lower() if status == 'failed': raise CLIError('Project creation failed.') if status == 'cancelled': raise CLIError('Project creation was cancelled.') team_project = core_client.get_project(project_id=name, include_capabilities=True) if open: _open_project(team_project) return team_project def delete_project(id, organization=None, detect=None): # pylint: disable=redefined-builtin """Delete team project. :param id: The id of the project to delete. :type id: str """ organization = resolve_instance(detect=detect, organization=organization) core_client = get_core_client(organization) operation_reference = core_client.queue_delete_project(project_id=id) operation = wait_for_long_running_operation(organization, operation_reference.id, 1) status = operation.status.lower() if status == 'failed': raise CLIError('Project deletion failed.') if status == 'cancelled': raise CLIError('Project deletion was cancelled.') print('Deleted project {}'.format(id)) return operation def show_project(project, organization=None, detect=None, open=False): # pylint: disable=redefined-builtin """Show team project. :param project: The id or name of the project to show. :type project: str :param open: Open the team project in the default web browser. :type open: bool :rtype: :class:` ` """ organization = resolve_instance(detect=detect, organization=organization) core_client = get_core_client(organization) team_project = core_client.get_project(project_id=project, include_capabilities=True) if open: _open_project(team_project) return team_project def list_projects(organization=None, top=None, skip=None, state_filter='all', continuation_token=None, get_default_team_image_url=None, detect=None): """List team projects :param top: Maximum number of results to list. :type top: int :param skip: Number of results to skip. :type skip: int :rtype: list of :class:` ` """ organization = resolve_instance(detect=detect, organization=organization) core_client = get_core_client_v51(organization) team_projects = core_client.get_projects(state_filter=state_filter, top=top, skip=skip, continuation_token=continuation_token, get_default_team_image_url=get_default_team_image_url) return team_projects def _open_project(project): """Opens the project in the default browser. """ api_segment = '/_apis/' pos = project.url.find(api_segment) if pos >= 0: url = project.url[:pos + 1] + uri_quote(project.name) logger.debug('Opening web page: %s', url) webbrowser.open_new(url=url) else: raise CLIError("Failed to open web browser, due to unrecognized url in response.") # capability keys VERSION_CONTROL_CAPABILITY_NAME = 'versioncontrol' VERSION_CONTROL_CAPABILITY_ATTRIBUTE_NAME = 'sourceControlType' PROCESS_TEMPLATE_CAPABILITY_NAME = 'processTemplate' PROCESS_TEMPLATE_CAPABILITY_TEMPLATE_TYPE_ID_ATTRIBUTE_NAME = 'templateTypeId' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/security_group.py000066400000000000000000000273111360605530400313100ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.log import get_logger from knack.util import CLIError from azext_devops.devops_sdk.exceptions import AzureDevOpsClientRequestError from azext_devops.devops_sdk.v5_0.graph.models import (JsonPatchOperation, GraphSubjectLookup, GraphSubjectLookupKey) from azext_devops.dev.common.identities import resolve_identity_as_id from azext_devops.dev.common.services import (get_graph_client, get_project_id_from_name, resolve_instance_and_project, resolve_instance) from .security_group_helper import (GraphGroupVstsCreationContext, GraphGroupMailAddressCreationContext, GraphGroupOriginIdCreationContext) logger = get_logger(__name__) def list_groups(scope='project', project=None, continuation_token=None, subject_types=None, organization=None, detect=None): """ List all the groups in a project or organization :param scope: List groups at project or organization level. :type scope: str :param continuation_token : If there are more results that can't be returned in a single page, the result set will contain a continuation token for retrieval of the next set of results. :type continuation_token: str :param subject_types: A comma separated list of user subject subtypes to reduce the retrieved results. You can give initial part of descriptor [before the dot] as a filter e.g. vssgp,aadgp :type subject_types: [str] :rtype: :class:` ` """ if scope == 'project': organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) else: organization = resolve_instance(detect=detect, organization=organization) client = get_graph_client(organization) scope_descriptor = None if project is not None: project_id = get_project_id_from_name(organization, project) scope_descriptor = get_descriptor_from_storage_key(project_id, client) if subject_types is not None: subject_types = subject_types.split(',') group_list_response = client.list_groups(scope_descriptor=scope_descriptor, continuation_token=continuation_token, subject_types=subject_types) return group_list_response def create_group(name=None, description=None, origin_id=None, email_id=None, groups=None, scope='project', project=None, organization=None, detect=None): """ :param name: Name of Azure DevOps group. :type name: str :param description: Description of Azure DevOps group. :type description: str :param origin_id: Create new group using the OriginID as a reference to an existing group from an external AD or AAD backed provider. Required if name or email-id is missing. :type origin_id: str :param email_id: Create new group using the mail address as a reference to an existing group from an external AD or AAD backed provider. Required if name or origin-id is missing. :type email_id: str :param groups: A comma separated list of descriptors referencing groups you want the newly created group to join. :type groups: [str] :param scope: Create group at project or organization level. :type scope: str :rtype: :class:` ` """ if scope == 'project': organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) else: organization = resolve_instance(detect=detect, organization=organization) client = get_graph_client(organization) if name is not None and origin_id is None and email_id is None: group_creation_context = GraphGroupVstsCreationContext(display_name=name, description=description) elif origin_id is not None and email_id is None and name is None: group_creation_context = GraphGroupOriginIdCreationContext(origin_id=origin_id) elif email_id is not None and name is None and origin_id is None: group_creation_context = GraphGroupMailAddressCreationContext(mail_address=email_id) else: raise CLIError('Provide exactly one argument out of name, origin-id or email-id.') scope_descriptor = None if project is not None: project_id = get_project_id_from_name(organization, project) scope_descriptor = get_descriptor_from_storage_key(project_id, client) if groups is not None: groups = groups.split(',') group_details = client.create_group(creation_context=group_creation_context, scope_descriptor=scope_descriptor, group_descriptors=groups) return group_details def get_group(id, organization=None, detect=None): # pylint: disable=redefined-builtin """Show group details. :param id: Descriptor of the group. :type id: str :rtype: :class:` ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_graph_client(organization) group_details = client.get_group(group_descriptor=id) return group_details def update_group(id, name=None, description=None, organization=None, detect=None): # pylint: disable=redefined-builtin """Update name AND/OR description for an Azure DevOps group. :param id: Descriptor of the group. :type id: str :param name: New name for Azure DevOps group. :type name: str :param description: New description for Azure DevOps group. :type description: str :rtype: :class:` ` """ if name is None and description is None: raise CLIError('Either name or description argument must be provided.') patch_document = [] if name is not None: patch_document.append(_create_patch_operation('replace', '/displayName', name)) if description is not None: patch_document.append(_create_patch_operation('replace', '/description', description)) organization = resolve_instance(detect=detect, organization=organization) client = get_graph_client(organization) update_group_details = client.update_group(group_descriptor=id, patch_document=patch_document) return update_group_details def delete_group(id, organization=None, detect=None): # pylint: disable=redefined-builtin """Delete an Azure DevOps group. :param id: Descriptor of the group. :type id: str """ organization = resolve_instance(detect=detect, organization=organization) client = get_graph_client(organization) delete_group_details = client.delete_group(group_descriptor=id) return delete_group_details def list_memberships(id, relationship='members', organization=None, detect=None): # pylint: disable=redefined-builtin """List memberships for a group or user. :param id: Group descriptor or User Email whose membership details are required. :type id: str :rtype: [GraphMembership] """ organization = resolve_instance(detect=detect, organization=organization) subject_descriptor = id client = get_graph_client(organization) if '@' in id or '.' not in id: id = resolve_identity_as_id(id, organization) subject_descriptor = get_descriptor_from_storage_key(id, client) direction = 'down' if relationship == 'memberof': direction = 'up' membership_list = client.list_memberships(subject_descriptor=subject_descriptor, direction=direction) lookup_keys = [] for members in membership_list: if relationship == 'memberof': key = GraphSubjectLookupKey(members.container_descriptor) else: key = GraphSubjectLookupKey(members.member_descriptor) lookup_keys.append(key) subject_lookup = GraphSubjectLookup(lookup_keys=lookup_keys) members_details = client.lookup_subjects(subject_lookup=subject_lookup) return members_details def add_membership(member_id, group_id, organization=None, detect=None): """Add membership. :param member_id: Descriptor of the group or Email Id of the user to be added. User should already be a part of the organization. Use `az devops user add` command to add an user to organization. :type member_id: str :param group_id: Descriptor of the group to which member needs to be added. :type group_id: str :rtype: :class:` ` """ organization = resolve_instance(detect=detect, organization=organization) client = get_graph_client(organization) subject_descriptor = member_id if '@' in member_id or '.' not in member_id: member_id = resolve_identity_as_id(member_id, organization) subject_descriptor = get_descriptor_from_storage_key(member_id, client) membership_details = client.add_membership(subject_descriptor=subject_descriptor, container_descriptor=group_id) lookup_keys = [] container = GraphSubjectLookupKey(membership_details.container_descriptor) subject = GraphSubjectLookupKey(membership_details.member_descriptor) lookup_keys.append(container) lookup_keys.append(subject) subject_lookup = GraphSubjectLookup(lookup_keys=lookup_keys) membership_details = client.lookup_subjects(subject_lookup=subject_lookup) return membership_details def remove_membership(member_id, group_id, organization=None, detect=None): """Remove membership. :param member_id: Descriptor of the group or Email Id of the user to be removed. :type member_id: str :param group_id: Descriptor of the group from which member needs to be removed. :type group_id: str """ organization = resolve_instance(detect=detect, organization=organization) client = get_graph_client(organization) subject_descriptor = member_id if '@' in member_id or '.' not in member_id: member_id = resolve_identity_as_id(member_id, organization) subject_descriptor = get_descriptor_from_storage_key(member_id, client) try: client.check_membership_existence(subject_descriptor=subject_descriptor, container_descriptor=group_id) membership_details = client.remove_membership(subject_descriptor=subject_descriptor, container_descriptor=group_id) except AzureDevOpsClientRequestError as ex: logger.debug(ex, exc_info=True) raise CLIError("Membership doesn't exists.") return membership_details def get_descriptor_from_storage_key(storage_key, client): descriptor = client.get_descriptor(storage_key) return descriptor def _create_patch_operation(op, path, value): patch_operation = JsonPatchOperation() patch_operation.op = op patch_operation.path = path patch_operation.value = value return patch_operation azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/security_group_helper.py000066400000000000000000000036211360605530400326450ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from azext_devops.devops_sdk.v5_0.graph.models import (GraphGroupCreationContext) class GraphGroupVstsCreationContext(GraphGroupCreationContext): """GraphGroupVstsCreationContext. :param displayName: Name of the group. :type displayName: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'} } def __init__(self, display_name, description=None): super(GraphGroupVstsCreationContext, self).__init__() self.display_name = display_name self.description = description class GraphGroupMailAddressCreationContext(GraphGroupCreationContext): """GraphGroupMailAddressCreationContext. :param mailAddress: This should be the mail address or the group in the source AD or AAD provider. :type mailAddress: str """ _attribute_map = { 'mail_address': {'key': 'mailAddress', 'type': 'str'}, } def __init__(self, mail_address): super(GraphGroupMailAddressCreationContext, self).__init__() self.mail_address = mail_address class GraphGroupOriginIdCreationContext(GraphGroupCreationContext): """GraphGroupOriginIdCreationContext. :param originId: This should be the object id or sid of the group from the source AD or AAD provider. :type originId: str """ _attribute_map = { 'origin_id': {'key': 'originId', 'type': 'str'}, } def __init__(self, origin_id): super(GraphGroupOriginIdCreationContext, self).__init__() self.origin_id = origin_id azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/security_permission.py000066400000000000000000000226451360605530400323510ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.util import CLIError from knack.log import get_logger from azext_devops.devops_sdk.v5_0.security.models import (AccessControlEntry) from azext_devops.dev.common.services import (get_security_client, resolve_instance) from azext_devops.dev.common.identities import (get_identity_descriptor_from_subject_descriptor, resolve_identity_as_identity_descriptor) from .security_permission_helper import PermissionDetails logger = get_logger(__name__) def list_namespaces(local_only=False, organization=None, detect=None): """ List all available namespaces for an organization. :param local_only: If true, retrieve only local security namespaces. :type local_only: bool """ organization = resolve_instance(detect=detect, organization=organization) client = get_security_client(organization) response = client.query_security_namespaces(local_only=local_only) return response def show_namespace(namespace_id, organization=None, detect=None): """ Show details of permissions available in each namespace. """ organization = resolve_instance(detect=detect, organization=organization) client = get_security_client(organization) response = _get_permission_types(client, namespace_id) return response def list_tokens(namespace_id, subject, token=None, recurse=False, organization=None, detect=None): """ List tokens for given user/group and namespace. :param recurse: If true and this is a hierarchical namespace, return child ACLs of the specified token. :type recurse: bool """ organization = resolve_instance(detect=detect, organization=organization) client = get_security_client(organization) subject = _resolve_subject_as_identity_descriptor(subject, organization) response = _query_permissions(client, namespace_id, subject, token, recurse) return response def show_permissions(namespace_id, subject, token, organization=None, detect=None): """ Show permissions for given token, namespace and user/group. """ organization = resolve_instance(detect=detect, organization=organization) client = get_security_client(organization) subject = _resolve_subject_as_identity_descriptor(subject, organization) list_response = _query_permissions(client, namespace_id, subject, token, False) permissions_types = _get_permission_types(client, namespace_id) resolved_permissions_response = _resolve_bits(list_response, permissions_types) response = _update_json(list_response, resolved_permissions_response) return response def reset_all_permissions(namespace_id, subject, token, organization=None, detect=None): """ Clear all permissions of this token for a user/group. """ organization = resolve_instance(detect=detect, organization=organization) client = get_security_client(organization) subject = _resolve_subject_as_identity_descriptor(subject, organization) response = client.remove_access_control_entries(security_namespace_id=namespace_id, token=token, descriptors=subject) return response def reset_permissions(namespace_id, permission_bit, subject, token, organization=None, detect=None): """ Reset permission for given permission bit(s) :param permission_bit: Permission bit or addition of permission bits which needs to be reset for given user/group and token. :type permission_bit:int """ organization = resolve_instance(detect=detect, organization=organization) client = get_security_client(organization) subject = _resolve_subject_as_identity_descriptor(subject, organization) client.remove_permission(security_namespace_id=namespace_id, permissions=permission_bit, descriptor=subject, token=token) # get the effective permission list for this namespace , token list_response = _query_permissions(client, namespace_id, subject, token, False) permissions_types = _get_permission_types(client, namespace_id) resolved_permissions_response = _resolve_bits(list_response, permissions_types, permission_bit) response = _update_json(list_response, resolved_permissions_response) return response def update_permissions(namespace_id, subject, token, merge=True, allow_bit=0, deny_bit=0, organization=None, detect=None): """ Assign allow or deny permission to given user/group. """ if allow_bit == 0 and deny_bit == 0: raise CLIError('Either --allow-bit or --deny-bit parameter should be provided.') organization = resolve_instance(detect=detect, organization=organization) client = get_security_client(organization) subject = _resolve_subject_as_identity_descriptor(subject, organization) container_object = {} aces_list = [] ace_object = AccessControlEntry(descriptor=subject, allow=allow_bit, deny=deny_bit) aces_list.append(ace_object) container_object['token'] = token if merge: container_object['merge'] = True else: container_object['merge'] = False container_object['accessControlEntries'] = aces_list client.set_access_control_entries(security_namespace_id=namespace_id, container=container_object) allow_bit = allow_bit & (~deny_bit) changed_bits = allow_bit + deny_bit list_response = _query_permissions(client, namespace_id, subject, token, False) permissions_types = _get_permission_types(client, namespace_id) resolved_permissions_response = _resolve_bits(list_response, permissions_types, changed_bits) response = _update_json(list_response, resolved_permissions_response) return response def _resolve_bits(response, permissions_types, changed_bits=0): inherited_allow = 0 inherited_deny = 0 effective_allow = 0 effective_deny = 0 if len(response) > 1 or len(response[0].aces_dictionary) > 1: raise CLIError('Multiple entries found in acesDictionary. Please filter the response by token.') acl = response[0] ace = list(acl.aces_dictionary.values())[0] allow_bit = ace.allow deny_bit = ace.deny if acl.include_extended_info is True: if ace.extended_info.effective_allow is not None: effective_allow = ace.extended_info.effective_allow if ace.extended_info.effective_deny is not None: effective_deny = ace.extended_info.effective_deny if acl.include_extended_info is True: inherited_allow = allow_bit ^ effective_allow inherited_deny = deny_bit ^ effective_deny # If changed_bits is zero, display all permissions if changed_bits == 0: total_permission_types = len(permissions_types[0].actions) last_permission_bit_value = permissions_types[0].actions[total_permission_types - 1].bit changed_bits = 2 * last_permission_bit_value - 1 permission_response = [] for item in permissions_types[0].actions: if changed_bits & item.bit: permission_value_string = None if effective_deny and item.bit & effective_deny: permission_value_string = 'Deny' if inherited_deny & item.bit: permission_value_string = 'Deny (inherited)' elif effective_allow and item.bit & effective_allow: permission_value_string = 'Allow' if inherited_allow & item.bit: permission_value_string = 'Allow (inherited)' else: permission_value_string = 'Not set' permission_obj = PermissionDetails() permission_obj.bit = item.bit permission_obj.name = item.name permission_obj.display_name = item.display_name permission_obj.effective_permission = permission_value_string permission_response.append(permission_obj) return permission_response def _update_json(original_response, permissions_response): response = [] for acl in original_response: acl_value = acl.serialize() for ace in acl_value['acesDictionary']: acl_value['acesDictionary'][ace]['resolvedPermissions'] = permissions_response response.append(acl_value) return response def _get_permission_types(client, namespace_id): response = client.query_security_namespaces(security_namespace_id=namespace_id) return response def _query_permissions(client, namespace_id, subject, token, recurse): list_response = client.query_access_control_lists(security_namespace_id=namespace_id, token=token, descriptors=subject, include_extended_info=True, recurse=recurse) return list_response def _resolve_subject_as_identity_descriptor(subject, organization): if '@' in subject: subject = resolve_identity_as_identity_descriptor(identity_filter=subject, organization=organization) elif '.' in subject: # try to solve graph subject descriptor for groups subject = get_identity_descriptor_from_subject_descriptor(subject_descriptor=subject, organization=organization) return subject azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/security_permission_helper.py000066400000000000000000000025001360605530400336740ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class PermissionDetails(Model): """PermissionDetails. :param bit: Permission bit :type bit: int :param display_ame: Display string for permission :type display_ame: str :param effective_permission: Effective permission value, Allow, Deny, Not set. :type effective_permission:str :param name: Name of permission as found in namespace details. :type name:str """ _attribute_map = { 'bit': {'key': 'bit', 'type': 'int'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'effective_permission': {'key': 'effectivePermission', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, } def __init__(self, bit=None, display_name=None, effective_permission=None, name=None): super(PermissionDetails, self).__init__() self.bit = bit self.display_name = display_name self.effective_permission = effective_permission self.name = name azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/service_endpoint.py000066400000000000000000000302071360605530400315630ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function import os from knack.log import get_logger from knack.prompting import prompt_pass from knack.util import CLIError from azext_devops.devops_sdk.v5_0.service_endpoint.models import ServiceEndpoint, EndpointAuthorization from azext_devops.dev.common.services import get_service_endpoint_client, resolve_instance_and_project from azext_devops.dev.common.const import CLI_ENV_VARIABLE_PREFIX, AZ_DEVOPS_GITHUB_PAT_ENVKEY from azext_devops.dev.common.prompting import verify_is_a_tty_or_raise_error from .const import (SERVICE_ENDPOINT_AUTHORIZATION_PERSONAL_ACCESS_TOKEN, SERVICE_ENDPOINT_TYPE_GITHUB, SERVICE_ENDPOINT_AUTHORIZATION_SERVICE_PRINCIPAL, SERVICE_ENDPOINT_TYPE_AZURE_RM) logger = get_logger(__name__) # pylint: disable=too-few-public-methods, too-many-instance-attributes class ServiceEndpointAuthorized(): _attribute_map = { 'service_endpoint_parameters': {'key': 'service_endpoint_parameters', 'type': 'ServiceEndpoint'}, 'authorized': {'key': 'authorized', 'type': 'bool'} } def __init__(self, service_endpoint_parameters, authorized): self.authorized = authorized if authorized is not None else False self.administratorsGroup = service_endpoint_parameters.administrators_group self.authorization = service_endpoint_parameters.authorization self.createdBy = service_endpoint_parameters.created_by self.data = service_endpoint_parameters.data self.description = service_endpoint_parameters.description self.groupScopeId = service_endpoint_parameters.group_scope_id self.id = service_endpoint_parameters.id self.isReady = service_endpoint_parameters.is_ready self.isShared = service_endpoint_parameters.is_shared self.name = service_endpoint_parameters.name self.operationStatus = service_endpoint_parameters.operation_status self.owner = service_endpoint_parameters.owner self.readersGroup = service_endpoint_parameters.readers_group self.type = service_endpoint_parameters.type self.url = service_endpoint_parameters.url def list_service_endpoints(organization=None, project=None, detect=None): """List service endpoints in a project. :rtype: list of :class:`VssJsonCollectionWrapper ` """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_service_endpoint_client(organization) return client.get_service_endpoints(project) def show_service_endpoint(id, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Get the details of a service endpoint. :param id: ID of the service endpoint. :type id: str :rtype: :class:`ServiceEndpoint ` """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_service_endpoint_client(organization) return client.get_service_endpoint_details(project, id) def delete_service_endpoint(id, deep=False, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Deletes service endpoint :param id: Id of the service endpoint to delete. :type id: str :param deep: Specific to AzureRM endpoint created in Automatic flow. When it is specified, this will also delete corresponding AAD application in Azure. :type deep: bool """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_service_endpoint_client(organization) return client.delete_service_endpoint(project, id, deep) def create_azurerm_service_endpoint(name, azure_rm_tenant_id, azure_rm_service_principal_id, azure_rm_subscription_id, azure_rm_subscription_name, azure_rm_service_principal_certificate_path=None, organization=None, project=None, detect=None): """ Create an Azure RM type service endpoint. :param name: Name of service endpoint to create :type name: str :param azure_rm_tenant_id: tenant id for creating azure rm service endpoint :type azure_rm_tenant_id: str :param azure_rm_service_principal_id: service principal id for creating azure rm service endpoint :type azure_rm_service_principal_id: str :param azure_rm_subscription_id: subscription id for azure rm service endpoint :type azure_rm_subscription_id: str :param azure_rm_service_principal_certificate_path: Path to (.pem) which is certificate. Create using command "openssl pkcs12 -in file.pfx -out file.pem -nodes -password pass:". More details : https://aka.ms/azure-devops-cli-azurerm-service-endpoint :type azure_rm_service_principal_certificate_path: str :param azure_rm_subscription_name: name of azure subscription for azure rm service endpoint :type azure_rm_subscription_name: str :rtype: :class:`ServiceEndpoint ` """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_service_endpoint_client(organization) service_endpoint_authorization = EndpointAuthorization( parameters={'tenantid': azure_rm_tenant_id, 'serviceprincipalid': azure_rm_service_principal_id}, scheme=SERVICE_ENDPOINT_AUTHORIZATION_SERVICE_PRINCIPAL) if azure_rm_service_principal_certificate_path is None: AZURE_RM_SP_KEY_END_VARIABLE_NAME = CLI_ENV_VARIABLE_PREFIX + 'AZURE_RM_SERVICE_PRINCIPAL_KEY' if AZURE_RM_SP_KEY_END_VARIABLE_NAME not in os.environ: error_message = 'Please specify azure service principal key in ' + AZURE_RM_SP_KEY_END_VARIABLE_NAME +\ ' environment variable in non-interactive mode or use ' +\ '--azure-rm-service-principal-certificate-path.' verify_is_a_tty_or_raise_error(error_message) azure_rm_service_principal_key = prompt_pass('Azure RM service principal key:', confirm=True) else: logger.debug('Picking Azure RM principal key from environment variable') azure_rm_service_principal_key = os.environ[AZURE_RM_SP_KEY_END_VARIABLE_NAME] service_endpoint_authorization.parameters['authenticationType'] = 'spnKey' service_endpoint_authorization.parameters['serviceprincipalkey'] = azure_rm_service_principal_key else: with open(azure_rm_service_principal_certificate_path, "r") as f: service_endpoint_authorization.parameters['authenticationType'] = 'spnCertificate' service_endpoint_authorization.parameters['servicePrincipalCertificate'] = f.read() service_endpoint_data = { 'subscriptionId': azure_rm_subscription_id, 'subscriptionName': azure_rm_subscription_name, 'environment': 'AzureCloud', 'creationMode': 'Manual' } service_endpoint_to_create = ServiceEndpoint( authorization=service_endpoint_authorization, data=service_endpoint_data, name=name, type=SERVICE_ENDPOINT_TYPE_AZURE_RM, url='https://management.azure.com/') return client.create_service_endpoint(service_endpoint_to_create, project) def create_github_service_endpoint(name, github_url, organization=None, project=None, detect=None): """ Create a GitHub service endpoint. :param name: Name of service endpoint to create :type name: str :param github_url: Url for github for creating service endpoint :type github_url: str :rtype: :class:`ServiceEndpoint ` """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_service_endpoint_client(organization) if AZ_DEVOPS_GITHUB_PAT_ENVKEY not in os.environ: error_message = 'Please pass GitHub access token in ' + AZ_DEVOPS_GITHUB_PAT_ENVKEY +\ ' environment variable in non-interactive mode.' verify_is_a_tty_or_raise_error(error_message) github_access_token = prompt_pass('GitHub access token:', confirm=True) else: logger.debug('Picking GitHub PAT from environment variable') github_access_token = os.environ[AZ_DEVOPS_GITHUB_PAT_ENVKEY] service_endpoint_authorization = EndpointAuthorization( parameters={'accessToken': github_access_token}, scheme=SERVICE_ENDPOINT_AUTHORIZATION_PERSONAL_ACCESS_TOKEN) service_endpoint_to_create = ServiceEndpoint( authorization=service_endpoint_authorization, name=name, type=SERVICE_ENDPOINT_TYPE_GITHUB, url=github_url) return client.create_service_endpoint(service_endpoint_to_create, project) def create_service_endpoint(service_endpoint_configuration, encoding='utf-8', organization=None, project=None, detect=None): """Create a service endpoint using configuration file. :param name: Name of service endpoint to create :type name: str :param service_endpoint_configuration: Configuration file with service endpoint request. :type service_endpoint_configuration: str :rtype: :class:`ServiceEndpoint ` """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_service_endpoint_client(organization) from azext_devops.dev.common.utils import read_file_content in_file_content = read_file_content(file_path=service_endpoint_configuration, encoding=encoding) import json service_endpoint_to_create = json.loads(in_file_content) return client.create_service_endpoint(service_endpoint_to_create, project) def update_service_endpoint(id, enable_for_all=None, organization=None, # pylint: disable=redefined-builtin project=None, detect=None): """Update a service endpoint :param id: ID of the service endpoint. :type id: str """ if enable_for_all is None: raise CLIError('Atleast one property to be updated must be specified.') organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) client = get_service_endpoint_client(organization) se = client.get_service_endpoint_details(project, id) # set authorization if get service endpoint succeeded from azext_devops.dev.pipelines.pipeline_utils import set_authorize_resource, get_authorize_resource set_authorize_resource( authorized=enable_for_all, res_id=se.id, name=se.name, res_type='endpoint', organization=organization, project=project) authorized = get_authorize_resource(res_id=se.id, res_type='endpoint', organization=organization, project=project) return ServiceEndpointAuthorized(service_endpoint_parameters=se, authorized=authorized) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/team.py000066400000000000000000000114161360605530400271520ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.util import CLIError from azext_devops.devops_sdk.v5_0.core.models import WebApiTeam from azext_devops.dev.common.services import (get_core_client, resolve_instance_and_project) def create_team(name, description=None, organization=None, project=None, detect=None): """Create a team. :param name: Name of the new team. :type name: str :param description: Description of the new team. :type description: str :rtype: :class:` ` """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) core_client = get_core_client(organization) team_to_create = WebApiTeam(name=name, description=description) return core_client.create_team(team=team_to_create, project_id=project) def delete_team(id, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Delete a team. :param id: The id of the team to delete. :type id: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) core_client = get_core_client(organization) return core_client.delete_team(team_id=id, project_id=project) def get_team(team, organization=None, project=None, detect=None): """Show team details. :param team: The name or id of the team to show. :type team: str :rtype: :class:` ` """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) core_client = get_core_client(organization) return core_client.get_team(team_id=team, project_id=project) def get_teams(top=None, skip=None, organization=None, project=None, detect=None): """List all teams in a project. :param top: Maximum number of teams to return. :type top: int :param skip: Number of teams to skip. :type skip: int :rtype: [WebApiTeam] """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) core_client = get_core_client(organization) return core_client.get_teams(top=top, skip=skip, project_id=project) def get_team_members(team, top=None, skip=None, organization=None, project=None, detect=None): """List members of a team. :param team: The name or id of the team to show members of. :type team: str :param top: Maximum number of members to return. :type top: int :param skip: Number of members to skip. :type skip: int :rtype: [IdentityRef] """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) core_client = get_core_client(organization) return core_client.get_team_members_with_extended_properties(team_id=team, top=top, skip=skip, project_id=project) def update_team(team, name=None, description=None, organization=None, project=None, detect=None): """Update a team's name and/or description. :param team: The name or id of the team to be updated. :type team: str :param name: New name of the team. :type name: str :param description: New description of the team. :type description: str :rtype: :class:` ` """ if name is None and description is None: raise CLIError('Either name or description argument must be provided.') organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) core_client = get_core_client(organization) updated_team_data = WebApiTeam(name=name, description=description) return core_client.update_team(team_data=updated_team_data, project_id=project, team_id=team) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/user.py000066400000000000000000000122371360605530400272040ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from knack.util import CLIError from azext_devops.devops_sdk.v5_0.member_entitlement_management.models import (AccessLevel, GraphUser, JsonPatchOperation) from azext_devops.dev.common.services import (get_member_entitlement_management_client, resolve_instance) from azext_devops.dev.common.identities import resolve_identity_as_id def get_user_entitlements(top=100, skip=None, organization=None, detect=None): """List users in an organization [except for users which are added via AAD groups]. :param int top: Maximum number of users to return. Max value is 10000. :param int skip: Offset: Number of records to skip. :rtype: [UserEntitlement] """ organization = resolve_instance(detect=detect, organization=organization) client = get_member_entitlement_management_client(organization) user_entitlements = client.get_user_entitlements(top=top, skip=skip) return user_entitlements def get_user_entitlement(user, organization=None, detect=None): """Show user details. :param user: Email ID or ID of the user. :type user: str :rtype: UserEntitlement """ organization = resolve_instance(detect=detect, organization=organization) if '@' in user: user = resolve_identity_as_id(user, organization) client = get_member_entitlement_management_client(organization) user_entitlement_details = client.get_user_entitlement(user_id=user) return user_entitlement_details def delete_user_entitlement(user, organization=None, detect=None): """Remove user from an organization. :param user: Email ID or ID of the user. :type user: str """ organization = resolve_instance(detect=detect, organization=organization) if '@' in user: user = resolve_identity_as_id(user, organization) client = get_member_entitlement_management_client(organization) delete_user_entitlement_details = client.delete_user_entitlement(user_id=user) return delete_user_entitlement_details def update_user_entitlement(user, license_type, organization=None, detect=None): """Update license type for a user. :param user: Email ID or ID of the user. :type user: str :param license_type: License type for the user. :type license_type: str :rtype: UserEntitlementsPatchResponse """ patch_document = [] value = {} value['accountLicenseType'] = license_type patch_document.append(_create_patch_operation('replace', '/accessLevel', value)) organization = resolve_instance(detect=detect, organization=organization) if '@' in user: user = resolve_identity_as_id(user, organization) client = get_member_entitlement_management_client(organization) user_entitlement_update = client.update_user_entitlement(document=patch_document, user_id=user) if user_entitlement_update.is_success is False and \ user_entitlement_update.operation_results[0].errors[0] is not None: raise CLIError(user_entitlement_update.operation_results[0].errors[0]['value']) return user_entitlement_update.user_entitlement def add_user_entitlement(email_id, license_type, send_email_invite=None, organization=None, detect=None): """Add user. :param email_id: Email ID of the user. :type email_id: str :param license_type: License type for the user. :type license_type: str :rtype: UserEntitlementsPatchResponse """ if send_email_invite is None: send_email_invite = True do_not_send_invite = not send_email_invite organization = resolve_instance(detect=detect, organization=organization) client = get_member_entitlement_management_client(organization) user_access_level = AccessLevel() user_access_level.account_license_type = license_type graph_user = GraphUser() graph_user.subject_kind = 'user' graph_user.principal_name = email_id value = {} value['accessLevel'] = user_access_level value['extensions'] = [] value['projectEntitlements'] = [] value['user'] = graph_user patch_document = [] patch_document.append(_create_patch_operation('add', '', value)) user_entitlement = client.update_user_entitlements(document=patch_document, do_not_send_invite_for_new_users=do_not_send_invite) if user_entitlement.have_results_succeeded is False and user_entitlement.results[0].errors[0] is not None: raise CLIError(user_entitlement.results[0].errors[0]['value']) return user_entitlement.results[0].result def _create_patch_operation(op, path, value): patch_operation = JsonPatchOperation() patch_operation.op = op patch_operation.path = path patch_operation.value = value return patch_operation azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/dev/team/wiki.py000066400000000000000000000261441360605530400271730ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import webbrowser from knack.util import CLIError from azext_devops.dev.common.services import (get_wiki_client, get_git_client, get_project_id_from_name, resolve_instance, resolve_instance_and_project, resolve_instance_project_and_repo) _DEFAULT_PAGE_ADD_MESSAGE = 'Added a new page using Azure DevOps CLI' _DEFAULT_PAGE_UPDATE_MESSAGE = 'Updated the page using Azure DevOps CLI' _DEFAULT_PAGE_DELETE_MESSAGE = 'Deleted the page using Azure DevOps CLI' def create_wiki(name=None, wiki_type='projectwiki', mapped_path=None, version=None, organization=None, project=None, repository=None, detect=None): """Create a wiki. :param name: Name of the new wiki. :type name: str :param wiki_type: Type of wiki to create. :type wiki_type: str :param version: [Required for codewiki type] Repository branch name to publish the code wiki from. :type version: str :param mapped_path: [Required for codewiki type] Mapped path of the new wiki e.g. '/' to publish from root of repository. :type mapped_path: str :param repository: [Required for codewiki type] Name or ID of the repository to publish the wiki from. :type repository: str """ repository_id = None if wiki_type == 'codewiki': if not name: raise CLIError('--name is required for wiki type \'codewiki\'') organization, project, repository = resolve_instance_project_and_repo(detect=detect, organization=organization, project=project, repo=repository, repo_required=True) repository_id = _get_repository_id_from_name(organization=organization, project=project, repository=repository) else: organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) wiki_client = get_wiki_client(organization) from azext_devops.devops_sdk.v5_0.wiki.models import WikiCreateParametersV2 wiki_params = WikiCreateParametersV2() wiki_params.name = name wiki_params.type = wiki_type project_id = get_project_id_from_name(organization=organization, project=project) wiki_params.project_id = project_id wiki_params.repository_id = repository_id if mapped_path: wiki_params.mapped_path = mapped_path if version: from azext_devops.devops_sdk.v5_0.wiki.models import GitVersionDescriptor version_descriptor = GitVersionDescriptor() version_descriptor.version = version wiki_params.version = version_descriptor return wiki_client.create_wiki(wiki_create_params=wiki_params, project=project) def delete_wiki(wiki, organization=None, project=None, detect=None): """Delete a wiki. :param wiki: Name or Id of the wiki to delete. :type wiki: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) wiki_client = get_wiki_client(organization) return wiki_client.delete_wiki(wiki_identifier=wiki, project=project) def list_wiki(scope='project', organization=None, project=None, detect=None): """List all the wikis in a project or organization. :param scope: List the wikis at project or organization level. :type scope: str """ if scope == 'project': organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) else: organization = resolve_instance(detect=detect, organization=organization) wiki_client = get_wiki_client(organization) return wiki_client.get_all_wikis(project=project) def show_wiki(wiki, open=False, organization=None, project=None, detect=None): # pylint: disable=redefined-builtin """Show details of a wiki. :param wiki: Name or Id of the wiki. :type wiki: str :param open: Open the wiki in your web browser. :type open: bool """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) wiki_client = get_wiki_client(organization) wiki_object = wiki_client.get_wiki(wiki_identifier=wiki, project=project) if open: webbrowser.open_new(url=wiki_object.remote_url) return wiki_object def add_page(wiki, path, comment=_DEFAULT_PAGE_ADD_MESSAGE, content=None, file_path=None, encoding='utf-8', organization=None, project=None, detect=None): """Add a new page. :param wiki: Name or Id of the wiki. :type wiki: str :param path: Path of the wiki page. :type path: str :param content: Content of the wiki page. Ignored if --file-path is specified. :type content: str :param file_path: Path of the file input if content is specified in the file. :type file_path: str :param encoding: Encoding of the file. Used in conjunction with --file-path parameter. :type encoding: str :param comment: Comment in the commit message of file add operation. :type comment: str """ if not content and not file_path: raise CLIError('Either --file-path or --content must be specified.') organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) wiki_client = get_wiki_client(organization) from azext_devops.devops_sdk.v5_0.wiki.models import WikiPageCreateOrUpdateParameters parameters = WikiPageCreateOrUpdateParameters() if content: parameters.content = content elif file_path: from azext_devops.dev.common.utils import read_file_content parameters.content = read_file_content(file_path=file_path, encoding=encoding) return wiki_client.create_or_update_page(parameters=parameters, wiki_identifier=wiki, project=project, path=path, version=None, comment=comment) def update_page(wiki, path, version, comment=_DEFAULT_PAGE_UPDATE_MESSAGE, content=None, file_path=None, encoding='utf-8', organization=None, project=None, detect=None): """Edit a page. :param wiki: Name or Id of the wiki. :type wiki: str :param path: Path of the wiki page. :type path: str :param content: Content of the wiki page. Ignored if --file-path is specified. :type content: str :param file_path: Path of the file input if content is specified in the file. :type file_path: str :param encoding: Encoding of the file. Used in conjunction with --file-path parameter. :type encoding: str :param comment: Comment in the commit message of file edit operation. :type comment: str :param version: Version (ETag) of file to edit. :type version: str """ if not content and not file_path: raise CLIError('Either --file-path or --content must be specified.') organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) wiki_client = get_wiki_client(organization) from azext_devops.devops_sdk.v5_0.wiki.models import WikiPageCreateOrUpdateParameters parameters = WikiPageCreateOrUpdateParameters() if content: parameters.content = content elif file_path: from azext_devops.dev.common.utils import read_file_content parameters.content = read_file_content(file_path=file_path, encoding=encoding) return wiki_client.create_or_update_page(parameters=parameters, wiki_identifier=wiki, project=project, path=path, version=version, comment=comment) def get_page(wiki, path, version=None, open=False, # pylint: disable=redefined-builtin include_content=False, organization=None, project=None, detect=None): """Get the content of a page or open a page. :param wiki: Name or Id of the wiki. :type wiki: str :param path: Path of the wiki page. :type path: str :param version: Version (ETag) of the wiki page. :type version: str :param include_content: Include content of the page. :type include_content: str :param open: Open the wiki page in your web browser. :type open: bool """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) wiki_client = get_wiki_client(organization) page_object = wiki_client.get_page( wiki_identifier=wiki, project=project, path=path, recursion_level=None, version_descriptor=version, include_content=include_content) if open: webbrowser.open_new(url=page_object.page.remote_url) return page_object def delete_page(wiki, path, comment=_DEFAULT_PAGE_DELETE_MESSAGE, organization=None, project=None, detect=None): """Delete a page. :param wiki: Name or Id of the wiki. :type wiki: str :param path: Path of the wiki page. :type path: str :param comment: Comment in the commit message of delete operation. :type comment: str """ organization, project = resolve_instance_and_project(detect=detect, organization=organization, project=project) wiki_client = get_wiki_client(organization) return wiki_client.delete_page(wiki_identifier=wiki, path=path, comment=comment, project=project) def _get_repository_id_from_name(organization, project, repository): git_client = get_git_client(organization) repository = git_client.get_repository(project=project, repository_id=repository) return repository.id azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/000077500000000000000000000000001360605530400263045ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/__init__.py000066400000000000000000000006301360605530400304140ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import pkg_resources pkg_resources.declare_namespace(__name__) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/_file_cache.py000066400000000000000000000141021360605530400310550ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import base64 import json import logging import os import time try: import collections.abc as collections except ImportError: import collections logger = logging.getLogger(__name__) class FileCache(collections.MutableMapping): """A simple dict-like class that is backed by a JSON file. All direct modifications will save the file. Indirect modifications should be followed by a call to `save_with_retry` or `save`. """ def __init__(self, file_name, max_age=0): super(FileCache, self).__init__() self.file_name = file_name self.max_age = max_age self.data = {} self.initial_load_occurred = False def load(self): self.data = {} try: if os.path.isfile(self.file_name): if self.max_age > 0 and os.stat(self.file_name).st_mtime + self.max_age < time.time(): logger.debug('Cache file expired: %s', self.file_name) os.remove(self.file_name) else: logger.debug('Loading cache file: %s', self.file_name) self.data = get_file_json(self.file_name, throw_on_empty=False) or {} else: logger.debug('Cache file does not exist: %s', self.file_name) except Exception as ex: logger.debug(ex, exc_info=True) # file is missing or corrupt so attempt to delete it try: os.remove(self.file_name) except Exception as ex2: logger.debug(ex2, exc_info=True) self.initial_load_occurred = True def save(self): self._check_for_initial_load() self._save() def _save(self): if self.file_name: with os.fdopen(os.open(self.file_name, os.O_RDWR | os.O_CREAT | os.O_TRUNC, 0o600), 'w+') as cred_file: cred_file.write(json.dumps(self.data)) def save_with_retry(self, retries=5): self._check_for_initial_load() for _ in range(retries - 1): try: self.save() break except OSError: time.sleep(0.1) else: self.save() def clear(self): if os.path.isfile(self.file_name): logger.info("Deleting file: " + self.file_name) os.remove(self.file_name) else: logger.info("File does not exist: " + self.file_name) def get(self, key, default=None): self._check_for_initial_load() return self.data.get(key, default) def __getitem__(self, key): self._check_for_initial_load() return self.data.setdefault(key, {}) def __setitem__(self, key, value): self._check_for_initial_load() self.data[key] = value self.save_with_retry() def __delitem__(self, key): self._check_for_initial_load() del self.data[key] self.save_with_retry() def __iter__(self): self._check_for_initial_load() return iter(self.data) def __len__(self): self._check_for_initial_load() return len(self.data) def _check_for_initial_load(self): if not self.initial_load_occurred: self.load() def get_cache_dir(): azure_devops_cache_dir = os.getenv('AZURE_DEVOPS_CACHE_DIR', None)\ or os.path.expanduser(os.path.join('~', '.azure-devops', 'python-sdk', 'cache')) if not os.path.exists(azure_devops_cache_dir): os.makedirs(azure_devops_cache_dir) return azure_devops_cache_dir DEFAULT_MAX_AGE = 3600 * 12 # 12 hours DEFAULT_CACHE_DIR = get_cache_dir() def get_cache(name, max_age=DEFAULT_MAX_AGE, cache_dir=DEFAULT_CACHE_DIR): file_name = os.path.join(cache_dir, name + '.json') return FileCache(file_name, max_age) OPTIONS_CACHE = get_cache('options') RESOURCE_CACHE = get_cache('resources') # Code below this point from azure-cli-core # https://github.com/Azure/azure-cli/blob/master/src/azure-cli-core/azure/cli/core/util.py def get_file_json(file_path, throw_on_empty=True, preserve_order=False): content = read_file_content(file_path) if not content and not throw_on_empty: return None return shell_safe_json_parse(content, preserve_order) def read_file_content(file_path, allow_binary=False): from codecs import open as codecs_open # Note, always put 'utf-8-sig' first, so that BOM in WinOS won't cause trouble. for encoding in ['utf-8-sig', 'utf-8', 'utf-16', 'utf-16le', 'utf-16be']: try: with codecs_open(file_path, encoding=encoding) as f: logger.debug("attempting to read file %s as %s", file_path, encoding) return f.read() except UnicodeDecodeError: if allow_binary: with open(file_path, 'rb') as input_file: logger.debug("attempting to read file %s as binary", file_path) return base64.b64encode(input_file.read()).decode("utf-8") else: raise except UnicodeError: pass raise ValueError('Failed to decode file {} - unknown decoding'.format(file_path)) def shell_safe_json_parse(json_or_dict_string, preserve_order=False): """ Allows the passing of JSON or Python dictionary strings. This is needed because certain JSON strings in CMD shell are not received in main's argv. This allows the user to specify the alternative notation, which does not have this problem (but is technically not JSON). """ try: if not preserve_order: return json.loads(json_or_dict_string) from collections import OrderedDict return json.loads(json_or_dict_string, object_pairs_hook=OrderedDict) except ValueError: import ast return ast.literal_eval(json_or_dict_string) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/_models.py000066400000000000000000000142471360605530400303100ustar00rootroot00000000000000# coding=utf-8 # -------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is # regenerated. # -------------------------------------------------------------------------- from msrest.serialization import Model class ApiResourceLocation(Model): """ApiResourceLocation. """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'area': {'key': 'area', 'type': 'str'}, 'resource_name': {'key': 'resourceName', 'type': 'str'}, 'route_template': {'key': 'routeTemplate', 'type': 'str'}, 'resource_version': {'key': 'resourceVersion', 'type': 'int'}, 'min_version': {'key': 'minVersion', 'type': 'float'}, 'max_version': {'key': 'maxVersion', 'type': 'float'}, 'released_version': {'key': 'releasedVersion', 'type': 'str'}, } def __init__(self, id=None, area=None, resource_name=None, route_template=None, resource_version=None, min_version=None, max_version=None, released_version=None): super(ApiResourceLocation, self).__init__() self.id = id self.area = area self.resource_name = resource_name self.route_template = route_template self.resource_version = resource_version self.min_version = min_version self.max_version = max_version self.released_version = released_version class CustomerIntelligenceEvent(Model): """CustomerIntelligenceEvent. :param area: :type area: str :param feature: :type feature: str :param properties: :type properties: dict """ _attribute_map = { 'area': {'key': 'area', 'type': 'str'}, 'feature': {'key': 'feature', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'} } def __init__(self, area=None, feature=None, properties=None): super(CustomerIntelligenceEvent, self).__init__() self.area = area self.feature = feature self.properties = properties class ImproperException(Model): """ImproperException. :param message: :type message: str """ _attribute_map = { 'message': {'key': 'Message', 'type': 'str'} } def __init__(self, message=None): super(ImproperException, self).__init__() self.message = message class ResourceAreaInfo(Model): """ResourceAreaInfo. :param id: :type id: str :param location_url: :type location_url: str :param name: :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'location_url': {'key': 'locationUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, location_url=None, name=None): super(ResourceAreaInfo, self).__init__() self.id = id self.location_url = location_url self.name = name class SystemException(Model): """SystemException. :param class_name: :type class_name: str :param inner_exception: :type inner_exception: :class:`SystemException` :param message: :type message: str """ _attribute_map = { 'class_name': {'key': 'ClassName', 'type': 'str'}, 'message': {'key': 'Message', 'type': 'str'}, 'inner_exception': {'key': 'InnerException', 'type': 'SystemException'} } def __init__(self, class_name=None, message=None, inner_exception=None): super(SystemException, self).__init__() self.class_name = class_name self.message = message self.inner_exception = inner_exception class VssJsonCollectionWrapperBase(Model): """VssJsonCollectionWrapperBase. :param count: :type count: int """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'} } def __init__(self, count=None): super(VssJsonCollectionWrapperBase, self).__init__() self.count = count class VssJsonCollectionWrapper(VssJsonCollectionWrapperBase): """VssJsonCollectionWrapper. :param count: :type count: int :param value: :type value: object """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, count=None, value=None): super(VssJsonCollectionWrapper, self).__init__(count=count) self.value = value class WrappedException(Model): """WrappedException. :param exception_id: :type exception_id: str :param inner_exception: :type inner_exception: :class:`WrappedException` :param message: :type message: str :param type_name: :type type_name: str :param type_key: :type type_key: str :param error_code: :type error_code: int :param event_id: :type event_id: int :param custom_properties: :type custom_properties: dict """ _attribute_map = { 'exception_id': {'key': '$id', 'type': 'str'}, 'inner_exception': {'key': 'innerException', 'type': 'WrappedException'}, 'message': {'key': 'message', 'type': 'str'}, 'type_name': {'key': 'typeName', 'type': 'str'}, 'type_key': {'key': 'typeKey', 'type': 'str'}, 'error_code': {'key': 'errorCode', 'type': 'int'}, 'event_id': {'key': 'eventId', 'type': 'int'}, 'custom_properties': {'key': 'customProperties', 'type': '{object}'} } def __init__(self, exception_id=None, inner_exception=None, message=None, type_name=None, type_key=None, error_code=None, event_id=None, custom_properties=None): super(WrappedException, self).__init__() self.exception_id = exception_id self.inner_exception = inner_exception self.message = message self.type_name = type_name self.type_key = type_key self.error_code = error_code self.event_id = event_id self.custom_properties = custom_properties __all__ = [ 'ApiResourceLocation', 'CustomerIntelligenceEvent', 'ImproperException', 'ResourceAreaInfo', 'SystemException', 'VssJsonCollectionWrapperBase', 'VssJsonCollectionWrapper', 'WrappedException' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/client.py000066400000000000000000000352631360605530400301450ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from __future__ import print_function import logging import os import re import uuid from msrest import Deserializer, Serializer from msrest.exceptions import DeserializationError, SerializationError from msrest.universal_http import ClientRequest from msrest.service_client import ServiceClient from .exceptions import AzureDevOpsAuthenticationError, AzureDevOpsClientRequestError, AzureDevOpsServiceError from .client_configuration import ClientConfiguration from . import _models from ._file_cache import OPTIONS_CACHE as OPTIONS_FILE_CACHE logger = logging.getLogger(__name__) class Client(object): """Client. :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): self.config = ClientConfiguration(base_url) self.config.credentials = creds self._client = ServiceClient(creds, config=self.config) _base_client_models = {k: v for k, v in _models.__dict__.items() if isinstance(v, type)} self._base_deserialize = Deserializer(_base_client_models) self._base_serialize = Serializer(_base_client_models) self._all_host_types_locations = None self._locations = None self._suppress_fedauth_redirect = True self._force_msa_pass_through = True self.normalized_url = Client._normalize_url(base_url) def add_user_agent(self, user_agent): if user_agent is not None: self.config.add_user_agent(user_agent) def _send_request(self, request, headers=None, content=None, media_type=None, **operation_config): """Prepare and send request object according to configuration. :param ClientRequest request: The request object to be sent. :param dict headers: Any headers to add to the request. :param content: Any body data to add to the request. :param config: Any specific config overrides """ if (TRACE_ENV_VAR in os.environ and os.environ[TRACE_ENV_VAR] == 'true')\ or (TRACE_ENV_VAR_COMPAT in os.environ and os.environ[TRACE_ENV_VAR_COMPAT] == 'true'): print(request.method + ' ' + request.url) logger.debug('%s %s', request.method, request.url) if media_type is not None and media_type == 'application/json': logger.debug('Request content: %s', content) response = self._client.send(request=request, headers=headers, content=content, **operation_config) if ('Content-Type' in response.headers and response.headers['Content-Type'].startswith('application/json')): logger.debug('Response content: %s', response.content) if response.status_code < 200 or response.status_code >= 300: self._handle_error(request, response) return response def _send(self, http_method, location_id, version, route_values=None, query_parameters=None, content=None, media_type='application/json', accept_media_type='application/json', additional_headers=None): request = self._create_request_message(http_method=http_method, location_id=location_id, route_values=route_values, query_parameters=query_parameters) negotiated_version = self._negotiate_request_version( self._get_resource_location(location_id), version) if version != negotiated_version: logger.info("Negotiated api version from '%s' down to '%s'. This means the client is newer than the server.", version, negotiated_version) else: logger.debug("Api version '%s'", negotiated_version) # Construct headers headers = {'Content-Type': media_type + '; charset=utf-8', 'Accept': accept_media_type + ';api-version=' + negotiated_version} if additional_headers is not None: for key in additional_headers: headers[key] = str(additional_headers[key]) if self.config.additional_headers is not None: for key in self.config.additional_headers: headers[key] = self.config.additional_headers[key] if self._suppress_fedauth_redirect: headers['X-TFS-FedAuthRedirect'] = 'Suppress' if self._force_msa_pass_through: headers['X-VSS-ForceMsaPassThrough'] = 'true' if Client._session_header_key in Client._session_data and Client._session_header_key not in headers: headers[Client._session_header_key] = Client._session_data[Client._session_header_key] response = self._send_request(request=request, headers=headers, content=content, media_type=media_type) if Client._session_header_key in response.headers: Client._session_data[Client._session_header_key] = response.headers[Client._session_header_key] return response def _unwrap_collection(self, response): if response.headers.get("transfer-encoding") == 'chunked': wrapper = self._base_deserialize.deserialize_data(response.json(), 'VssJsonCollectionWrapper') else: wrapper = self._base_deserialize('VssJsonCollectionWrapper', response) collection = wrapper.value return collection def _create_request_message(self, http_method, location_id, route_values=None, query_parameters=None): location = self._get_resource_location(location_id) if location is None: raise ValueError('API resource location ' + location_id + ' is not registered on ' + self.config.base_url + '.') if route_values is None: route_values = {} route_values['area'] = location.area route_values['resource'] = location.resource_name route_template = self._remove_optional_route_parameters(location.route_template, route_values) logger.debug('Route template: %s', location.route_template) url = self._client.format_url(route_template, **route_values) request = ClientRequest(method=http_method, url=self._client.format_url(url)) if query_parameters: request.format_parameters(query_parameters) return request @staticmethod def _remove_optional_route_parameters(route_template, route_values): new_template = '' route_template = route_template.replace('{*', '{') for path_segment in route_template.split('/'): if (len(path_segment) <= 2 or not path_segment[0] == '{' or not path_segment[len(path_segment) - 1] == '}' or path_segment[1:len(path_segment) - 1] in route_values): new_template = new_template + '/' + path_segment return new_template def _get_resource_location(self, location_id): if self.config.base_url not in Client._locations_cache: Client._locations_cache[self.config.base_url] = self._get_resource_locations(all_host_types=False) for location in Client._locations_cache[self.config.base_url]: if location.id == location_id: return location def _get_resource_locations(self, all_host_types): # Check local client's cached Options first if all_host_types: if self._all_host_types_locations is not None: return self._all_host_types_locations elif self._locations is not None: return self._locations # Next check for options cached on disk if not all_host_types and OPTIONS_FILE_CACHE[self.normalized_url]: try: logger.debug('File cache hit for options on: %s', self.normalized_url) self._locations = self._base_deserialize.deserialize_data(OPTIONS_FILE_CACHE[self.normalized_url], '[ApiResourceLocation]') return self._locations except DeserializationError as ex: logger.debug(ex, exc_info=True) else: logger.debug('File cache miss for options on: %s', self.normalized_url) # Last resort, make the call to the server options_uri = self._combine_url(self.config.base_url, '_apis') request = ClientRequest(method='OPTIONS', url=self._client.format_url(options_uri)) if all_host_types: query_parameters = {'allHostTypes': True} request.format_parameters(query_parameters) headers = {'Accept': 'application/json'} if self._suppress_fedauth_redirect: headers['X-TFS-FedAuthRedirect'] = 'Suppress' if self._force_msa_pass_through: headers['X-VSS-ForceMsaPassThrough'] = 'true' response = self._send_request(request, headers=headers) wrapper = self._base_deserialize('VssJsonCollectionWrapper', response) if wrapper is None: raise AzureDevOpsClientRequestError("Failed to retrieve resource locations from: {}".format(options_uri)) collection = wrapper.value returned_locations = self._base_deserialize('[ApiResourceLocation]', collection) if all_host_types: self._all_host_types_locations = returned_locations else: self._locations = returned_locations try: OPTIONS_FILE_CACHE[self.normalized_url] = wrapper.value except SerializationError as ex: logger.debug(ex, exc_info=True) return returned_locations @staticmethod def _negotiate_request_version(location, version): if location is None or version is None: return version pattern = r'(\d+(\.\d)?)(-preview(.(\d+))?)?' match = re.match(pattern, version) requested_api_version = match.group(1) if requested_api_version is not None: requested_api_version = float(requested_api_version) if location.min_version > requested_api_version: # Client is older than the server. The server no longer supports this # resource (deprecated). return elif location.max_version < requested_api_version: # Client is newer than the server. Negotiate down to the latest version # on the server negotiated_version = str(location.max_version) if float(location.released_version) < location.max_version: negotiated_version += '-preview' return negotiated_version else: # We can send at the requested api version. Make sure the resource version # is not bigger than what the server supports negotiated_version = match.group(1) is_preview = match.group(3) is not None if is_preview: negotiated_version += '-preview' if match.group(5) is not None: if location.resource_version < int(match.group(5)): negotiated_version += '.' + str(location.resource_version) else: negotiated_version += '.' + match.group(5) return negotiated_version @staticmethod def _combine_url(part1, part2): return part1.rstrip('/') + '/' + part2.strip('/') def _handle_error(self, request, response): content_type = response.headers.get('Content-Type') error_message = '' if content_type is None or content_type.find('text/plain') < 0: try: wrapped_exception = self._base_deserialize('WrappedException', response) if wrapped_exception is not None and wrapped_exception.message is not None: raise AzureDevOpsServiceError(wrapped_exception) else: # System exceptions from controllers are not returning wrapped exceptions. # Following code is to handle this unusual exception json case. # TODO: dig into this. collection_wrapper = self._base_deserialize('VssJsonCollectionWrapper', response) if collection_wrapper is not None and collection_wrapper.value is not None: wrapped_exception = self._base_deserialize('ImproperException', collection_wrapper.value) if wrapped_exception is not None and wrapped_exception.message is not None: raise AzureDevOpsClientRequestError(wrapped_exception.message) # if we get here we still have not raised an exception, try to deserialize as a System Exception system_exception = self._base_deserialize('SystemException', response) if system_exception is not None and system_exception.message is not None: raise AzureDevOpsClientRequestError(system_exception.message) except DeserializationError: pass elif response.content is not None: error_message = response.content.decode("utf-8") + ' ' if response.status_code == 401: full_message_format = '{error_message}The requested resource requires user authentication: {url}' raise AzureDevOpsAuthenticationError(full_message_format.format(error_message=error_message, url=request.url)) else: full_message_format = '{error_message}Operation returned a {status_code} status code.' raise AzureDevOpsClientRequestError(full_message_format.format(error_message=error_message, status_code=response.status_code)) def _get_continuation_token(self, response): if self._continuation_token_header_key in response.headers: return response.headers[self._continuation_token_header_key] else: return None @staticmethod def _normalize_url(url): return url.rstrip('/').lower() _locations_cache = {} _continuation_token_header_key = 'X-MS-ContinuationToken' _session_header_key = 'X-TFS-Session' _session_data = {_session_header_key: str(uuid.uuid4())} TRACE_ENV_VAR_COMPAT = 'vsts_python_print_urls' TRACE_ENV_VAR = 'azure_devops_python_print_urls' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/client_configuration.py000066400000000000000000000014021360605530400330600ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from msrest import Configuration from .version import VERSION class ClientConfiguration(Configuration): def __init__(self, base_url=None): if not base_url: raise ValueError('base_url is required.') base_url = base_url.rstrip('/') super(ClientConfiguration, self).__init__(base_url) self.add_user_agent('azure-devops/{}'.format(VERSION)) self.additional_headers = {} azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/connection.py000066400000000000000000000145641360605530400310270ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- import logging from msrest.service_client import ServiceClient from ._file_cache import RESOURCE_CACHE as RESOURCE_FILE_CACHE from .client_configuration import ClientConfiguration from .exceptions import AzureDevOpsClientRequestError from .released.client_factory import ClientFactory from .v5_0.location.location_client import LocationClient from .v5_0.client_factory import ClientFactoryV5_0 from .v5_1.client_factory import ClientFactoryV5_1 logger = logging.getLogger(__name__) class Connection(object): """Connection. """ def __init__(self, base_url=None, creds=None, user_agent=None): self._config = ClientConfiguration(base_url) self._config.credentials = creds self._addition_user_agent = user_agent if user_agent is not None: self._config.add_user_agent(user_agent) self._client = ServiceClient(creds, self._config) self._client_cache = {} self.base_url = base_url self._creds = creds self._resource_areas = None self.clients = ClientFactory(self) self.clients_v5_0 = ClientFactoryV5_0(self) self.clients_v5_1 = ClientFactoryV5_1(self) self.use_fiddler = False def get_client(self, client_type): """get_client. """ if client_type not in self._client_cache: client_class = self._get_class(client_type) self._client_cache[client_type] = self._get_client_instance(client_class) return self._client_cache[client_type] @staticmethod def _get_class(full_class_name): parts = full_class_name.split('.') module_name = ".".join(parts[:-1]) imported = __import__(module_name) for comp in parts[1:]: imported = getattr(imported, comp) return imported def _get_client_instance(self, client_class): url = self._get_url_for_client_instance(client_class) client = client_class(url, self._creds) client.add_user_agent(self._addition_user_agent) if self.use_fiddler: self._configure_client_for_fiddler(client) return client def _get_url_for_client_instance(self, client_class): resource_id = client_class.resource_area_identifier if resource_id is None: return self.base_url else: resource_areas = self._get_resource_areas() if resource_areas is None: raise AzureDevOpsClientRequestError(('Failed to retrieve resource areas ' + 'from server: {url}').format(url=self.base_url)) if not resource_areas: # For OnPrem environments we get an empty list. return self.base_url for resource_area in resource_areas: if resource_area.id.lower() == resource_id.lower(): return resource_area.location_url # Check SPS deployment level for the resource area resource_area = self._get_deployment_resource_area_from_sps(resource_id) if resource_area is not None: return resource_area.location_url raise AzureDevOpsClientRequestError(('Could not find information for resource area {id} ' + 'from server: {url}').format(id=resource_id, url=self.base_url)) def _get_deployment_resource_area_from_sps(self, resource_id): resource_id = resource_id.lower() if resource_id in _deployment_level_resource_areas: return _deployment_level_resource_areas[resource_id] location_client = LocationClient(sps_url, self._creds) if self.use_fiddler: self._configure_client_for_fiddler(location_client) resource_area = location_client.get_resource_area(area_id=resource_id) _deployment_level_resource_areas[resource_id] = resource_area return resource_area def authenticate(self): self._get_resource_areas(force=True) def _get_resource_areas(self, force=False): if self._resource_areas is None or force: location_client = LocationClient(self.base_url, self._creds) if self.use_fiddler: self._configure_client_for_fiddler(location_client) if not force and RESOURCE_FILE_CACHE[location_client.normalized_url]: try: logger.debug('File cache hit for resources on: %s', location_client.normalized_url) self._resource_areas = location_client._base_deserialize.deserialize_data(RESOURCE_FILE_CACHE[location_client.normalized_url], '[ResourceAreaInfo]') return self._resource_areas except Exception as ex: logger.debug(ex, exc_info=True) elif not force: logger.debug('File cache miss for resources on: %s', location_client.normalized_url) self._resource_areas = location_client.get_resource_areas() if self._resource_areas is None: # For OnPrem environments we get an empty collection wrapper. self._resource_areas = [] try: serialized = location_client._base_serialize.serialize_data(self._resource_areas, '[ResourceAreaInfo]') RESOURCE_FILE_CACHE[location_client.normalized_url] = serialized except Exception as ex: logger.debug(ex, exc_info=True) return self._resource_areas @staticmethod def _combine_url(part1, part2): return part1.rstrip('/') + '/' + part2.strip('/') @staticmethod def _configure_client_for_fiddler(client): client.config.connection.verify = False client.config.proxies.add(protocol='https', proxy_url='https://127.0.0.1:8888') _deployment_level_resource_areas = {} sps_url = 'https://app.vssps.visualstudio.com' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/credentials.py000066400000000000000000000007231360605530400311550ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from msrest.authentication import ( BasicAuthentication, BasicTokenAuthentication, OAuthTokenAuthentication) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/exceptions.py000066400000000000000000000030161360605530400310370ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- from msrest.exceptions import ( ClientException, ClientRequestError, AuthenticationError, ) class AzureDevOpsClientError(ClientException): pass class AzureDevOpsAuthenticationError(AuthenticationError): pass class AzureDevOpsClientRequestError(ClientRequestError): pass class AzureDevOpsServiceError(AzureDevOpsClientRequestError): """AzureDevOpsServiceError. """ def __init__(self, wrapped_exception): self.inner_exception = None if wrapped_exception.inner_exception is not None: self.inner_exception = AzureDevOpsServiceError(wrapped_exception.inner_exception) super(AzureDevOpsServiceError, self).__init__(message=wrapped_exception.message, inner_exception=self.inner_exception) self.message = wrapped_exception.message self.exception_id = wrapped_exception.exception_id self.type_name = wrapped_exception.type_name self.type_key = wrapped_exception.type_key self.error_code = wrapped_exception.error_code self.event_id = wrapped_exception.event_id self.custom_properties = wrapped_exception.custom_properties azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/000077500000000000000000000000001360605530400300705ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/__init__.py000066400000000000000000000010551360605530400322020ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/accounts/000077500000000000000000000000001360605530400317075ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/accounts/__init__.py000066400000000000000000000013661360605530400340260ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.accounts.models import * from .accounts_client import AccountsClient __all__ = [ 'Account', 'AccountCreateInfoInternal', 'AccountPreferencesInternal', 'AccountsClient' ] accounts_client.py000066400000000000000000000044151360605530400353630ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/accounts# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.accounts import models class AccountsClient(Client): """Accounts :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(AccountsClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '0d55247a-1c47-4462-9b1f-5e2125590ee6' def get_accounts(self, owner_id=None, member_id=None, properties=None): """GetAccounts. Get a list of accounts for a specific owner or a specific member. :param str owner_id: ID for the owner of the accounts. :param str member_id: ID for a member of the accounts. :param str properties: :rtype: [Account] """ query_parameters = {} if owner_id is not None: query_parameters['ownerId'] = self._serialize.query('owner_id', owner_id, 'str') if member_id is not None: query_parameters['memberId'] = self._serialize.query('member_id', member_id, 'str') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='229a6a53-b428-4ffb-a835-e8f36b5b4b1e', version='5.1', query_parameters=query_parameters) return self._deserialize('[Account]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/build/000077500000000000000000000000001360605530400311675ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/build/__init__.py000066400000000000000000000051211360605530400332770ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.build.models import * from .build_client import BuildClient __all__ = [ 'AgentPoolQueue', 'AgentSpecification', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', 'AggregatedRunsByOutcome', 'AggregatedRunsByState', 'ArtifactResource', 'AssociatedWorkItem', 'Attachment', 'AuthorizationHeader', 'Build', 'BuildArtifact', 'BuildBadge', 'BuildController', 'BuildDefinition', 'BuildDefinition3_2', 'BuildDefinitionReference', 'BuildDefinitionReference3_2', 'BuildDefinitionRevision', 'BuildDefinitionStep', 'BuildDefinitionTemplate', 'BuildDefinitionTemplate3_2', 'BuildDefinitionVariable', 'BuildLog', 'BuildLogReference', 'BuildMetric', 'BuildOption', 'BuildOptionDefinition', 'BuildOptionDefinitionReference', 'BuildOptionGroupDefinition', 'BuildOptionInputDefinition', 'BuildReportMetadata', 'BuildRepository', 'BuildRequestValidationResult', 'BuildResourceUsage', 'BuildSettings', 'Change', 'DataSourceBindingBase', 'DefinitionReference', 'DefinitionResourceReference', 'Deployment', 'Folder', 'GraphSubjectBase', 'IdentityRef', 'Issue', 'JsonPatchOperation', 'ProcessParameters', 'PullRequest', 'ReferenceLinks', 'ReleaseReference', 'RepositoryWebhook', 'ResourceRef', 'RetentionPolicy', 'SourceProviderAttributes', 'SourceRepositories', 'SourceRepository', 'SourceRepositoryItem', 'SupportedTrigger', 'TaskAgentPoolReference', 'TaskDefinitionReference', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskOrchestrationPlanReference', 'TaskReference', 'TaskSourceDefinitionBase', 'TeamProjectReference', 'TestResultsContext', 'Timeline', 'TimelineAttempt', 'TimelineRecord', 'TimelineReference', 'VariableGroup', 'VariableGroupReference', 'WebApiConnectedServiceRef', 'XamlBuildControllerReference', 'BuildClient' ] build_client.py000066400000000000000000001641131360605530400341250ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/build# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.build import models class BuildClient(Client): """Build :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(BuildClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '965220d5-5bb9-42cf-8d67-9b146df2a5a4' def create_artifact(self, artifact, project, build_id): """CreateArtifact. Associates an artifact with a build. :param :class:` ` artifact: The artifact. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') content = self._serialize.body(artifact, 'BuildArtifact') response = self._send(http_method='POST', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values, content=content) return self._deserialize('BuildArtifact', response) def get_artifact(self, project, build_id, artifact_name): """GetArtifact. Gets a specific artifact for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if artifact_name is not None: query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildArtifact', response) def get_artifact_content_zip(self, project, build_id, artifact_name, **kwargs): """GetArtifactContentZip. Gets a specific artifact for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if artifact_name is not None: query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_artifacts(self, project, build_id): """GetArtifacts. Gets all artifacts for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [BuildArtifact] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values) return self._deserialize('[BuildArtifact]', self._unwrap_collection(response)) def get_file(self, project, build_id, artifact_name, file_id, file_name, **kwargs): """GetFile. Gets a file from the build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. :param str file_id: The primary key for the file. :param str file_name: The name that the file will be set to. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if artifact_name is not None: query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') if file_id is not None: query_parameters['fileId'] = self._serialize.query('file_id', file_id, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def delete_build(self, project, build_id): """DeleteBuild. Deletes a build. :param str project: Project ID or project name :param int build_id: The ID of the build. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') self._send(http_method='DELETE', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values) def get_build(self, project, build_id, property_filters=None): """GetBuild. Gets a build :param str project: Project ID or project name :param int build_id: :param str property_filters: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if property_filters is not None: query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Build', response) def get_builds(self, project, definitions=None, queues=None, build_number=None, min_time=None, max_time=None, requested_for=None, reason_filter=None, status_filter=None, result_filter=None, tag_filters=None, properties=None, top=None, continuation_token=None, max_builds_per_definition=None, deleted_filter=None, query_order=None, branch_name=None, build_ids=None, repository_id=None, repository_type=None): """GetBuilds. Gets a list of builds. :param str project: Project ID or project name :param [int] definitions: A comma-delimited list of definition IDs. If specified, filters to builds for these definitions. :param [int] queues: A comma-delimited list of queue IDs. If specified, filters to builds that ran against these queues. :param str build_number: If specified, filters to builds that match this build number. Append * to do a prefix search. :param datetime min_time: If specified, filters to builds that finished/started/queued after this date based on the queryOrder specified. :param datetime max_time: If specified, filters to builds that finished/started/queued before this date based on the queryOrder specified. :param str requested_for: If specified, filters to builds requested for the specified user. :param str reason_filter: If specified, filters to builds that match this reason. :param str status_filter: If specified, filters to builds that match this status. :param str result_filter: If specified, filters to builds that match this result. :param [str] tag_filters: A comma-delimited list of tags. If specified, filters to builds that have the specified tags. :param [str] properties: A comma-delimited list of properties to retrieve. :param int top: The maximum number of builds to return. :param str continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of builds. :param int max_builds_per_definition: The maximum number of builds to return per definition. :param str deleted_filter: Indicates whether to exclude, include, or only return deleted builds. :param str query_order: The order in which builds should be returned. :param str branch_name: If specified, filters to builds that built branches that built this branch. :param [int] build_ids: A comma-delimited list that specifies the IDs of builds to retrieve. :param str repository_id: If specified, filters to builds that built from this repository. :param str repository_type: If specified, filters to builds that built from repositories of this type. :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definitions is not None: definitions = ",".join(map(str, definitions)) query_parameters['definitions'] = self._serialize.query('definitions', definitions, 'str') if queues is not None: queues = ",".join(map(str, queues)) query_parameters['queues'] = self._serialize.query('queues', queues, 'str') if build_number is not None: query_parameters['buildNumber'] = self._serialize.query('build_number', build_number, 'str') if min_time is not None: query_parameters['minTime'] = self._serialize.query('min_time', min_time, 'iso-8601') if max_time is not None: query_parameters['maxTime'] = self._serialize.query('max_time', max_time, 'iso-8601') if requested_for is not None: query_parameters['requestedFor'] = self._serialize.query('requested_for', requested_for, 'str') if reason_filter is not None: query_parameters['reasonFilter'] = self._serialize.query('reason_filter', reason_filter, 'str') if status_filter is not None: query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') if result_filter is not None: query_parameters['resultFilter'] = self._serialize.query('result_filter', result_filter, 'str') if tag_filters is not None: tag_filters = ",".join(tag_filters) query_parameters['tagFilters'] = self._serialize.query('tag_filters', tag_filters, 'str') if properties is not None: properties = ",".join(properties) query_parameters['properties'] = self._serialize.query('properties', properties, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if max_builds_per_definition is not None: query_parameters['maxBuildsPerDefinition'] = self._serialize.query('max_builds_per_definition', max_builds_per_definition, 'int') if deleted_filter is not None: query_parameters['deletedFilter'] = self._serialize.query('deleted_filter', deleted_filter, 'str') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') if build_ids is not None: build_ids = ",".join(map(str, build_ids)) query_parameters['buildIds'] = self._serialize.query('build_ids', build_ids, 'str') if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if repository_type is not None: query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[Build]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetBuildsResponseValue(response_value, continuation_token) class GetBuildsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_builds method :param value: :type value: :class:`<[Build]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None, source_build_id=None): """QueueBuild. Queues a build :param :class:` ` build: :param str project: Project ID or project name :param bool ignore_warnings: :param str check_in_ticket: :param int source_build_id: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if ignore_warnings is not None: query_parameters['ignoreWarnings'] = self._serialize.query('ignore_warnings', ignore_warnings, 'bool') if check_in_ticket is not None: query_parameters['checkInTicket'] = self._serialize.query('check_in_ticket', check_in_ticket, 'str') if source_build_id is not None: query_parameters['sourceBuildId'] = self._serialize.query('source_build_id', source_build_id, 'int') content = self._serialize.body(build, 'Build') response = self._send(http_method='POST', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Build', response) def update_build(self, build, project, build_id, retry=None): """UpdateBuild. Updates a build. :param :class:` ` build: The build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param bool retry: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if retry is not None: query_parameters['retry'] = self._serialize.query('retry', retry, 'bool') content = self._serialize.body(build, 'Build') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Build', response) def update_builds(self, builds, project): """UpdateBuilds. Updates multiple builds. :param [Build] builds: The builds to update. :param str project: Project ID or project name :rtype: [Build] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(builds, '[Build]') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, content=content) return self._deserialize('[Build]', self._unwrap_collection(response)) def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): """GetBuildChanges. Gets the changes associated with a build :param str project: Project ID or project name :param int build_id: :param str continuation_token: :param int top: The maximum number of changes to return :param bool include_source_change: :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if include_source_change is not None: query_parameters['includeSourceChange'] = self._serialize.query('include_source_change', include_source_change, 'bool') response = self._send(http_method='GET', location_id='54572c7b-bbd3-45d4-80dc-28be08941620', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[Change]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetBuildChangesResponseValue(response_value, continuation_token) class GetBuildChangesResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_build_changes method :param value: :type value: :class:`<[Change]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def get_build_controller(self, controller_id): """GetBuildController. Gets a controller :param int controller_id: :rtype: :class:` ` """ route_values = {} if controller_id is not None: route_values['controllerId'] = self._serialize.url('controller_id', controller_id, 'int') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', version='5.1', route_values=route_values) return self._deserialize('BuildController', response) def get_build_controllers(self, name=None): """GetBuildControllers. Gets controller, optionally filtered by name :param str name: :rtype: [BuildController] """ query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', version='5.1', query_parameters=query_parameters) return self._deserialize('[BuildController]', self._unwrap_collection(response)) def create_definition(self, definition, project, definition_to_clone_id=None, definition_to_clone_revision=None): """CreateDefinition. Creates a new definition. :param :class:` ` definition: The definition. :param str project: Project ID or project name :param int definition_to_clone_id: :param int definition_to_clone_revision: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definition_to_clone_id is not None: query_parameters['definitionToCloneId'] = self._serialize.query('definition_to_clone_id', definition_to_clone_id, 'int') if definition_to_clone_revision is not None: query_parameters['definitionToCloneRevision'] = self._serialize.query('definition_to_clone_revision', definition_to_clone_revision, 'int') content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='POST', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('BuildDefinition', response) def delete_definition(self, project, definition_id): """DeleteDefinition. Deletes a definition and all associated builds. :param str project: Project ID or project name :param int definition_id: The ID of the definition. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') self._send(http_method='DELETE', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values) def get_definition(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): """GetDefinition. Gets a definition, optionally at a specific revision. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int revision: The revision number to retrieve. If this is not specified, the latest version will be returned. :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. :param [str] property_filters: A comma-delimited list of properties to include in the results. :param bool include_latest_builds: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if revision is not None: query_parameters['revision'] = self._serialize.query('revision', revision, 'int') if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if include_latest_builds is not None: query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) def get_definitions(self, project, name=None, repository_id=None, repository_type=None, query_order=None, top=None, continuation_token=None, min_metrics_time=None, definition_ids=None, path=None, built_after=None, not_built_after=None, include_all_properties=None, include_latest_builds=None, task_id_filter=None, process_type=None, yaml_filename=None): """GetDefinitions. Gets a list of definitions. :param str project: Project ID or project name :param str name: If specified, filters to definitions whose names match this pattern. :param str repository_id: A repository ID. If specified, filters to definitions that use this repository. :param str repository_type: If specified, filters to definitions that have a repository of this type. :param str query_order: Indicates the order in which definitions should be returned. :param int top: The maximum number of definitions to return. :param str continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of definitions. :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. :param [int] definition_ids: A comma-delimited list that specifies the IDs of definitions to retrieve. :param str path: If specified, filters to definitions under this folder. :param datetime built_after: If specified, filters to definitions that have builds after this date. :param datetime not_built_after: If specified, filters to definitions that do not have builds after this date. :param bool include_all_properties: Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned. :param bool include_latest_builds: Indicates whether to return the latest and latest completed builds for this definition. :param str task_id_filter: If specified, filters to definitions that use the specified task. :param int process_type: If specified, filters to definitions with the given process type. :param str yaml_filename: If specified, filters to YAML definitions that match the given filename. :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if repository_type is not None: query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') if definition_ids is not None: definition_ids = ",".join(map(str, definition_ids)) query_parameters['definitionIds'] = self._serialize.query('definition_ids', definition_ids, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if built_after is not None: query_parameters['builtAfter'] = self._serialize.query('built_after', built_after, 'iso-8601') if not_built_after is not None: query_parameters['notBuiltAfter'] = self._serialize.query('not_built_after', not_built_after, 'iso-8601') if include_all_properties is not None: query_parameters['includeAllProperties'] = self._serialize.query('include_all_properties', include_all_properties, 'bool') if include_latest_builds is not None: query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') if task_id_filter is not None: query_parameters['taskIdFilter'] = self._serialize.query('task_id_filter', task_id_filter, 'str') if process_type is not None: query_parameters['processType'] = self._serialize.query('process_type', process_type, 'int') if yaml_filename is not None: query_parameters['yamlFilename'] = self._serialize.query('yaml_filename', yaml_filename, 'str') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[BuildDefinitionReference]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetDefinitionsResponseValue(response_value, continuation_token) class GetDefinitionsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_definitions method :param value: :type value: :class:`<[BuildDefinitionReference]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def restore_definition(self, project, definition_id, deleted): """RestoreDefinition. Restores a deleted definition :param str project: Project ID or project name :param int definition_id: The identifier of the definition to restore. :param bool deleted: When false, restores a deleted definition. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if deleted is not None: query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') response = self._send(http_method='PATCH', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) def update_definition(self, definition, project, definition_id, secrets_source_definition_id=None, secrets_source_definition_revision=None): """UpdateDefinition. Updates an existing definition. :param :class:` ` definition: The new version of the defintion. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int secrets_source_definition_id: :param int secrets_source_definition_revision: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if secrets_source_definition_id is not None: query_parameters['secretsSourceDefinitionId'] = self._serialize.query('secrets_source_definition_id', secrets_source_definition_id, 'int') if secrets_source_definition_revision is not None: query_parameters['secretsSourceDefinitionRevision'] = self._serialize.query('secrets_source_definition_revision', secrets_source_definition_revision, 'int') content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='PUT', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('BuildDefinition', response) def get_build_log(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): """GetBuildLog. Gets an individual log file for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int log_id: The ID of the log file. :param long start_line: The start line. :param long end_line: The end line. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_build_log_lines(self, project, build_id, log_id, start_line=None, end_line=None): """GetBuildLogLines. Gets an individual log file for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int log_id: The ID of the log file. :param long start_line: The start line. :param long end_line: The end line. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def get_build_logs(self, project, build_id): """GetBuildLogs. Gets the logs for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [BuildLog] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values) return self._deserialize('[BuildLog]', self._unwrap_collection(response)) def get_build_logs_zip(self, project, build_id, **kwargs): """GetBuildLogsZip. Gets the logs for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_build_log_zip(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): """GetBuildLogZip. Gets an individual log file for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int log_id: The ID of the log file. :param long start_line: The start line. :param long end_line: The end line. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_build_option_definitions(self, project=None): """GetBuildOptionDefinitions. Gets all build definition options supported by the system. :param str project: Project ID or project name :rtype: [BuildOptionDefinition] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='591cb5a4-2d46-4f3a-a697-5cd42b6bd332', version='5.1', route_values=route_values) return self._deserialize('[BuildOptionDefinition]', self._unwrap_collection(response)) def get_definition_revisions(self, project, definition_id): """GetDefinitionRevisions. Gets all revisions of a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :rtype: [BuildDefinitionRevision] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='7c116775-52e5-453e-8c5d-914d9762d8c4', version='5.1', route_values=route_values) return self._deserialize('[BuildDefinitionRevision]', self._unwrap_collection(response)) def get_build_settings(self, project=None): """GetBuildSettings. Gets the build settings. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', version='5.1', route_values=route_values) return self._deserialize('BuildSettings', response) def update_build_settings(self, settings, project=None): """UpdateBuildSettings. Updates the build settings. :param :class:` ` settings: The new settings. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(settings, 'BuildSettings') response = self._send(http_method='PATCH', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', version='5.1', route_values=route_values, content=content) return self._deserialize('BuildSettings', response) def add_build_tag(self, project, build_id, tag): """AddBuildTag. Adds a tag to a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str tag: The tag to add. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.1', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def add_build_tags(self, tags, project, build_id): """AddBuildTags. Adds tags to a build. :param [str] tags: The tags to add. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.1', route_values=route_values, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_build_tag(self, project, build_id, tag): """DeleteBuildTag. Removes a tag from a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str tag: The tag to remove. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.1', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_build_tags(self, project, build_id): """GetBuildTags. Gets the tags for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.1', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_tags(self, project): """GetTags. Gets a list of all build and definition tags in the project. :param str project: Project ID or project name :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', version='5.1', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_template(self, project, template_id): """DeleteTemplate. Deletes a build definition template. :param str project: Project ID or project name :param str template_id: The ID of the template. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') self._send(http_method='DELETE', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.1', route_values=route_values) def get_template(self, project, template_id): """GetTemplate. Gets a specific build definition template. :param str project: Project ID or project name :param str template_id: The ID of the requested template. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.1', route_values=route_values) return self._deserialize('BuildDefinitionTemplate', response) def get_templates(self, project): """GetTemplates. Gets all definition templates. :param str project: Project ID or project name :rtype: [BuildDefinitionTemplate] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.1', route_values=route_values) return self._deserialize('[BuildDefinitionTemplate]', self._unwrap_collection(response)) def save_template(self, template, project, template_id): """SaveTemplate. Updates an existing build definition template. :param :class:` ` template: The new version of the template. :param str project: Project ID or project name :param str template_id: The ID of the template. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') content = self._serialize.body(template, 'BuildDefinitionTemplate') response = self._send(http_method='PUT', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.1', route_values=route_values, content=content) return self._deserialize('BuildDefinitionTemplate', response) def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None, plan_id=None): """GetBuildTimeline. Gets details for a build :param str project: Project ID or project name :param int build_id: :param str timeline_id: :param int change_id: :param str plan_id: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') query_parameters = {} if change_id is not None: query_parameters['changeId'] = self._serialize.query('change_id', change_id, 'int') if plan_id is not None: query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='8baac422-4c6e-4de5-8532-db96d92acffa', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Timeline', response) def get_build_work_items_refs(self, project, build_id, top=None): """GetBuildWorkItemsRefs. Gets the work items associated with a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int top: The maximum number of work items to return. :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) def get_build_work_items_refs_from_commits(self, commit_ids, project, build_id, top=None): """GetBuildWorkItemsRefsFromCommits. Gets the work items associated with a build, filtered to specific commits. :param [str] commit_ids: A comma-delimited list of commit IDs. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int top: The maximum number of work items to return, or the number of commits to consider if no commit IDs are specified. :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') content = self._serialize.body(commit_ids, '[str]') response = self._send(http_method='POST', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/client_factory.py000066400000000000000000000201471360605530400334530ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- class ClientFactory(object): """ClientFactory. A factory class to get the 5.1 released clients. """ def __init__(self, connection): self._connection = connection def get_accounts_client(self): """get_accounts_client. Gets the 5.1 version of the AccountsClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.accounts.accounts_client.AccountsClient') def get_build_client(self): """get_build_client. Gets the 5.1 version of the BuildClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.build.build_client.BuildClient') def get_cloud_load_test_client(self): """get_cloud_load_test_client. Gets the 5.1 version of the CloudLoadTestClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.cloud_load_test.cloud_load_test_client.CloudLoadTestClient') def get_core_client(self): """get_core_client. Gets the 5.1 version of the CoreClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.core.core_client.CoreClient') def get_git_client(self): """get_git_client. Gets the 5.1 version of the GitClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.git.git_client.GitClient') def get_identity_client(self): """get_identity_client. Gets the 5.1 version of the IdentityClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.identity.identity_client.IdentityClient') def get_notification_client(self): """get_notification_client. Gets the 5.1 version of the NotificationClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.notification.notification_client.NotificationClient') def get_operations_client(self): """get_operations_client. Gets the 5.1 version of the OperationsClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.operations.operations_client.OperationsClient') def get_policy_client(self): """get_policy_client. Gets the 5.1 version of the PolicyClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.policy.policy_client.PolicyClient') def get_profile_client(self): """get_profile_client. Gets the 5.1 version of the ProfileClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.profile.profile_client.ProfileClient') def get_release_client(self): """get_release_client. Gets the 5.1 version of the ReleaseClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.release.release_client.ReleaseClient') def get_security_client(self): """get_security_client. Gets the 5.1 version of the SecurityClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.security.security_client.SecurityClient') def get_service_hooks_client(self): """get_service_hooks_client. Gets the 5.1 version of the ServiceHooksClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.service_hooks.service_hooks_client.ServiceHooksClient') def get_task_client(self): """get_task_client. Gets the 5.1 version of the TaskClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.task.task_client.TaskClient') def get_task_agent_client(self): """get_task_agent_client. Gets the 5.1 version of the TaskAgentClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.task_agent.task_agent_client.TaskAgentClient') def get_test_client(self): """get_test_client. Gets the 5.1 version of the TestClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.test.test_client.TestClient') def get_test_plan_client(self): """get_test_plan_client. Gets the 5.1 version of the TestPlanClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.test_plan.test_plan_client.TestPlanClient') def get_test_results_client(self): """get_test_results_client. Gets the 5.1 version of the TestResultsClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.test_results.test_results_client.TestResultsClient') def get_tfvc_client(self): """get_tfvc_client. Gets the 5.1 version of the TfvcClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.tfvc.tfvc_client.TfvcClient') def get_wiki_client(self): """get_wiki_client. Gets the 5.1 version of the WikiClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.wiki.wiki_client.WikiClient') def get_work_client(self): """get_work_client. Gets the 5.1 version of the WorkClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.work.work_client.WorkClient') def get_work_item_tracking_client(self): """get_work_item_tracking_client. Gets the 5.1 version of the WorkItemTrackingClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.released.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient') azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/cloud_load_test/000077500000000000000000000000001360605530400332345ustar00rootroot00000000000000__init__.py000066400000000000000000000036101360605530400352660ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/cloud_load_test# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.cloud_load_test.models import * from .cloud_load_test_client import CloudLoadTestClient __all__ = [ 'AgentGroup', 'AgentGroupAccessData', 'Application', 'ApplicationCounters', 'ApplicationType', 'BrowserMix', 'CltCustomerIntelligenceData', 'CounterGroup', 'CounterInstanceSamples', 'CounterSample', 'CounterSampleQueryDetails', 'CounterSamplesResult', 'Diagnostics', 'DropAccessData', 'ErrorDetails', 'GraphSubjectBase', 'IdentityRef', 'LoadGenerationGeoLocation', 'LoadTest', 'LoadTestDefinition', 'LoadTestErrors', 'LoadTestRunDetails', 'LoadTestRunSettings', 'OverridableRunSettings', 'PageSummary', 'ReferenceLinks', 'RequestSummary', 'ScenarioSummary', 'StaticAgentRunSetting', 'SubType', 'SummaryPercentileData', 'TenantDetails', 'TestDefinition', 'TestDefinitionBasic', 'TestDrop', 'TestDropRef', 'TestResults', 'TestResultsSummary', 'TestRun', 'TestRunAbortMessage', 'TestRunBasic', 'TestRunCounterInstance', 'TestRunMessage', 'TestSettings', 'TestSummary', 'TransactionSummary', 'WebApiLoadTestMachineInput', 'WebApiSetupParamaters', 'WebApiTestMachine', 'WebApiUserLoadTestMachineInput', 'WebInstanceSummaryData', 'CloudLoadTestClient' ] cloud_load_test_client.py000066400000000000000000000554101360605530400402360ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/cloud_load_test# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.cloud_load_test import models class CloudLoadTestClient(Client): """CloudLoadTest :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(CloudLoadTestClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '7ae6d0a6-cda5-44cf-a261-28c392bed25c' def create_agent_group(self, group): """CreateAgentGroup. :param :class:` ` group: Agent group to be created :rtype: :class:` ` """ content = self._serialize.body(group, 'AgentGroup') response = self._send(http_method='POST', location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', version='5.1', content=content) return self._deserialize('AgentGroup', response) def get_agent_groups(self, agent_group_id=None, machine_setup_input=None, machine_access_data=None, outgoing_request_urls=None, agent_group_name=None): """GetAgentGroups. :param str agent_group_id: The agent group identifier :param bool machine_setup_input: :param bool machine_access_data: :param bool outgoing_request_urls: :param str agent_group_name: Name of the agent group :rtype: object """ route_values = {} if agent_group_id is not None: route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') query_parameters = {} if machine_setup_input is not None: query_parameters['machineSetupInput'] = self._serialize.query('machine_setup_input', machine_setup_input, 'bool') if machine_access_data is not None: query_parameters['machineAccessData'] = self._serialize.query('machine_access_data', machine_access_data, 'bool') if outgoing_request_urls is not None: query_parameters['outgoingRequestUrls'] = self._serialize.query('outgoing_request_urls', outgoing_request_urls, 'bool') if agent_group_name is not None: query_parameters['agentGroupName'] = self._serialize.query('agent_group_name', agent_group_name, 'str') response = self._send(http_method='GET', location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def delete_static_agent(self, agent_group_id, agent_name): """DeleteStaticAgent. :param str agent_group_id: The agent group identifier :param str agent_name: Name of the static agent :rtype: str """ route_values = {} if agent_group_id is not None: route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') query_parameters = {} if agent_name is not None: query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') response = self._send(http_method='DELETE', location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def get_static_agents(self, agent_group_id, agent_name=None): """GetStaticAgents. :param str agent_group_id: The agent group identifier :param str agent_name: Name of the static agent :rtype: object """ route_values = {} if agent_group_id is not None: route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') query_parameters = {} if agent_name is not None: query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') response = self._send(http_method='GET', location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def get_application(self, application_id): """GetApplication. :param str application_id: Filter by APM application identifier. :rtype: :class:` ` """ route_values = {} if application_id is not None: route_values['applicationId'] = self._serialize.url('application_id', application_id, 'str') response = self._send(http_method='GET', location_id='2c986dce-8e8d-4142-b541-d016d5aff764', version='5.1', route_values=route_values) return self._deserialize('Application', response) def get_applications(self, type=None): """GetApplications. :param str type: Filters the results based on the plugin type. :rtype: [Application] """ query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='2c986dce-8e8d-4142-b541-d016d5aff764', version='5.1', query_parameters=query_parameters) return self._deserialize('[Application]', self._unwrap_collection(response)) def get_counters(self, test_run_id, group_names, include_summary=None): """GetCounters. :param str test_run_id: The test run identifier :param str group_names: Comma separated names of counter groups, such as 'Application', 'Performance' and 'Throughput' :param bool include_summary: :rtype: [TestRunCounterInstance] """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') query_parameters = {} if group_names is not None: query_parameters['groupNames'] = self._serialize.query('group_names', group_names, 'str') if include_summary is not None: query_parameters['includeSummary'] = self._serialize.query('include_summary', include_summary, 'bool') response = self._send(http_method='GET', location_id='29265ea4-b5a5-4b2e-b054-47f5f6f00183', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestRunCounterInstance]', self._unwrap_collection(response)) def get_application_counters(self, application_id=None, plugintype=None): """GetApplicationCounters. :param str application_id: Filter by APM application identifier. :param str plugintype: Currently ApplicationInsights is the only available plugin type. :rtype: [ApplicationCounters] """ query_parameters = {} if application_id is not None: query_parameters['applicationId'] = self._serialize.query('application_id', application_id, 'str') if plugintype is not None: query_parameters['plugintype'] = self._serialize.query('plugintype', plugintype, 'str') response = self._send(http_method='GET', location_id='c1275ce9-6d26-4bc6-926b-b846502e812d', version='5.1', query_parameters=query_parameters) return self._deserialize('[ApplicationCounters]', self._unwrap_collection(response)) def get_counter_samples(self, counter_sample_query_details, test_run_id): """GetCounterSamples. :param :class:` ` counter_sample_query_details: :param str test_run_id: The test run identifier :rtype: :class:` ` """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') content = self._serialize.body(counter_sample_query_details, 'VssJsonCollectionWrapper') response = self._send(http_method='POST', location_id='bad18480-7193-4518-992a-37289c5bb92d', version='5.1', route_values=route_values, content=content) return self._deserialize('CounterSamplesResult', response) def get_load_test_run_errors(self, test_run_id, type=None, sub_type=None, detailed=None): """GetLoadTestRunErrors. :param str test_run_id: The test run identifier :param str type: Filter for the particular type of errors. :param str sub_type: Filter for a particular subtype of errors. You should not provide error subtype without error type. :param bool detailed: To include the details of test errors such as messagetext, request, stacktrace, testcasename, scenarioname, and lasterrordate. :rtype: :class:` ` """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') if sub_type is not None: query_parameters['subType'] = self._serialize.query('sub_type', sub_type, 'str') if detailed is not None: query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') response = self._send(http_method='GET', location_id='b52025a7-3fb4-4283-8825-7079e75bd402', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('LoadTestErrors', response) def get_test_run_messages(self, test_run_id): """GetTestRunMessages. :param str test_run_id: Id of the test run :rtype: [TestRunMessage] """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') response = self._send(http_method='GET', location_id='2e7ba122-f522-4205-845b-2d270e59850a', version='5.1', route_values=route_values) return self._deserialize('[TestRunMessage]', self._unwrap_collection(response)) def get_plugin(self, type): """GetPlugin. :param str type: Currently ApplicationInsights is the only available plugin type. :rtype: :class:` ` """ route_values = {} if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', version='5.1', route_values=route_values) return self._deserialize('ApplicationType', response) def get_plugins(self): """GetPlugins. :rtype: [ApplicationType] """ response = self._send(http_method='GET', location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', version='5.1') return self._deserialize('[ApplicationType]', self._unwrap_collection(response)) def get_load_test_result(self, test_run_id): """GetLoadTestResult. :param str test_run_id: The test run identifier :rtype: :class:` ` """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') response = self._send(http_method='GET', location_id='5ed69bd8-4557-4cec-9b75-1ad67d0c257b', version='5.1', route_values=route_values) return self._deserialize('TestResults', response) def create_test_definition(self, test_definition): """CreateTestDefinition. :param :class:` ` test_definition: Test definition to be created :rtype: :class:` ` """ content = self._serialize.body(test_definition, 'TestDefinition') response = self._send(http_method='POST', location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', version='5.1', content=content) return self._deserialize('TestDefinition', response) def get_test_definition(self, test_definition_id): """GetTestDefinition. :param str test_definition_id: The test definition identifier :rtype: :class:` ` """ route_values = {} if test_definition_id is not None: route_values['testDefinitionId'] = self._serialize.url('test_definition_id', test_definition_id, 'str') response = self._send(http_method='GET', location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', version='5.1', route_values=route_values) return self._deserialize('TestDefinition', response) def get_test_definitions(self, from_date=None, to_date=None, top=None): """GetTestDefinitions. :param str from_date: Date after which test definitions were created :param str to_date: Date before which test definitions were crated :param int top: :rtype: [TestDefinitionBasic] """ query_parameters = {} if from_date is not None: query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') if to_date is not None: query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', version='5.1', query_parameters=query_parameters) return self._deserialize('[TestDefinitionBasic]', self._unwrap_collection(response)) def update_test_definition(self, test_definition): """UpdateTestDefinition. :param :class:` ` test_definition: :rtype: :class:` ` """ content = self._serialize.body(test_definition, 'TestDefinition') response = self._send(http_method='PUT', location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', version='5.1', content=content) return self._deserialize('TestDefinition', response) def create_test_drop(self, web_test_drop): """CreateTestDrop. :param :class:` ` web_test_drop: Test drop to be created :rtype: :class:` ` """ content = self._serialize.body(web_test_drop, 'TestDrop') response = self._send(http_method='POST', location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', version='5.1', content=content) return self._deserialize('TestDrop', response) def get_test_drop(self, test_drop_id): """GetTestDrop. :param str test_drop_id: The test drop identifier :rtype: :class:` ` """ route_values = {} if test_drop_id is not None: route_values['testDropId'] = self._serialize.url('test_drop_id', test_drop_id, 'str') response = self._send(http_method='GET', location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', version='5.1', route_values=route_values) return self._deserialize('TestDrop', response) def create_test_run(self, web_test_run): """CreateTestRun. :param :class:` ` web_test_run: :rtype: :class:` ` """ content = self._serialize.body(web_test_run, 'TestRun') response = self._send(http_method='POST', location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', version='5.1', content=content) return self._deserialize('TestRun', response) def get_test_run(self, test_run_id): """GetTestRun. :param str test_run_id: Unique ID of the test run :rtype: :class:` ` """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') response = self._send(http_method='GET', location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', version='5.1', route_values=route_values) return self._deserialize('TestRun', response) def get_test_runs(self, name=None, requested_by=None, status=None, run_type=None, from_date=None, to_date=None, detailed=None, top=None, runsourceidentifier=None, retention_state=None): """GetTestRuns. Returns test runs based on the filter specified. Returns all runs of the tenant if there is no filter. :param str name: Name for the test run. Names are not unique. Test runs with same name are assigned sequential rolling numbers. :param str requested_by: Filter by the user who requested the test run. Here requestedBy should be the display name of the user. :param str status: Filter by the test run status. :param str run_type: Valid values include: null, one of TestRunType, or "*" :param str from_date: Filter by the test runs that have been modified after the fromDate timestamp. :param str to_date: Filter by the test runs that have been modified before the toDate timestamp. :param bool detailed: Include the detailed test run attributes. :param int top: The maximum number of test runs to return. :param str runsourceidentifier: :param str retention_state: :rtype: object """ query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if requested_by is not None: query_parameters['requestedBy'] = self._serialize.query('requested_by', requested_by, 'str') if status is not None: query_parameters['status'] = self._serialize.query('status', status, 'str') if run_type is not None: query_parameters['runType'] = self._serialize.query('run_type', run_type, 'str') if from_date is not None: query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') if to_date is not None: query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') if detailed is not None: query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if runsourceidentifier is not None: query_parameters['runsourceidentifier'] = self._serialize.query('runsourceidentifier', runsourceidentifier, 'str') if retention_state is not None: query_parameters['retentionState'] = self._serialize.query('retention_state', retention_state, 'str') response = self._send(http_method='GET', location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', version='5.1', query_parameters=query_parameters) return self._deserialize('object', response) def update_test_run(self, web_test_run, test_run_id): """UpdateTestRun. :param :class:` ` web_test_run: :param str test_run_id: """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') content = self._serialize.body(web_test_run, 'TestRun') self._send(http_method='PATCH', location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', version='5.1', route_values=route_values, content=content) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/core/000077500000000000000000000000001360605530400310205ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/core/__init__.py000066400000000000000000000024071360605530400331340ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.core.models import * from .core_client import CoreClient __all__ = [ 'GraphSubjectBase', 'Identity', 'IdentityBase', 'IdentityData', 'IdentityRef', 'JsonPatchOperation', 'OperationReference', 'Process', 'ProcessReference', 'ProjectAvatar', 'ProjectInfo', 'ProjectProperties', 'ProjectProperty', 'Proxy', 'ProxyAuthorization', 'PublicKey', 'ReferenceLinks', 'TeamMember', 'TeamProject', 'TeamProjectCollection', 'TeamProjectCollectionReference', 'TeamProjectReference', 'WebApiConnectedService', 'WebApiConnectedServiceDetails', 'WebApiConnectedServiceRef', 'WebApiTeam', 'WebApiTeamRef', 'CoreClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/core/core_client.py000066400000000000000000000423741360605530400336720ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.core import models class CoreClient(Client): """Core :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(CoreClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '79134c72-4a58-4b42-976c-04e7115f32bf' def get_team_members_with_extended_properties(self, project_id, team_id, top=None, skip=None): """GetTeamMembersWithExtendedProperties. Get a list of members for a specific team. :param str project_id: The name or ID (GUID) of the team project the team belongs to. :param str team_id: The name or ID (GUID) of the team . :param int top: :param int skip: :rtype: [TeamMember] """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') if team_id is not None: route_values['teamId'] = self._serialize.url('team_id', team_id, 'str') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='294c494c-2600-4d7e-b76c-3dd50c3c95be', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TeamMember]', self._unwrap_collection(response)) def get_process_by_id(self, process_id): """GetProcessById. Get a process by ID. :param str process_id: ID for a process. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') response = self._send(http_method='GET', location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8', version='5.1', route_values=route_values) return self._deserialize('Process', response) def get_processes(self): """GetProcesses. Get a list of processes. :rtype: [Process] """ response = self._send(http_method='GET', location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8', version='5.1') return self._deserialize('[Process]', self._unwrap_collection(response)) def get_project_collection(self, collection_id): """GetProjectCollection. Get project collection with the specified id or name. :param str collection_id: :rtype: :class:` ` """ route_values = {} if collection_id is not None: route_values['collectionId'] = self._serialize.url('collection_id', collection_id, 'str') response = self._send(http_method='GET', location_id='8031090f-ef1d-4af6-85fc-698cd75d42bf', version='5.1', route_values=route_values) return self._deserialize('TeamProjectCollection', response) def get_project_collections(self, top=None, skip=None): """GetProjectCollections. Get project collection references for this application. :param int top: :param int skip: :rtype: [TeamProjectCollectionReference] """ query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='8031090f-ef1d-4af6-85fc-698cd75d42bf', version='5.1', query_parameters=query_parameters) return self._deserialize('[TeamProjectCollectionReference]', self._unwrap_collection(response)) def get_project(self, project_id, include_capabilities=None, include_history=None): """GetProject. Get project with the specified id or name, optionally including capabilities. :param str project_id: :param bool include_capabilities: Include capabilities (such as source control) in the team project result (default: false). :param bool include_history: Search within renamed projects (that had such name in the past). :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') query_parameters = {} if include_capabilities is not None: query_parameters['includeCapabilities'] = self._serialize.query('include_capabilities', include_capabilities, 'bool') if include_history is not None: query_parameters['includeHistory'] = self._serialize.query('include_history', include_history, 'bool') response = self._send(http_method='GET', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TeamProject', response) def get_projects(self, state_filter=None, top=None, skip=None, continuation_token=None, get_default_team_image_url=None): """GetProjects. Get all projects in the organization that the authenticated user has access to. :param str state_filter: Filter on team projects in a specific team project state (default: WellFormed). :param int top: :param int skip: :param str continuation_token: :param bool get_default_team_image_url: :rtype: :class:`` """ query_parameters = {} if state_filter is not None: query_parameters['stateFilter'] = self._serialize.query('state_filter', state_filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if get_default_team_image_url is not None: query_parameters['getDefaultTeamImageUrl'] = self._serialize.query('get_default_team_image_url', get_default_team_image_url, 'bool') response = self._send(http_method='GET', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.1', query_parameters=query_parameters) response_value = self._deserialize('[TeamProjectReference]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetProjectsResponseValue(response_value, continuation_token) class GetProjectsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_projects method :param value: :type value: :class:`<[TeamProjectReference]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def queue_create_project(self, project_to_create): """QueueCreateProject. Queues a project to be created. Use the [GetOperation](../../operations/operations/get) to periodically check for create project status. :param :class:` ` project_to_create: The project to create. :rtype: :class:` ` """ content = self._serialize.body(project_to_create, 'TeamProject') response = self._send(http_method='POST', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.1', content=content) return self._deserialize('OperationReference', response) def queue_delete_project(self, project_id): """QueueDeleteProject. Queues a project to be deleted. Use the [GetOperation](../../operations/operations/get) to periodically check for delete project status. :param str project_id: The project id of the project to delete. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') response = self._send(http_method='DELETE', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.1', route_values=route_values) return self._deserialize('OperationReference', response) def update_project(self, project_update, project_id): """UpdateProject. Update an existing project's name, abbreviation, description, or restore a project. :param :class:` ` project_update: The updates for the project. The state must be set to wellFormed to restore the project. :param str project_id: The project id of the project to update. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') content = self._serialize.body(project_update, 'TeamProject') response = self._send(http_method='PATCH', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.1', route_values=route_values, content=content) return self._deserialize('OperationReference', response) def create_team(self, team, project_id): """CreateTeam. Create a team in a team project. :param :class:` ` team: The team data used to create the team. :param str project_id: The name or ID (GUID) of the team project in which to create the team. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') content = self._serialize.body(team, 'WebApiTeam') response = self._send(http_method='POST', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.1', route_values=route_values, content=content) return self._deserialize('WebApiTeam', response) def delete_team(self, project_id, team_id): """DeleteTeam. Delete a team. :param str project_id: The name or ID (GUID) of the team project containing the team to delete. :param str team_id: The name or ID of the team to delete. """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') if team_id is not None: route_values['teamId'] = self._serialize.url('team_id', team_id, 'str') self._send(http_method='DELETE', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.1', route_values=route_values) def get_team(self, project_id, team_id, expand_identity=None): """GetTeam. Get a specific team. :param str project_id: The name or ID (GUID) of the team project containing the team. :param str team_id: The name or ID (GUID) of the team. :param bool expand_identity: A value indicating whether or not to expand Identity information in the result WebApiTeam object. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') if team_id is not None: route_values['teamId'] = self._serialize.url('team_id', team_id, 'str') query_parameters = {} if expand_identity is not None: query_parameters['$expandIdentity'] = self._serialize.query('expand_identity', expand_identity, 'bool') response = self._send(http_method='GET', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WebApiTeam', response) def get_teams(self, project_id, mine=None, top=None, skip=None, expand_identity=None): """GetTeams. Get a list of teams. :param str project_id: :param bool mine: If true return all the teams requesting user is member, otherwise return all the teams user has read access. :param int top: Maximum number of teams to return. :param int skip: Number of teams to skip. :param bool expand_identity: A value indicating whether or not to expand Identity information in the result WebApiTeam object. :rtype: [WebApiTeam] """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') query_parameters = {} if mine is not None: query_parameters['$mine'] = self._serialize.query('mine', mine, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if expand_identity is not None: query_parameters['$expandIdentity'] = self._serialize.query('expand_identity', expand_identity, 'bool') response = self._send(http_method='GET', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WebApiTeam]', self._unwrap_collection(response)) def update_team(self, team_data, project_id, team_id): """UpdateTeam. Update a team's name and/or description. :param :class:` ` team_data: :param str project_id: The name or ID (GUID) of the team project containing the team to update. :param str team_id: The name of ID of the team to update. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') if team_id is not None: route_values['teamId'] = self._serialize.url('team_id', team_id, 'str') content = self._serialize.body(team_data, 'WebApiTeam') response = self._send(http_method='PATCH', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.1', route_values=route_values, content=content) return self._deserialize('WebApiTeam', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/git/000077500000000000000000000000001360605530400306535ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/git/__init__.py000066400000000000000000000066031360605530400327710ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.git.models import * from .git_client import GitClient __all__ = [ 'Attachment', 'Change', 'Comment', 'CommentIterationContext', 'CommentPosition', 'CommentThread', 'CommentThreadContext', 'CommentTrackingCriteria', 'FileContentMetadata', 'FileDiff', 'FileDiffParams', 'FileDiffsCriteria', 'GitAnnotatedTag', 'GitAsyncRefOperation', 'GitAsyncRefOperationDetail', 'GitAsyncRefOperationParameters', 'GitAsyncRefOperationSource', 'GitBaseVersionDescriptor', 'GitBlobRef', 'GitBranchStats', 'GitCherryPick', 'GitCommit', 'GitCommitChanges', 'GitCommitDiffs', 'GitCommitRef', 'GitConflict', 'GitConflictUpdateResult', 'GitDeletedRepository', 'GitFilePathsCollection', 'GitForkOperationStatusDetail', 'GitForkRef', 'GitForkSyncRequest', 'GitForkSyncRequestParameters', 'GitImportGitSource', 'GitImportRequest', 'GitImportRequestParameters', 'GitImportStatusDetail', 'GitImportTfvcSource', 'GitItem', 'GitItemDescriptor', 'GitItemRequestData', 'GitMerge', 'GitMergeOperationStatusDetail', 'GitMergeOriginRef', 'GitMergeParameters', 'GitObject', 'GitPolicyConfigurationResponse', 'GitPullRequest', 'GitPullRequestChange', 'GitPullRequestCommentThread', 'GitPullRequestCommentThreadContext', 'GitPullRequestCompletionOptions', 'GitPullRequestIteration', 'GitPullRequestIterationChanges', 'GitPullRequestMergeOptions', 'GitPullRequestQuery', 'GitPullRequestQueryInput', 'GitPullRequestSearchCriteria', 'GitPullRequestStatus', 'GitPush', 'GitPushRef', 'GitPushSearchCriteria', 'GitQueryBranchStatsCriteria', 'GitQueryCommitsCriteria', 'GitRecycleBinRepositoryDetails', 'GitRef', 'GitRefFavorite', 'GitRefUpdate', 'GitRefUpdateResult', 'GitRepository', 'GitRepositoryCreateOptions', 'GitRepositoryRef', 'GitRepositoryStats', 'GitRevert', 'GitStatus', 'GitStatusContext', 'GitSuggestion', 'GitTargetVersionDescriptor', 'GitTemplate', 'GitTreeDiff', 'GitTreeDiffEntry', 'GitTreeDiffResponse', 'GitTreeEntryRef', 'GitTreeRef', 'GitUserDate', 'GitVersionDescriptor', 'GlobalGitRepositoryKey', 'GraphSubjectBase', 'IdentityRef', 'IdentityRefWithVote', 'ImportRepositoryValidation', 'ItemContent', 'ItemModel', 'JsonPatchOperation', 'LineDiffBlock', 'PolicyConfiguration', 'PolicyConfigurationRef', 'PolicyTypeRef', 'ReferenceLinks', 'ResourceRef', 'ShareNotificationContext', 'SourceToTargetRef', 'TeamProjectCollectionReference', 'TeamProjectReference', 'VersionedPolicyConfigurationRef', 'VstsInfo', 'WebApiCreateTagRequestData', 'WebApiTagDefinition', 'GitClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/git/git_client.py000066400000000000000000000004761360605530400333550ustar00rootroot00000000000000# coding=utf-8 from .git_client_base import GitClientBase class GitClient(GitClientBase): """Git :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(GitClient, self).__init__(base_url, creds) git_client_base.py000066400000000000000000003722541360605530400342760ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/git# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.git import models class GitClientBase(Client): """Git :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(GitClientBase, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '4e080c62-fa21-4fbc-8fef-2a10a2b38049' def get_blob(self, repository_id, sha1, project=None, download=None, file_name=None, resolve_lfs=None): """GetBlob. Get a single blob. :param str repository_id: The name or ID of the repository. :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint. :param str project: Project ID or project name :param bool download: If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip :param str file_name: Provide a fileName to use for a download. :param bool resolve_lfs: If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitBlobRef', response) def get_blob_content(self, repository_id, sha1, project=None, download=None, file_name=None, resolve_lfs=None, **kwargs): """GetBlobContent. Get a single blob. :param str repository_id: The name or ID of the repository. :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint. :param str project: Project ID or project name :param bool download: If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip :param str file_name: Provide a fileName to use for a download. :param bool resolve_lfs: If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_blobs_zip(self, blob_ids, repository_id, project=None, filename=None, **kwargs): """GetBlobsZip. Gets one or more blobs in a zip file download. :param [str] blob_ids: Blob IDs (SHA1 hashes) to be returned in the zip file. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param str filename: :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if filename is not None: query_parameters['filename'] = self._serialize.query('filename', filename, 'str') content = self._serialize.body(blob_ids, '[str]') response = self._send(http_method='POST', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_blob_zip(self, repository_id, sha1, project=None, download=None, file_name=None, resolve_lfs=None, **kwargs): """GetBlobZip. Get a single blob. :param str repository_id: The name or ID of the repository. :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint. :param str project: Project ID or project name :param bool download: If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip :param str file_name: Provide a fileName to use for a download. :param bool resolve_lfs: If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_branch(self, repository_id, name, project=None, base_version_descriptor=None): """GetBranch. Retrieve statistics about a single branch. :param str repository_id: The name or ID of the repository. :param str name: Name of the branch. :param str project: Project ID or project name :param :class:` ` base_version_descriptor: Identifies the commit or branch to use as the base. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if base_version_descriptor is not None: if base_version_descriptor.version_type is not None: query_parameters['baseVersionDescriptor.versionType'] = base_version_descriptor.version_type if base_version_descriptor.version is not None: query_parameters['baseVersionDescriptor.version'] = base_version_descriptor.version if base_version_descriptor.version_options is not None: query_parameters['baseVersionDescriptor.versionOptions'] = base_version_descriptor.version_options response = self._send(http_method='GET', location_id='d5b216de-d8d5-4d32-ae76-51df755b16d3', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitBranchStats', response) def get_branches(self, repository_id, project=None, base_version_descriptor=None): """GetBranches. Retrieve statistics about all branches within a repository. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param :class:` ` base_version_descriptor: Identifies the commit or branch to use as the base. :rtype: [GitBranchStats] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if base_version_descriptor is not None: if base_version_descriptor.version_type is not None: query_parameters['baseVersionDescriptor.versionType'] = base_version_descriptor.version_type if base_version_descriptor.version is not None: query_parameters['baseVersionDescriptor.version'] = base_version_descriptor.version if base_version_descriptor.version_options is not None: query_parameters['baseVersionDescriptor.versionOptions'] = base_version_descriptor.version_options response = self._send(http_method='GET', location_id='d5b216de-d8d5-4d32-ae76-51df755b16d3', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitBranchStats]', self._unwrap_collection(response)) def get_changes(self, commit_id, repository_id, project=None, top=None, skip=None): """GetChanges. Retrieve changes for a particular commit. :param str commit_id: The id of the commit. :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. :param str project: Project ID or project name :param int top: The maximum number of changes to return. :param int skip: The number of changes to skip. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if commit_id is not None: route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='5bf884f5-3e07-42e9-afb8-1b872267bf16', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitCommitChanges', response) def get_commit_diffs(self, repository_id, project=None, diff_common_commit=None, top=None, skip=None, base_version_descriptor=None, target_version_descriptor=None): """GetCommitDiffs. Find the closest common commit (the merge base) between base and target commits, and get the diff between either the base and target commits or common and target commits. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param bool diff_common_commit: If true, diff between common and target commits. If false, diff between base and target commits. :param int top: Maximum number of changes to return. Defaults to 100. :param int skip: Number of changes to skip :param :class:` ` base_version_descriptor: Descriptor for base commit. :param :class:` ` target_version_descriptor: Descriptor for target commit. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if diff_common_commit is not None: query_parameters['diffCommonCommit'] = self._serialize.query('diff_common_commit', diff_common_commit, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if base_version_descriptor is not None: if base_version_descriptor.base_version_type is not None: query_parameters['baseVersionType'] = base_version_descriptor.base_version_type if base_version_descriptor.base_version is not None: query_parameters['baseVersion'] = base_version_descriptor.base_version if base_version_descriptor.base_version_options is not None: query_parameters['baseVersionOptions'] = base_version_descriptor.base_version_options if target_version_descriptor is not None: if target_version_descriptor.target_version_type is not None: query_parameters['targetVersionType'] = target_version_descriptor.target_version_type if target_version_descriptor.target_version is not None: query_parameters['targetVersion'] = target_version_descriptor.target_version if target_version_descriptor.target_version_options is not None: query_parameters['targetVersionOptions'] = target_version_descriptor.target_version_options response = self._send(http_method='GET', location_id='615588d5-c0c7-4b88-88f8-e625306446e8', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitCommitDiffs', response) def get_commit(self, commit_id, repository_id, project=None, change_count=None): """GetCommit. Retrieve a particular commit. :param str commit_id: The id of the commit. :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. :param str project: Project ID or project name :param int change_count: The number of changes to include in the result. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if commit_id is not None: route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if change_count is not None: query_parameters['changeCount'] = self._serialize.query('change_count', change_count, 'int') response = self._send(http_method='GET', location_id='c2570c3b-5b3f-41b8-98bf-5407bfde8d58', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitCommit', response) def get_commits(self, repository_id, search_criteria, project=None, skip=None, top=None): """GetCommits. Retrieve git commits for a project :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. :param :class:` ` search_criteria: :param str project: Project ID or project name :param int skip: :param int top: :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if search_criteria is not None: if search_criteria.ids is not None: query_parameters['searchCriteria.ids'] = search_criteria.ids if search_criteria.from_date is not None: query_parameters['searchCriteria.fromDate'] = search_criteria.from_date if search_criteria.to_date is not None: query_parameters['searchCriteria.toDate'] = search_criteria.to_date if search_criteria.item_version is not None: if search_criteria.item_version.version_type is not None: query_parameters['searchCriteria.itemVersion.versionType'] = search_criteria.item_version.version_type if search_criteria.item_version.version is not None: query_parameters['searchCriteria.itemVersion.version'] = search_criteria.item_version.version if search_criteria.item_version.version_options is not None: query_parameters['searchCriteria.itemVersion.versionOptions'] = search_criteria.item_version.version_options if search_criteria.compare_version is not None: if search_criteria.compare_version.version_type is not None: query_parameters['searchCriteria.compareVersion.versionType'] = search_criteria.compare_version.version_type if search_criteria.compare_version.version is not None: query_parameters['searchCriteria.compareVersion.version'] = search_criteria.compare_version.version if search_criteria.compare_version.version_options is not None: query_parameters['searchCriteria.compareVersion.versionOptions'] = search_criteria.compare_version.version_options if search_criteria.from_commit_id is not None: query_parameters['searchCriteria.fromCommitId'] = search_criteria.from_commit_id if search_criteria.to_commit_id is not None: query_parameters['searchCriteria.toCommitId'] = search_criteria.to_commit_id if search_criteria.user is not None: query_parameters['searchCriteria.user'] = search_criteria.user if search_criteria.author is not None: query_parameters['searchCriteria.author'] = search_criteria.author if search_criteria.item_path is not None: query_parameters['searchCriteria.itemPath'] = search_criteria.item_path if search_criteria.exclude_deletes is not None: query_parameters['searchCriteria.excludeDeletes'] = search_criteria.exclude_deletes if search_criteria.skip is not None: query_parameters['searchCriteria.$skip'] = search_criteria.skip if search_criteria.top is not None: query_parameters['searchCriteria.$top'] = search_criteria.top if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if search_criteria.include_work_items is not None: query_parameters['searchCriteria.includeWorkItems'] = search_criteria.include_work_items if search_criteria.include_user_image_url is not None: query_parameters['searchCriteria.includeUserImageUrl'] = search_criteria.include_user_image_url if search_criteria.include_push_data is not None: query_parameters['searchCriteria.includePushData'] = search_criteria.include_push_data if search_criteria.history_mode is not None: query_parameters['searchCriteria.historyMode'] = search_criteria.history_mode if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='c2570c3b-5b3f-41b8-98bf-5407bfde8d58', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_push_commits(self, repository_id, push_id, project=None, top=None, skip=None, include_links=None): """GetPushCommits. Retrieve a list of commits associated with a particular push. :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. :param int push_id: The id of the push. :param str project: Project ID or project name :param int top: The maximum number of commits to return ("get the top x commits"). :param int skip: The number of commits to skip. :param bool include_links: Set to false to avoid including REST Url links for resources. Defaults to true. :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if push_id is not None: query_parameters['pushId'] = self._serialize.query('push_id', push_id, 'int') if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['skip'] = self._serialize.query('skip', skip, 'int') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='c2570c3b-5b3f-41b8-98bf-5407bfde8d58', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_commits_batch(self, search_criteria, repository_id, project=None, skip=None, top=None, include_statuses=None): """GetCommitsBatch. Retrieve git commits for a project matching the search criteria :param :class:` ` search_criteria: Search options :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param int skip: Number of commits to skip. :param int top: Maximum number of commits to return. :param bool include_statuses: True to include additional commit status information. :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if include_statuses is not None: query_parameters['includeStatuses'] = self._serialize.query('include_statuses', include_statuses, 'bool') content = self._serialize.body(search_criteria, 'GitQueryCommitsCriteria') response = self._send(http_method='POST', location_id='6400dfb2-0bcb-462b-b992-5a57f8f1416c', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_item(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None): """GetItem. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str path: The item path. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitItem', response) def get_item_content(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, **kwargs): """GetItemContent. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str path: The item path. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_items(self, repository_id, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, include_links=None, version_descriptor=None): """GetItems. Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param bool include_links: Set to true to include links to items. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :rtype: [GitItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitItem]', self._unwrap_collection(response)) def get_item_text(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, **kwargs): """GetItemText. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str path: The item path. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_item_zip(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, **kwargs): """GetItemZip. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str path: The item path. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the latest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is the default branch for the repository. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_items_batch(self, request_data, repository_id, project=None): """GetItemsBatch. Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path :param :class:` ` request_data: Request data attributes: ItemDescriptors, IncludeContentMetadata, LatestProcessedChange, IncludeLinks. ItemDescriptors: Collection of items to fetch, including path, version, and recursion level. IncludeContentMetadata: Whether to include metadata for all items LatestProcessedChange: Whether to include shallow ref to commit that last changed each item. IncludeLinks: Whether to include the _links field on the shallow references. :param str repository_id: The name or ID of the repository :param str project: Project ID or project name :rtype: [[GitItem]] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(request_data, 'GitItemRequestData') response = self._send(http_method='POST', location_id='630fd2e4-fb88-4f85-ad21-13f3fd1fbca9', version='5.1', route_values=route_values, content=content) return self._deserialize('[[GitItem]]', self._unwrap_collection(response)) def get_pull_request_iteration_commits(self, repository_id, pull_request_id, iteration_id, project=None, top=None, skip=None): """GetPullRequestIterationCommits. Get the commits for the specified iteration of a pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the iteration from which to get the commits. :param str project: Project ID or project name :param int top: Maximum number of commits to return. The maximum number of commits that can be returned per batch is 500. :param int skip: Number of commits to skip. :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') query_parameters = {} if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='e7ea0883-095f-4926-b5fb-f24691c26fb9', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_pull_request_commits(self, repository_id, pull_request_id, project=None, top=None, continuation_token=None): """GetPullRequestCommits. Get the commits for the specified pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :param int top: Maximum number of commits to return. :param str continuation_token: The continuation token used for pagination. :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='52823034-34a8-4576-922c-8d8b77e9e4c4', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetPullRequestCommitsResponseValue(response_value, continuation_token) class GetPullRequestCommitsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_pull_request_commits method :param value: :type value: :class:`<[GitCommitRef]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def get_pull_request_iteration_changes(self, repository_id, pull_request_id, iteration_id, project=None, top=None, skip=None, compare_to=None): """GetPullRequestIterationChanges. Retrieve the changes made in a pull request between two iterations. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration.
Iteration IDs are zero-based with zero indicating the common commit between the source and target branches. Iteration one is the head of the source branch at the time the pull request is created and subsequent iterations are created when there are pushes to the source branch. :param str project: Project ID or project name :param int top: Optional. The number of changes to retrieve. The default value is 100 and the maximum value is 2000. :param int skip: Optional. The number of changes to ignore. For example, to retrieve changes 101-150, set top 50 and skip to 100. :param int compare_to: ID of the pull request iteration to compare against. The default value is zero which indicates the comparison is made against the common commit between the source and target branches :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if compare_to is not None: query_parameters['$compareTo'] = self._serialize.query('compare_to', compare_to, 'int') response = self._send(http_method='GET', location_id='4216bdcf-b6b1-4d59-8b82-c34cc183fc8b', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPullRequestIterationChanges', response) def get_pull_request_iteration(self, repository_id, pull_request_id, iteration_id, project=None): """GetPullRequestIteration. Get the specified iteration for a pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration to return. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') response = self._send(http_method='GET', location_id='d43911ee-6958-46b0-a42b-8445b8a0d004', version='5.1', route_values=route_values) return self._deserialize('GitPullRequestIteration', response) def get_pull_request_iterations(self, repository_id, pull_request_id, project=None, include_commits=None): """GetPullRequestIterations. Get the list of iterations for the specified pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :param bool include_commits: If true, include the commits associated with each iteration in the response. :rtype: [GitPullRequestIteration] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') query_parameters = {} if include_commits is not None: query_parameters['includeCommits'] = self._serialize.query('include_commits', include_commits, 'bool') response = self._send(http_method='GET', location_id='d43911ee-6958-46b0-a42b-8445b8a0d004', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequestIteration]', self._unwrap_collection(response)) def get_pull_request_query(self, queries, repository_id, project=None): """GetPullRequestQuery. This API is used to find what pull requests are related to a given commit. It can be used to either find the pull request that created a particular merge commit or it can be used to find all pull requests that have ever merged a particular commit. The input is a list of queries which each contain a list of commits. For each commit that you search against, you will get back a dictionary of commit -> pull requests. :param :class:` ` queries: The list of queries to perform. :param str repository_id: ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(queries, 'GitPullRequestQuery') response = self._send(http_method='POST', location_id='b3a6eebe-9cf0-49ea-b6cb-1a4c5f5007b0', version='5.1', route_values=route_values, content=content) return self._deserialize('GitPullRequestQuery', response) def create_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, reviewer_id, project=None): """CreatePullRequestReviewer. Add a reviewer to a pull request or cast a vote. :param :class:` ` reviewer: Reviewer's vote.
If the reviewer's ID is included here, it must match the reviewerID parameter.
Reviewers can set their own vote with this method. When adding other reviewers, vote must be set to zero. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str reviewer_id: ID of the reviewer. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if reviewer_id is not None: route_values['reviewerId'] = self._serialize.url('reviewer_id', reviewer_id, 'str') content = self._serialize.body(reviewer, 'IdentityRefWithVote') response = self._send(http_method='PUT', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.1', route_values=route_values, content=content) return self._deserialize('IdentityRefWithVote', response) def create_pull_request_reviewers(self, reviewers, repository_id, pull_request_id, project=None): """CreatePullRequestReviewers. Add reviewers to a pull request. :param [IdentityRef] reviewers: Reviewers to add to the pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [IdentityRefWithVote] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(reviewers, '[IdentityRef]') response = self._send(http_method='POST', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.1', route_values=route_values, content=content) return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) def delete_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): """DeletePullRequestReviewer. Remove a reviewer from a pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str reviewer_id: ID of the reviewer to remove. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if reviewer_id is not None: route_values['reviewerId'] = self._serialize.url('reviewer_id', reviewer_id, 'str') self._send(http_method='DELETE', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.1', route_values=route_values) def get_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): """GetPullRequestReviewer. Retrieve information about a particular reviewer on a pull request :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str reviewer_id: ID of the reviewer. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if reviewer_id is not None: route_values['reviewerId'] = self._serialize.url('reviewer_id', reviewer_id, 'str') response = self._send(http_method='GET', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.1', route_values=route_values) return self._deserialize('IdentityRefWithVote', response) def get_pull_request_reviewers(self, repository_id, pull_request_id, project=None): """GetPullRequestReviewers. Retrieve the reviewers for a pull request :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [IdentityRefWithVote] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.1', route_values=route_values) return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) def update_pull_request_reviewers(self, patch_votes, repository_id, pull_request_id, project=None): """UpdatePullRequestReviewers. Reset the votes of multiple reviewers on a pull request. NOTE: This endpoint only supports updating votes, but does not support updating required reviewers (use policy) or display names. :param [IdentityRefWithVote] patch_votes: IDs of the reviewers whose votes will be reset to zero :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(patch_votes, '[IdentityRefWithVote]') self._send(http_method='PATCH', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.1', route_values=route_values, content=content) def get_pull_request_by_id(self, pull_request_id, project=None): """GetPullRequestById. Retrieve a pull request. :param int pull_request_id: The ID of the pull request to retrieve. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='01a46dea-7d46-4d40-bc84-319e7c260d99', version='5.1', route_values=route_values) return self._deserialize('GitPullRequest', response) def get_pull_requests_by_project(self, project, search_criteria, max_comment_length=None, skip=None, top=None): """GetPullRequestsByProject. Retrieve all pull requests matching a specified criteria. :param str project: Project ID or project name :param :class:` ` search_criteria: Pull requests will be returned that match this search criteria. :param int max_comment_length: Not used. :param int skip: The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. :param int top: The number of pull requests to retrieve. :rtype: [GitPullRequest] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if search_criteria is not None: if search_criteria.repository_id is not None: query_parameters['searchCriteria.repositoryId'] = search_criteria.repository_id if search_criteria.creator_id is not None: query_parameters['searchCriteria.creatorId'] = search_criteria.creator_id if search_criteria.reviewer_id is not None: query_parameters['searchCriteria.reviewerId'] = search_criteria.reviewer_id if search_criteria.status is not None: query_parameters['searchCriteria.status'] = search_criteria.status if search_criteria.target_ref_name is not None: query_parameters['searchCriteria.targetRefName'] = search_criteria.target_ref_name if search_criteria.source_repository_id is not None: query_parameters['searchCriteria.sourceRepositoryId'] = search_criteria.source_repository_id if search_criteria.source_ref_name is not None: query_parameters['searchCriteria.sourceRefName'] = search_criteria.source_ref_name if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='a5d28130-9cd2-40fa-9f08-902e7daa9efb', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequest]', self._unwrap_collection(response)) def create_pull_request(self, git_pull_request_to_create, repository_id, project=None, supports_iterations=None): """CreatePullRequest. Create a pull request. :param :class:` ` git_pull_request_to_create: The pull request to create. :param str repository_id: The repository ID of the pull request's target branch. :param str project: Project ID or project name :param bool supports_iterations: If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if supports_iterations is not None: query_parameters['supportsIterations'] = self._serialize.query('supports_iterations', supports_iterations, 'bool') content = self._serialize.body(git_pull_request_to_create, 'GitPullRequest') response = self._send(http_method='POST', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('GitPullRequest', response) def get_pull_request(self, repository_id, pull_request_id, project=None, max_comment_length=None, skip=None, top=None, include_commits=None, include_work_item_refs=None): """GetPullRequest. Retrieve a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: The ID of the pull request to retrieve. :param str project: Project ID or project name :param int max_comment_length: Not used. :param int skip: Not used. :param int top: Not used. :param bool include_commits: If true, the pull request will be returned with the associated commits. :param bool include_work_item_refs: If true, the pull request will be returned with the associated work item references. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') query_parameters = {} if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if include_commits is not None: query_parameters['includeCommits'] = self._serialize.query('include_commits', include_commits, 'bool') if include_work_item_refs is not None: query_parameters['includeWorkItemRefs'] = self._serialize.query('include_work_item_refs', include_work_item_refs, 'bool') response = self._send(http_method='GET', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPullRequest', response) def get_pull_requests(self, repository_id, search_criteria, project=None, max_comment_length=None, skip=None, top=None): """GetPullRequests. Retrieve all pull requests matching a specified criteria. :param str repository_id: The repository ID of the pull request's target branch. :param :class:` ` search_criteria: Pull requests will be returned that match this search criteria. :param str project: Project ID or project name :param int max_comment_length: Not used. :param int skip: The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. :param int top: The number of pull requests to retrieve. :rtype: [GitPullRequest] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if search_criteria is not None: if search_criteria.repository_id is not None: query_parameters['searchCriteria.repositoryId'] = search_criteria.repository_id if search_criteria.creator_id is not None: query_parameters['searchCriteria.creatorId'] = search_criteria.creator_id if search_criteria.reviewer_id is not None: query_parameters['searchCriteria.reviewerId'] = search_criteria.reviewer_id if search_criteria.status is not None: query_parameters['searchCriteria.status'] = search_criteria.status if search_criteria.target_ref_name is not None: query_parameters['searchCriteria.targetRefName'] = search_criteria.target_ref_name if search_criteria.source_repository_id is not None: query_parameters['searchCriteria.sourceRepositoryId'] = search_criteria.source_repository_id if search_criteria.source_ref_name is not None: query_parameters['searchCriteria.sourceRefName'] = search_criteria.source_ref_name if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequest]', self._unwrap_collection(response)) def update_pull_request(self, git_pull_request_to_update, repository_id, pull_request_id, project=None): """UpdatePullRequest. Update a pull request :param :class:` ` git_pull_request_to_update: The pull request content that should be updated. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request to update. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(git_pull_request_to_update, 'GitPullRequest') response = self._send(http_method='PATCH', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', version='5.1', route_values=route_values, content=content) return self._deserialize('GitPullRequest', response) def create_comment(self, comment, repository_id, pull_request_id, thread_id, project=None): """CreateComment. Create a comment on a specific thread in a pull request (up to 500 comments can be created per thread). :param :class:` ` comment: The comment to create. Comments can be up to 150,000 characters. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') content = self._serialize.body(comment, 'Comment') response = self._send(http_method='POST', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.1', route_values=route_values, content=content) return self._deserialize('Comment', response) def delete_comment(self, repository_id, pull_request_id, thread_id, comment_id, project=None): """DeleteComment. Delete a comment associated with a specific thread in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param int comment_id: ID of the comment. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') if comment_id is not None: route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') self._send(http_method='DELETE', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.1', route_values=route_values) def get_comment(self, repository_id, pull_request_id, thread_id, comment_id, project=None): """GetComment. Retrieve a comment associated with a specific thread in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param int comment_id: ID of the comment. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') if comment_id is not None: route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') response = self._send(http_method='GET', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.1', route_values=route_values) return self._deserialize('Comment', response) def get_comments(self, repository_id, pull_request_id, thread_id, project=None): """GetComments. Retrieve all comments associated with a specific thread in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread. :param str project: Project ID or project name :rtype: [Comment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') response = self._send(http_method='GET', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.1', route_values=route_values) return self._deserialize('[Comment]', self._unwrap_collection(response)) def update_comment(self, comment, repository_id, pull_request_id, thread_id, comment_id, project=None): """UpdateComment. Update a comment associated with a specific thread in a pull request. :param :class:` ` comment: The comment content that should be updated. Comments can be up to 150,000 characters. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param int comment_id: ID of the comment to update. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') if comment_id is not None: route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') content = self._serialize.body(comment, 'Comment') response = self._send(http_method='PATCH', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.1', route_values=route_values, content=content) return self._deserialize('Comment', response) def create_thread(self, comment_thread, repository_id, pull_request_id, project=None): """CreateThread. Create a thread in a pull request. :param :class:` ` comment_thread: The thread to create. Thread must contain at least one comment. :param str repository_id: Repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(comment_thread, 'GitPullRequestCommentThread') response = self._send(http_method='POST', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', version='5.1', route_values=route_values, content=content) return self._deserialize('GitPullRequestCommentThread', response) def get_pull_request_thread(self, repository_id, pull_request_id, thread_id, project=None, iteration=None, base_iteration=None): """GetPullRequestThread. Retrieve a thread in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread. :param str project: Project ID or project name :param int iteration: If specified, thread position will be tracked using this iteration as the right side of the diff. :param int base_iteration: If specified, thread position will be tracked using this iteration as the left side of the diff. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') query_parameters = {} if iteration is not None: query_parameters['$iteration'] = self._serialize.query('iteration', iteration, 'int') if base_iteration is not None: query_parameters['$baseIteration'] = self._serialize.query('base_iteration', base_iteration, 'int') response = self._send(http_method='GET', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPullRequestCommentThread', response) def get_threads(self, repository_id, pull_request_id, project=None, iteration=None, base_iteration=None): """GetThreads. Retrieve all threads in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :param int iteration: If specified, thread positions will be tracked using this iteration as the right side of the diff. :param int base_iteration: If specified, thread positions will be tracked using this iteration as the left side of the diff. :rtype: [GitPullRequestCommentThread] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') query_parameters = {} if iteration is not None: query_parameters['$iteration'] = self._serialize.query('iteration', iteration, 'int') if base_iteration is not None: query_parameters['$baseIteration'] = self._serialize.query('base_iteration', base_iteration, 'int') response = self._send(http_method='GET', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequestCommentThread]', self._unwrap_collection(response)) def update_thread(self, comment_thread, repository_id, pull_request_id, thread_id, project=None): """UpdateThread. Update a thread in a pull request. :param :class:` ` comment_thread: The thread content that should be updated. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread to update. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') content = self._serialize.body(comment_thread, 'GitPullRequestCommentThread') response = self._send(http_method='PATCH', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', version='5.1', route_values=route_values, content=content) return self._deserialize('GitPullRequestCommentThread', response) def get_pull_request_work_item_refs(self, repository_id, pull_request_id, project=None): """GetPullRequestWorkItemRefs. Retrieve a list of work items associated with a pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='0a637fcc-5370-4ce8-b0e8-98091f5f9482', version='5.1', route_values=route_values) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) def create_push(self, push, repository_id, project=None): """CreatePush. Push changes to the repository. :param :class:` ` push: :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(push, 'GitPush') response = self._send(http_method='POST', location_id='ea98d07b-3c87-4971-8ede-a613694ffb55', version='5.1', route_values=route_values, content=content) return self._deserialize('GitPush', response) def get_push(self, repository_id, push_id, project=None, include_commits=None, include_ref_updates=None): """GetPush. Retrieves a particular push. :param str repository_id: The name or ID of the repository. :param int push_id: ID of the push. :param str project: Project ID or project name :param int include_commits: The number of commits to include in the result. :param bool include_ref_updates: If true, include the list of refs that were updated by the push. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if push_id is not None: route_values['pushId'] = self._serialize.url('push_id', push_id, 'int') query_parameters = {} if include_commits is not None: query_parameters['includeCommits'] = self._serialize.query('include_commits', include_commits, 'int') if include_ref_updates is not None: query_parameters['includeRefUpdates'] = self._serialize.query('include_ref_updates', include_ref_updates, 'bool') response = self._send(http_method='GET', location_id='ea98d07b-3c87-4971-8ede-a613694ffb55', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPush', response) def get_pushes(self, repository_id, project=None, skip=None, top=None, search_criteria=None): """GetPushes. Retrieves pushes associated with the specified repository. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param int skip: Number of pushes to skip. :param int top: Number of pushes to return. :param :class:` ` search_criteria: Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references. :rtype: [GitPush] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if search_criteria is not None: if search_criteria.from_date is not None: query_parameters['searchCriteria.fromDate'] = search_criteria.from_date if search_criteria.to_date is not None: query_parameters['searchCriteria.toDate'] = search_criteria.to_date if search_criteria.pusher_id is not None: query_parameters['searchCriteria.pusherId'] = search_criteria.pusher_id if search_criteria.ref_name is not None: query_parameters['searchCriteria.refName'] = search_criteria.ref_name if search_criteria.include_ref_updates is not None: query_parameters['searchCriteria.includeRefUpdates'] = search_criteria.include_ref_updates if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links response = self._send(http_method='GET', location_id='ea98d07b-3c87-4971-8ede-a613694ffb55', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPush]', self._unwrap_collection(response)) def get_refs(self, repository_id, project=None, filter=None, include_links=None, include_statuses=None, include_my_branches=None, latest_statuses_only=None, peel_tags=None, filter_contains=None, top=None, continuation_token=None): """GetRefs. Queries the provided repository for its refs and returns them. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param str filter: [optional] A filter to apply to the refs (starts with). :param bool include_links: [optional] Specifies if referenceLinks should be included in the result. default is false. :param bool include_statuses: [optional] Includes up to the first 1000 commit statuses for each ref. The default value is false. :param bool include_my_branches: [optional] Includes only branches that the user owns, the branches the user favorites, and the default branch. The default value is false. Cannot be combined with the filter parameter. :param bool latest_statuses_only: [optional] True to include only the tip commit status for each ref. This option requires `includeStatuses` to be true. The default value is false. :param bool peel_tags: [optional] Annotated tags will populate the PeeledObjectId property. default is false. :param str filter_contains: [optional] A filter to apply to the refs (contains). :param int top: [optional] Maximum number of refs to return. It cannot be bigger than 1000. If it is not provided but continuationToken is, top will default to 100. :param str continuation_token: The continuation token used for pagination. :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if filter is not None: query_parameters['filter'] = self._serialize.query('filter', filter, 'str') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') if include_statuses is not None: query_parameters['includeStatuses'] = self._serialize.query('include_statuses', include_statuses, 'bool') if include_my_branches is not None: query_parameters['includeMyBranches'] = self._serialize.query('include_my_branches', include_my_branches, 'bool') if latest_statuses_only is not None: query_parameters['latestStatusesOnly'] = self._serialize.query('latest_statuses_only', latest_statuses_only, 'bool') if peel_tags is not None: query_parameters['peelTags'] = self._serialize.query('peel_tags', peel_tags, 'bool') if filter_contains is not None: query_parameters['filterContains'] = self._serialize.query('filter_contains', filter_contains, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[GitRef]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetRefsResponseValue(response_value, continuation_token) class GetRefsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_refs method :param value: :type value: :class:`<[GitRef]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def update_ref(self, new_ref_info, repository_id, filter, project=None, project_id=None): """UpdateRef. Lock or Unlock a branch. :param :class:` ` new_ref_info: The ref update action (lock/unlock) to perform :param str repository_id: The name or ID of the repository. :param str filter: The name of the branch to lock/unlock :param str project: Project ID or project name :param str project_id: ID or name of the team project. Optional if specifying an ID for repository. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if filter is not None: query_parameters['filter'] = self._serialize.query('filter', filter, 'str') if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') content = self._serialize.body(new_ref_info, 'GitRefUpdate') response = self._send(http_method='PATCH', location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('GitRef', response) def update_refs(self, ref_updates, repository_id, project=None, project_id=None): """UpdateRefs. Creating, updating, or deleting refs(branches). :param [GitRefUpdate] ref_updates: List of ref updates to attempt to perform :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param str project_id: ID or name of the team project. Optional if specifying an ID for repository. :rtype: [GitRefUpdateResult] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') content = self._serialize.body(ref_updates, '[GitRefUpdate]') response = self._send(http_method='POST', location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[GitRefUpdateResult]', self._unwrap_collection(response)) def create_repository(self, git_repository_to_create, project=None, source_ref=None): """CreateRepository. Create a git repository in a team project. :param :class:` ` git_repository_to_create: Specify the repo name, team project and/or parent repository. Team project information can be ommitted from gitRepositoryToCreate if the request is project-scoped (i.e., includes project Id). :param str project: Project ID or project name :param str source_ref: [optional] Specify the source refs to use while creating a fork repo :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if source_ref is not None: query_parameters['sourceRef'] = self._serialize.query('source_ref', source_ref, 'str') content = self._serialize.body(git_repository_to_create, 'GitRepositoryCreateOptions') response = self._send(http_method='POST', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('GitRepository', response) def delete_repository(self, repository_id, project=None): """DeleteRepository. Delete a git repository :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') self._send(http_method='DELETE', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.1', route_values=route_values) def get_repositories(self, project=None, include_links=None, include_all_urls=None, include_hidden=None): """GetRepositories. Retrieve git repositories. :param str project: Project ID or project name :param bool include_links: [optional] True to include reference links. The default value is false. :param bool include_all_urls: [optional] True to include all remote URLs. The default value is false. :param bool include_hidden: [optional] True to include hidden repositories. The default value is false. :rtype: [GitRepository] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') if include_all_urls is not None: query_parameters['includeAllUrls'] = self._serialize.query('include_all_urls', include_all_urls, 'bool') if include_hidden is not None: query_parameters['includeHidden'] = self._serialize.query('include_hidden', include_hidden, 'bool') response = self._send(http_method='GET', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitRepository]', self._unwrap_collection(response)) def get_repository(self, repository_id, project=None): """GetRepository. Retrieve a git repository. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') response = self._send(http_method='GET', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.1', route_values=route_values) return self._deserialize('GitRepository', response) def get_repository_with_parent(self, repository_id, include_parent, project=None): """GetRepositoryWithParent. Retrieve a git repository. :param str repository_id: The name or ID of the repository. :param bool include_parent: True to include parent repository. Only available in authenticated calls. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if include_parent is not None: query_parameters['includeParent'] = self._serialize.query('include_parent', include_parent, 'bool') response = self._send(http_method='GET', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitRepository', response) def update_repository(self, new_repository_info, repository_id, project=None): """UpdateRepository. Updates the Git repository with either a new repo name or a new default branch. :param :class:` ` new_repository_info: Specify a new repo name or a new default branch of the repository :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(new_repository_info, 'GitRepository') response = self._send(http_method='PATCH', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.1', route_values=route_values, content=content) return self._deserialize('GitRepository', response) def create_commit_status(self, git_commit_status_to_create, commit_id, repository_id, project=None): """CreateCommitStatus. Create Git commit status. :param :class:` ` git_commit_status_to_create: Git commit status object to create. :param str commit_id: ID of the Git commit. :param str repository_id: ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if commit_id is not None: route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(git_commit_status_to_create, 'GitStatus') response = self._send(http_method='POST', location_id='428dd4fb-fda5-4722-af02-9313b80305da', version='5.1', route_values=route_values, content=content) return self._deserialize('GitStatus', response) def get_statuses(self, commit_id, repository_id, project=None, top=None, skip=None, latest_only=None): """GetStatuses. Get statuses associated with the Git commit. :param str commit_id: ID of the Git commit. :param str repository_id: ID of the repository. :param str project: Project ID or project name :param int top: Optional. The number of statuses to retrieve. Default is 1000. :param int skip: Optional. The number of statuses to ignore. Default is 0. For example, to retrieve results 101-150, set top to 50 and skip to 100. :param bool latest_only: The flag indicates whether to get only latest statuses grouped by `Context.Name` and `Context.Genre`. :rtype: [GitStatus] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if commit_id is not None: route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['skip'] = self._serialize.query('skip', skip, 'int') if latest_only is not None: query_parameters['latestOnly'] = self._serialize.query('latest_only', latest_only, 'bool') response = self._send(http_method='GET', location_id='428dd4fb-fda5-4722-af02-9313b80305da', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitStatus]', self._unwrap_collection(response)) def get_tree(self, repository_id, sha1, project=None, project_id=None, recursive=None, file_name=None): """GetTree. The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository. :param str repository_id: Repository Id. :param str sha1: SHA1 hash of the tree object. :param str project: Project ID or project name :param str project_id: Project Id. :param bool recursive: Search recursively. Include trees underneath this tree. Default is false. :param str file_name: Name to use if a .zip file is returned. Default is the object ID. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') if recursive is not None: query_parameters['recursive'] = self._serialize.query('recursive', recursive, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='729f6437-6f92-44ec-8bee-273a7111063c', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitTreeRef', response) def get_tree_zip(self, repository_id, sha1, project=None, project_id=None, recursive=None, file_name=None, **kwargs): """GetTreeZip. The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository. :param str repository_id: Repository Id. :param str sha1: SHA1 hash of the tree object. :param str project: Project ID or project name :param str project_id: Project Id. :param bool recursive: Search recursively. Include trees underneath this tree. Default is false. :param str file_name: Name to use if a .zip file is returned. Default is the object ID. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') if recursive is not None: query_parameters['recursive'] = self._serialize.query('recursive', recursive, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='729f6437-6f92-44ec-8bee-273a7111063c', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/identity/000077500000000000000000000000001360605530400317215ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/identity/__init__.py000066400000000000000000000021441360605530400340330ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.identity.models import * from .identity_client import IdentityClient __all__ = [ 'AccessTokenResult', 'AuthorizationGrant', 'ChangedIdentities', 'ChangedIdentitiesContext', 'CreateScopeInfo', 'FrameworkIdentityInfo', 'GroupMembership', 'Identity', 'IdentityBase', 'IdentityBatchInfo', 'IdentityScope', 'IdentitySelf', 'IdentitySnapshot', 'IdentityUpdateData', 'JsonPatchOperation', 'JsonWebToken', 'RefreshTokenGrant', 'SwapIdentityInfo', 'TenantInfo', 'IdentityClient' ] identity_client.py000066400000000000000000000315201360605530400354040ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/identity# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.identity import models class IdentityClient(Client): """Identity :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(IdentityClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '8a3d49b8-91f0-46ef-b33d-dda338c25db3' def create_groups(self, container): """CreateGroups. :param :class:` ` container: :rtype: [Identity] """ content = self._serialize.body(container, 'object') response = self._send(http_method='POST', location_id='5966283b-4196-4d57-9211-1b68f41ec1c2', version='5.1', content=content) return self._deserialize('[Identity]', self._unwrap_collection(response)) def delete_group(self, group_id): """DeleteGroup. :param str group_id: """ route_values = {} if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') self._send(http_method='DELETE', location_id='5966283b-4196-4d57-9211-1b68f41ec1c2', version='5.1', route_values=route_values) def list_groups(self, scope_ids=None, recurse=None, deleted=None, properties=None): """ListGroups. :param str scope_ids: :param bool recurse: :param bool deleted: :param str properties: :rtype: [Identity] """ query_parameters = {} if scope_ids is not None: query_parameters['scopeIds'] = self._serialize.query('scope_ids', scope_ids, 'str') if recurse is not None: query_parameters['recurse'] = self._serialize.query('recurse', recurse, 'bool') if deleted is not None: query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='5966283b-4196-4d57-9211-1b68f41ec1c2', version='5.1', query_parameters=query_parameters) return self._deserialize('[Identity]', self._unwrap_collection(response)) def get_identity_changes(self, identity_sequence_id, group_sequence_id, organization_identity_sequence_id=None, page_size=None, scope_id=None): """GetIdentityChanges. :param int identity_sequence_id: :param int group_sequence_id: :param int organization_identity_sequence_id: :param int page_size: :param str scope_id: :rtype: :class:` ` """ query_parameters = {} if identity_sequence_id is not None: query_parameters['identitySequenceId'] = self._serialize.query('identity_sequence_id', identity_sequence_id, 'int') if group_sequence_id is not None: query_parameters['groupSequenceId'] = self._serialize.query('group_sequence_id', group_sequence_id, 'int') if organization_identity_sequence_id is not None: query_parameters['organizationIdentitySequenceId'] = self._serialize.query('organization_identity_sequence_id', organization_identity_sequence_id, 'int') if page_size is not None: query_parameters['pageSize'] = self._serialize.query('page_size', page_size, 'int') if scope_id is not None: query_parameters['scopeId'] = self._serialize.query('scope_id', scope_id, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.1', query_parameters=query_parameters) return self._deserialize('ChangedIdentities', response) def get_user_identity_ids_by_domain_id(self, domain_id): """GetUserIdentityIdsByDomainId. :param str domain_id: :rtype: [str] """ query_parameters = {} if domain_id is not None: query_parameters['domainId'] = self._serialize.query('domain_id', domain_id, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.1', query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def read_identities(self, descriptors=None, identity_ids=None, subject_descriptors=None, social_descriptors=None, search_filter=None, filter_value=None, query_membership=None, properties=None, include_restricted_visibility=None, options=None): """ReadIdentities. :param str descriptors: :param str identity_ids: :param str subject_descriptors: :param str social_descriptors: :param str search_filter: :param str filter_value: :param str query_membership: :param str properties: :param bool include_restricted_visibility: :param str options: :rtype: [Identity] """ query_parameters = {} if descriptors is not None: query_parameters['descriptors'] = self._serialize.query('descriptors', descriptors, 'str') if identity_ids is not None: query_parameters['identityIds'] = self._serialize.query('identity_ids', identity_ids, 'str') if subject_descriptors is not None: query_parameters['subjectDescriptors'] = self._serialize.query('subject_descriptors', subject_descriptors, 'str') if social_descriptors is not None: query_parameters['socialDescriptors'] = self._serialize.query('social_descriptors', social_descriptors, 'str') if search_filter is not None: query_parameters['searchFilter'] = self._serialize.query('search_filter', search_filter, 'str') if filter_value is not None: query_parameters['filterValue'] = self._serialize.query('filter_value', filter_value, 'str') if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') if include_restricted_visibility is not None: query_parameters['includeRestrictedVisibility'] = self._serialize.query('include_restricted_visibility', include_restricted_visibility, 'bool') if options is not None: query_parameters['options'] = self._serialize.query('options', options, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.1', query_parameters=query_parameters) return self._deserialize('[Identity]', self._unwrap_collection(response)) def read_identities_by_scope(self, scope_id, query_membership=None, properties=None): """ReadIdentitiesByScope. :param str scope_id: :param str query_membership: :param str properties: :rtype: [Identity] """ query_parameters = {} if scope_id is not None: query_parameters['scopeId'] = self._serialize.query('scope_id', scope_id, 'str') if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.1', query_parameters=query_parameters) return self._deserialize('[Identity]', self._unwrap_collection(response)) def read_identity(self, identity_id, query_membership=None, properties=None): """ReadIdentity. :param str identity_id: :param str query_membership: :param str properties: :rtype: :class:` ` """ route_values = {} if identity_id is not None: route_values['identityId'] = self._serialize.url('identity_id', identity_id, 'str') query_parameters = {} if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Identity', response) def update_identities(self, identities): """UpdateIdentities. :param :class:` ` identities: :rtype: [IdentityUpdateData] """ content = self._serialize.body(identities, 'VssJsonCollectionWrapper') response = self._send(http_method='PUT', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.1', content=content) return self._deserialize('[IdentityUpdateData]', self._unwrap_collection(response)) def update_identity(self, identity, identity_id): """UpdateIdentity. :param :class:` ` identity: :param str identity_id: """ route_values = {} if identity_id is not None: route_values['identityId'] = self._serialize.url('identity_id', identity_id, 'str') content = self._serialize.body(identity, 'Identity') self._send(http_method='PUT', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.1', route_values=route_values, content=content) def create_identity(self, framework_identity_info): """CreateIdentity. :param :class:` ` framework_identity_info: :rtype: :class:` ` """ content = self._serialize.body(framework_identity_info, 'FrameworkIdentityInfo') response = self._send(http_method='PUT', location_id='dd55f0eb-6ea2-4fe4-9ebe-919e7dd1dfb4', version='5.1', content=content) return self._deserialize('Identity', response) def get_max_sequence_id(self): """GetMaxSequenceId. Read the max sequence id of all the identities. :rtype: long """ response = self._send(http_method='GET', location_id='e4a70778-cb2c-4e85-b7cc-3f3c7ae2d408', version='5.1') return self._deserialize('long', response) def get_self(self): """GetSelf. Read identity of the home tenant request user. :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='4bb02b5b-c120-4be2-b68e-21f7c50a4b82', version='5.1') return self._deserialize('IdentitySelf', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/notification/000077500000000000000000000000001360605530400325565ustar00rootroot00000000000000__init__.py000066400000000000000000000051101360605530400346050ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/notification# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.notification.models import * from .notification_client import NotificationClient __all__ = [ 'ArtifactFilter', 'BaseSubscriptionFilter', 'BatchNotificationOperation', 'EventActor', 'EventScope', 'EventsEvaluationResult', 'EventTransformRequest', 'EventTransformResult', 'ExpressionFilterClause', 'ExpressionFilterGroup', 'ExpressionFilterModel', 'FieldInputValues', 'FieldValuesQuery', 'GraphSubjectBase', 'IdentityRef', 'INotificationDiagnosticLog', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'ISubscriptionChannel', 'ISubscriptionFilter', 'NotificationAdminSettings', 'NotificationAdminSettingsUpdateParameters', 'NotificationDiagnosticLogMessage', 'NotificationEventField', 'NotificationEventFieldOperator', 'NotificationEventFieldType', 'NotificationEventPublisher', 'NotificationEventRole', 'NotificationEventType', 'NotificationEventTypeCategory', 'NotificationQueryCondition', 'NotificationReason', 'NotificationsEvaluationResult', 'NotificationStatistic', 'NotificationStatisticsQuery', 'NotificationStatisticsQueryConditions', 'NotificationSubscriber', 'NotificationSubscriberUpdateParameters', 'NotificationSubscription', 'NotificationSubscriptionCreateParameters', 'NotificationSubscriptionTemplate', 'NotificationSubscriptionUpdateParameters', 'OperatorConstraint', 'ReferenceLinks', 'SubscriptionAdminSettings', 'SubscriptionChannelWithAddress', 'SubscriptionDiagnostics', 'SubscriptionEvaluationRequest', 'SubscriptionEvaluationResult', 'SubscriptionEvaluationSettings', 'SubscriptionManagement', 'SubscriptionQuery', 'SubscriptionQueryCondition', 'SubscriptionScope', 'SubscriptionTracing', 'SubscriptionUserSettings', 'UpdateSubscripitonDiagnosticsParameters', 'UpdateSubscripitonTracingParameters', 'ValueDefinition', 'VssNotificationEvent', 'NotificationClient' ] notification_client.py000066400000000000000000000410531360605530400371000ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/notification# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.notification import models class NotificationClient(Client): """Notification :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(NotificationClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def list_logs(self, source, entry_id=None, start_time=None, end_time=None): """ListLogs. Get a list of diagnostic logs for this service. :param str source: ID specifying which type of logs to check diagnostics for. :param str entry_id: The ID of the specific log to query for. :param datetime start_time: Start time for the time range to query in. :param datetime end_time: End time for the time range to query in. :rtype: [INotificationDiagnosticLog] """ route_values = {} if source is not None: route_values['source'] = self._serialize.url('source', source, 'str') if entry_id is not None: route_values['entryId'] = self._serialize.url('entry_id', entry_id, 'str') query_parameters = {} if start_time is not None: query_parameters['startTime'] = self._serialize.query('start_time', start_time, 'iso-8601') if end_time is not None: query_parameters['endTime'] = self._serialize.query('end_time', end_time, 'iso-8601') response = self._send(http_method='GET', location_id='991842f3-eb16-4aea-ac81-81353ef2b75c', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[INotificationDiagnosticLog]', self._unwrap_collection(response)) def get_subscription_diagnostics(self, subscription_id): """GetSubscriptionDiagnostics. Get the diagnostics settings for a subscription. :param str subscription_id: The id of the notifications subscription. :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') response = self._send(http_method='GET', location_id='20f1929d-4be7-4c2e-a74e-d47640ff3418', version='5.1', route_values=route_values) return self._deserialize('SubscriptionDiagnostics', response) def update_subscription_diagnostics(self, update_parameters, subscription_id): """UpdateSubscriptionDiagnostics. Update the diagnostics settings for a subscription. :param :class:` ` update_parameters: :param str subscription_id: The id of the notifications subscription. :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') content = self._serialize.body(update_parameters, 'UpdateSubscripitonDiagnosticsParameters') response = self._send(http_method='PUT', location_id='20f1929d-4be7-4c2e-a74e-d47640ff3418', version='5.1', route_values=route_values, content=content) return self._deserialize('SubscriptionDiagnostics', response) def get_event_type(self, event_type): """GetEventType. Get a specific event type. :param str event_type: The ID of the event type. :rtype: :class:` ` """ route_values = {} if event_type is not None: route_values['eventType'] = self._serialize.url('event_type', event_type, 'str') response = self._send(http_method='GET', location_id='cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21', version='5.1', route_values=route_values) return self._deserialize('NotificationEventType', response) def list_event_types(self, publisher_id=None): """ListEventTypes. List available event types for this service. Optionally filter by only event types for the specified publisher. :param str publisher_id: Limit to event types for this publisher :rtype: [NotificationEventType] """ query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21', version='5.1', query_parameters=query_parameters) return self._deserialize('[NotificationEventType]', self._unwrap_collection(response)) def get_settings(self): """GetSettings. :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='cbe076d8-2803-45ff-8d8d-44653686ea2a', version='5.1') return self._deserialize('NotificationAdminSettings', response) def update_settings(self, update_parameters): """UpdateSettings. :param :class:` ` update_parameters: :rtype: :class:` ` """ content = self._serialize.body(update_parameters, 'NotificationAdminSettingsUpdateParameters') response = self._send(http_method='PATCH', location_id='cbe076d8-2803-45ff-8d8d-44653686ea2a', version='5.1', content=content) return self._deserialize('NotificationAdminSettings', response) def get_subscriber(self, subscriber_id): """GetSubscriber. Get delivery preferences of a notifications subscriber. :param str subscriber_id: ID of the user or group. :rtype: :class:` ` """ route_values = {} if subscriber_id is not None: route_values['subscriberId'] = self._serialize.url('subscriber_id', subscriber_id, 'str') response = self._send(http_method='GET', location_id='4d5caff1-25ba-430b-b808-7a1f352cc197', version='5.1', route_values=route_values) return self._deserialize('NotificationSubscriber', response) def update_subscriber(self, update_parameters, subscriber_id): """UpdateSubscriber. Update delivery preferences of a notifications subscriber. :param :class:` ` update_parameters: :param str subscriber_id: ID of the user or group. :rtype: :class:` ` """ route_values = {} if subscriber_id is not None: route_values['subscriberId'] = self._serialize.url('subscriber_id', subscriber_id, 'str') content = self._serialize.body(update_parameters, 'NotificationSubscriberUpdateParameters') response = self._send(http_method='PATCH', location_id='4d5caff1-25ba-430b-b808-7a1f352cc197', version='5.1', route_values=route_values, content=content) return self._deserialize('NotificationSubscriber', response) def query_subscriptions(self, subscription_query): """QuerySubscriptions. Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions. :param :class:` ` subscription_query: :rtype: [NotificationSubscription] """ content = self._serialize.body(subscription_query, 'SubscriptionQuery') response = self._send(http_method='POST', location_id='6864db85-08c0-4006-8e8e-cc1bebe31675', version='5.1', content=content) return self._deserialize('[NotificationSubscription]', self._unwrap_collection(response)) def create_subscription(self, create_parameters): """CreateSubscription. Create a new subscription. :param :class:` ` create_parameters: :rtype: :class:` ` """ content = self._serialize.body(create_parameters, 'NotificationSubscriptionCreateParameters') response = self._send(http_method='POST', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.1', content=content) return self._deserialize('NotificationSubscription', response) def delete_subscription(self, subscription_id): """DeleteSubscription. Delete a subscription. :param str subscription_id: """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') self._send(http_method='DELETE', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.1', route_values=route_values) def get_subscription(self, subscription_id, query_flags=None): """GetSubscription. Get a notification subscription by its ID. :param str subscription_id: :param str query_flags: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') query_parameters = {} if query_flags is not None: query_parameters['queryFlags'] = self._serialize.query('query_flags', query_flags, 'str') response = self._send(http_method='GET', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('NotificationSubscription', response) def list_subscriptions(self, target_id=None, ids=None, query_flags=None): """ListSubscriptions. Get a list of notification subscriptions, either by subscription IDs or by all subscriptions for a given user or group. :param str target_id: User or Group ID :param [str] ids: List of subscription IDs :param str query_flags: :rtype: [NotificationSubscription] """ query_parameters = {} if target_id is not None: query_parameters['targetId'] = self._serialize.query('target_id', target_id, 'str') if ids is not None: ids = ",".join(ids) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') if query_flags is not None: query_parameters['queryFlags'] = self._serialize.query('query_flags', query_flags, 'str') response = self._send(http_method='GET', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.1', query_parameters=query_parameters) return self._deserialize('[NotificationSubscription]', self._unwrap_collection(response)) def update_subscription(self, update_parameters, subscription_id): """UpdateSubscription. Update an existing subscription. Depending on the type of subscription and permissions, the caller can update the description, filter settings, channel (delivery) settings and more. :param :class:` ` update_parameters: :param str subscription_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') content = self._serialize.body(update_parameters, 'NotificationSubscriptionUpdateParameters') response = self._send(http_method='PATCH', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.1', route_values=route_values, content=content) return self._deserialize('NotificationSubscription', response) def get_subscription_templates(self): """GetSubscriptionTemplates. Get available subscription templates. :rtype: [NotificationSubscriptionTemplate] """ response = self._send(http_method='GET', location_id='fa5d24ba-7484-4f3d-888d-4ec6b1974082', version='5.1') return self._deserialize('[NotificationSubscriptionTemplate]', self._unwrap_collection(response)) def update_subscription_user_settings(self, user_settings, subscription_id, user_id): """UpdateSubscriptionUserSettings. Update the specified user's settings for the specified subscription. This API is typically used to opt in or out of a shared subscription. User settings can only be applied to shared subscriptions, like team subscriptions or default subscriptions. :param :class:` ` user_settings: :param str subscription_id: :param str user_id: ID of the user :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') content = self._serialize.body(user_settings, 'SubscriptionUserSettings') response = self._send(http_method='PUT', location_id='ed5a3dff-aeb5-41b1-b4f7-89e66e58b62e', version='5.1', route_values=route_values, content=content) return self._deserialize('SubscriptionUserSettings', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/operations/000077500000000000000000000000001360605530400322535ustar00rootroot00000000000000__init__.py000066400000000000000000000014151360605530400343060ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/operations# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.operations.models import * from .operations_client import OperationsClient __all__ = [ 'Operation', 'OperationReference', 'OperationResultReference', 'ReferenceLinks', 'OperationsClient' ] operations_client.py000066400000000000000000000042611360605530400362720ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/operations# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.operations import models class OperationsClient(Client): """Operations :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(OperationsClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_operation(self, operation_id, plugin_id=None): """GetOperation. Gets an operation from the the operationId using the given pluginId. :param str operation_id: The ID for the operation. :param str plugin_id: The ID for the plugin. :rtype: :class:` ` """ route_values = {} if operation_id is not None: route_values['operationId'] = self._serialize.url('operation_id', operation_id, 'str') query_parameters = {} if plugin_id is not None: query_parameters['pluginId'] = self._serialize.query('plugin_id', plugin_id, 'str') response = self._send(http_method='GET', location_id='9a1b74b4-2ca8-4a9f-8470-c2f2e6fdc949', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Operation', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/policy/000077500000000000000000000000001360605530400313675ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/policy/__init__.py000066400000000000000000000016021360605530400334770ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.policy.models import * from .policy_client import PolicyClient __all__ = [ 'GraphSubjectBase', 'IdentityRef', 'PolicyConfiguration', 'PolicyConfigurationRef', 'PolicyEvaluationRecord', 'PolicyType', 'PolicyTypeRef', 'ReferenceLinks', 'VersionedPolicyConfigurationRef', 'PolicyClient' ] policy_client.py000066400000000000000000000277721360605530400345360ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/policy# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.policy import models class PolicyClient(Client): """Policy :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(PolicyClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'fb13a388-40dd-4a04-b530-013a739c72ef' def create_policy_configuration(self, configuration, project, configuration_id=None): """CreatePolicyConfiguration. Create a policy configuration of a given policy type. :param :class:` ` configuration: The policy configuration to create. :param str project: Project ID or project name :param int configuration_id: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') content = self._serialize.body(configuration, 'PolicyConfiguration') response = self._send(http_method='POST', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.1', route_values=route_values, content=content) return self._deserialize('PolicyConfiguration', response) def delete_policy_configuration(self, project, configuration_id): """DeletePolicyConfiguration. Delete a policy configuration by its ID. :param str project: Project ID or project name :param int configuration_id: ID of the policy configuration to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') self._send(http_method='DELETE', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.1', route_values=route_values) def get_policy_configuration(self, project, configuration_id): """GetPolicyConfiguration. Get a policy configuration by its ID. :param str project: Project ID or project name :param int configuration_id: ID of the policy configuration :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') response = self._send(http_method='GET', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.1', route_values=route_values) return self._deserialize('PolicyConfiguration', response) def get_policy_configurations(self, project, scope=None, top=None, continuation_token=None, policy_type=None): """GetPolicyConfigurations. Get a list of policy configurations in a project. :param str project: Project ID or project name :param str scope: [Provided for legacy reasons] The scope on which a subset of policies is defined. :param int top: Maximum number of policies to return. :param str continuation_token: The continuation token used for pagination. :param str policy_type: Filter returned policies to only this type :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if scope is not None: query_parameters['scope'] = self._serialize.query('scope', scope, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if policy_type is not None: query_parameters['policyType'] = self._serialize.query('policy_type', policy_type, 'str') response = self._send(http_method='GET', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetPolicyConfigurationsResponseValue(response_value, continuation_token) class GetPolicyConfigurationsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_policy_configurations method :param value: :type value: :class:`<[PolicyConfiguration]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def update_policy_configuration(self, configuration, project, configuration_id): """UpdatePolicyConfiguration. Update a policy configuration by its ID. :param :class:` ` configuration: The policy configuration to update. :param str project: Project ID or project name :param int configuration_id: ID of the existing policy configuration to be updated. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') content = self._serialize.body(configuration, 'PolicyConfiguration') response = self._send(http_method='PUT', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.1', route_values=route_values, content=content) return self._deserialize('PolicyConfiguration', response) def get_policy_configuration_revision(self, project, configuration_id, revision_id): """GetPolicyConfigurationRevision. Retrieve a specific revision of a given policy by ID. :param str project: Project ID or project name :param int configuration_id: The policy configuration ID. :param int revision_id: The revision ID. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') if revision_id is not None: route_values['revisionId'] = self._serialize.url('revision_id', revision_id, 'int') response = self._send(http_method='GET', location_id='fe1e68a2-60d3-43cb-855b-85e41ae97c95', version='5.1', route_values=route_values) return self._deserialize('PolicyConfiguration', response) def get_policy_configuration_revisions(self, project, configuration_id, top=None, skip=None): """GetPolicyConfigurationRevisions. Retrieve all revisions for a given policy. :param str project: Project ID or project name :param int configuration_id: The policy configuration ID. :param int top: The number of revisions to retrieve. :param int skip: The number of revisions to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. :rtype: [PolicyConfiguration] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='fe1e68a2-60d3-43cb-855b-85e41ae97c95', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) def get_policy_type(self, project, type_id): """GetPolicyType. Retrieve a specific policy type by ID. :param str project: Project ID or project name :param str type_id: The policy ID. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type_id is not None: route_values['typeId'] = self._serialize.url('type_id', type_id, 'str') response = self._send(http_method='GET', location_id='44096322-2d3d-466a-bb30-d1b7de69f61f', version='5.1', route_values=route_values) return self._deserialize('PolicyType', response) def get_policy_types(self, project): """GetPolicyTypes. Retrieve all available policy types. :param str project: Project ID or project name :rtype: [PolicyType] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='44096322-2d3d-466a-bb30-d1b7de69f61f', version='5.1', route_values=route_values) return self._deserialize('[PolicyType]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/profile/000077500000000000000000000000001360605530400315305ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/profile/__init__.py000066400000000000000000000016331360605530400336440ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.profile.models import * from .profile_client import ProfileClient __all__ = [ 'AttributeDescriptor', 'AttributesContainer', 'Avatar', 'CoreProfileAttribute', 'CreateProfileContext', 'GeoRegion', 'Profile', 'ProfileAttribute', 'ProfileAttributeBase', 'ProfileRegion', 'ProfileRegions', 'ProfileClient' ] profile_client.py000066400000000000000000000066571360605530400350370ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/profile# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.profile import models class ProfileClient(Client): """Profile :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ProfileClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '8ccfef3d-2b87-4e99-8ccb-66e343d2daa8' def get_profile(self, id, details=None, with_attributes=None, partition=None, core_attributes=None, force_refresh=None): """GetProfile. Gets a user profile. :param str id: The ID of the target user profile within the same organization, or 'me' to get the profile of the current authenticated user. :param bool details: Return public profile information such as display name, email address, country, etc. If false, the withAttributes parameter is ignored. :param bool with_attributes: If true, gets the attributes (named key-value pairs of arbitrary data) associated with the profile. The partition parameter must also have a value. :param str partition: The partition (named group) of attributes to return. :param str core_attributes: A comma-delimited list of core profile attributes to return. Valid values are Email, Avatar, DisplayName, and ContactWithOffers. :param bool force_refresh: Not used in this version of the API. :rtype: :class:` ` """ route_values = {} if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if details is not None: query_parameters['details'] = self._serialize.query('details', details, 'bool') if with_attributes is not None: query_parameters['withAttributes'] = self._serialize.query('with_attributes', with_attributes, 'bool') if partition is not None: query_parameters['partition'] = self._serialize.query('partition', partition, 'str') if core_attributes is not None: query_parameters['coreAttributes'] = self._serialize.query('core_attributes', core_attributes, 'str') if force_refresh is not None: query_parameters['forceRefresh'] = self._serialize.query('force_refresh', force_refresh, 'bool') response = self._send(http_method='GET', location_id='f83735dc-483f-4238-a291-d45f6080a9af', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Profile', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/release/000077500000000000000000000000001360605530400315105ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/release/__init__.py000066400000000000000000000063131360605530400336240ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.release.models import * from .release_client import ReleaseClient __all__ = [ 'AgentArtifactDefinition', 'ApprovalOptions', 'Artifact', 'ArtifactMetadata', 'ArtifactSourceReference', 'ArtifactTriggerConfiguration', 'ArtifactTypeDefinition', 'ArtifactVersion', 'ArtifactVersionQueryResult', 'AuthorizationHeader', 'AutoTriggerIssue', 'BuildVersion', 'Change', 'ComplianceSettings', 'Condition', 'ConfigurationVariableValue', 'DataSourceBindingBase', 'DefinitionEnvironmentReference', 'Deployment', 'DeploymentAttempt', 'DeploymentJob', 'DeploymentQueryParameters', 'EmailRecipients', 'EnvironmentExecutionPolicy', 'EnvironmentOptions', 'EnvironmentRetentionPolicy', 'EnvironmentTrigger', 'FavoriteItem', 'Folder', 'GateUpdateMetadata', 'GraphSubjectBase', 'IdentityRef', 'IgnoredGate', 'InputDescriptor', 'InputValidation', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'Issue', 'MailMessage', 'ManualIntervention', 'ManualInterventionUpdateMetadata', 'Metric', 'PipelineProcess', 'ProcessParameters', 'ProjectReference', 'QueuedReleaseData', 'ReferenceLinks', 'Release', 'ReleaseApproval', 'ReleaseApprovalHistory', 'ReleaseCondition', 'ReleaseDefinition', 'ReleaseDefinitionApprovals', 'ReleaseDefinitionApprovalStep', 'ReleaseDefinitionDeployStep', 'ReleaseDefinitionEnvironment', 'ReleaseDefinitionEnvironmentStep', 'ReleaseDefinitionEnvironmentSummary', 'ReleaseDefinitionEnvironmentTemplate', 'ReleaseDefinitionGate', 'ReleaseDefinitionGatesOptions', 'ReleaseDefinitionGatesStep', 'ReleaseDefinitionRevision', 'ReleaseDefinitionShallowReference', 'ReleaseDefinitionSummary', 'ReleaseDefinitionUndeleteParameter', 'ReleaseDeployPhase', 'ReleaseEnvironment', 'ReleaseEnvironmentShallowReference', 'ReleaseEnvironmentUpdateMetadata', 'ReleaseGates', 'ReleaseReference', 'ReleaseRevision', 'ReleaseSchedule', 'ReleaseSettings', 'ReleaseShallowReference', 'ReleaseStartEnvironmentMetadata', 'ReleaseStartMetadata', 'ReleaseTask', 'ReleaseTaskAttachment', 'ReleaseUpdateMetadata', 'ReleaseWorkItemRef', 'RetentionPolicy', 'RetentionSettings', 'SourcePullRequestVersion', 'SummaryMailSection', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskSourceDefinitionBase', 'VariableGroup', 'VariableGroupProviderData', 'VariableValue', 'WorkflowTask', 'WorkflowTaskReference', 'ReleaseClient' ] release_client.py000066400000000000000000001175631360605530400347760ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/release# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.release import models class ReleaseClient(Client): """Release :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ReleaseClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'efc2f575-36ef-48e9-b672-0c6fb4a48ac5' def get_approvals(self, project, assigned_to_filter=None, status_filter=None, release_ids_filter=None, type_filter=None, top=None, continuation_token=None, query_order=None, include_my_group_approvals=None): """GetApprovals. Get a list of approvals :param str project: Project ID or project name :param str assigned_to_filter: Approvals assigned to this user. :param str status_filter: Approvals with this status. Default is 'pending'. :param [int] release_ids_filter: Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4. :param str type_filter: Approval with this type. :param int top: Number of approvals to get. Default is 50. :param int continuation_token: Gets the approvals after the continuation token provided. :param str query_order: Gets the results in the defined order of created approvals. Default is 'descending'. :param bool include_my_group_approvals: 'true' to include my group approvals. Default is 'false'. :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if assigned_to_filter is not None: query_parameters['assignedToFilter'] = self._serialize.query('assigned_to_filter', assigned_to_filter, 'str') if status_filter is not None: query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') if release_ids_filter is not None: release_ids_filter = ",".join(map(str, release_ids_filter)) query_parameters['releaseIdsFilter'] = self._serialize.query('release_ids_filter', release_ids_filter, 'str') if type_filter is not None: query_parameters['typeFilter'] = self._serialize.query('type_filter', type_filter, 'str') if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if include_my_group_approvals is not None: query_parameters['includeMyGroupApprovals'] = self._serialize.query('include_my_group_approvals', include_my_group_approvals, 'bool') response = self._send(http_method='GET', location_id='b47c6458-e73b-47cb-a770-4df1e8813a91', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[ReleaseApproval]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetApprovalsResponseValue(response_value, continuation_token) class GetApprovalsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_approvals method :param value: :type value: :class:`<[ReleaseApproval]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def update_release_approval(self, approval, project, approval_id): """UpdateReleaseApproval. Update status of an approval :param :class:` ` approval: ReleaseApproval object having status, approver and comments. :param str project: Project ID or project name :param int approval_id: Id of the approval. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if approval_id is not None: route_values['approvalId'] = self._serialize.url('approval_id', approval_id, 'int') content = self._serialize.body(approval, 'ReleaseApproval') response = self._send(http_method='PATCH', location_id='9328e074-59fb-465a-89d9-b09c82ee5109', version='5.1', route_values=route_values, content=content) return self._deserialize('ReleaseApproval', response) def create_release_definition(self, release_definition, project): """CreateReleaseDefinition. Create a release definition :param :class:` ` release_definition: release definition object to create. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(release_definition, 'ReleaseDefinition') response = self._send(http_method='POST', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.1', route_values=route_values, content=content) return self._deserialize('ReleaseDefinition', response) def delete_release_definition(self, project, definition_id, comment=None, force_delete=None): """DeleteReleaseDefinition. Delete a release definition. :param str project: Project ID or project name :param int definition_id: Id of the release definition. :param str comment: Comment for deleting a release definition. :param bool force_delete: 'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if comment is not None: query_parameters['comment'] = self._serialize.query('comment', comment, 'str') if force_delete is not None: query_parameters['forceDelete'] = self._serialize.query('force_delete', force_delete, 'bool') self._send(http_method='DELETE', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.1', route_values=route_values, query_parameters=query_parameters) def get_release_definition(self, project, definition_id, property_filters=None): """GetReleaseDefinition. Get a release definition. :param str project: Project ID or project name :param int definition_id: Id of the release definition. :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReleaseDefinition', response) def get_release_definitions(self, project, search_text=None, expand=None, artifact_type=None, artifact_source_id=None, top=None, continuation_token=None, query_order=None, path=None, is_exact_name_match=None, tag_filter=None, property_filters=None, definition_id_filter=None, is_deleted=None, search_text_contains_folder_name=None): """GetReleaseDefinitions. Get a list of release definitions. :param str project: Project ID or project name :param str search_text: Get release definitions with names containing searchText. :param str expand: The properties that should be expanded in the list of Release definitions. :param str artifact_type: Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. :param str artifact_source_id: Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. :param int top: Number of release definitions to get. :param str continuation_token: Gets the release definitions after the continuation token provided. :param str query_order: Gets the results in the defined order. Default is 'IdAscending'. :param str path: Gets the release definitions under the specified path. :param bool is_exact_name_match: 'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'. :param [str] tag_filter: A comma-delimited list of tags. Only release definitions with these tags will be returned. :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not. :param [str] definition_id_filter: A comma-delimited list of release definitions to retrieve. :param bool is_deleted: 'true' to get release definitions that has been deleted. Default is 'false' :param bool search_text_contains_folder_name: 'true' to get the release definitions under the folder with name as specified in searchText. Default is 'false'. :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if search_text is not None: query_parameters['searchText'] = self._serialize.query('search_text', search_text, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if artifact_type is not None: query_parameters['artifactType'] = self._serialize.query('artifact_type', artifact_type, 'str') if artifact_source_id is not None: query_parameters['artifactSourceId'] = self._serialize.query('artifact_source_id', artifact_source_id, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if is_exact_name_match is not None: query_parameters['isExactNameMatch'] = self._serialize.query('is_exact_name_match', is_exact_name_match, 'bool') if tag_filter is not None: tag_filter = ",".join(tag_filter) query_parameters['tagFilter'] = self._serialize.query('tag_filter', tag_filter, 'str') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if definition_id_filter is not None: definition_id_filter = ",".join(definition_id_filter) query_parameters['definitionIdFilter'] = self._serialize.query('definition_id_filter', definition_id_filter, 'str') if is_deleted is not None: query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') if search_text_contains_folder_name is not None: query_parameters['searchTextContainsFolderName'] = self._serialize.query('search_text_contains_folder_name', search_text_contains_folder_name, 'bool') response = self._send(http_method='GET', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[ReleaseDefinition]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetReleaseDefinitionsResponseValue(response_value, continuation_token) class GetReleaseDefinitionsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_release_definitions method :param value: :type value: :class:`<[ReleaseDefinition]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def update_release_definition(self, release_definition, project): """UpdateReleaseDefinition. Update a release definition. :param :class:` ` release_definition: Release definition object to update. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(release_definition, 'ReleaseDefinition') response = self._send(http_method='PUT', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.1', route_values=route_values, content=content) return self._deserialize('ReleaseDefinition', response) def get_deployments(self, project, definition_id=None, definition_environment_id=None, created_by=None, min_modified_time=None, max_modified_time=None, deployment_status=None, operation_status=None, latest_attempts_only=None, query_order=None, top=None, continuation_token=None, created_for=None, min_started_time=None, max_started_time=None, source_branch=None): """GetDeployments. :param str project: Project ID or project name :param int definition_id: :param int definition_environment_id: :param str created_by: :param datetime min_modified_time: :param datetime max_modified_time: :param str deployment_status: :param str operation_status: :param bool latest_attempts_only: :param str query_order: :param int top: :param int continuation_token: :param str created_for: :param datetime min_started_time: :param datetime max_started_time: :param str source_branch: :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definition_id is not None: query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') if definition_environment_id is not None: query_parameters['definitionEnvironmentId'] = self._serialize.query('definition_environment_id', definition_environment_id, 'int') if created_by is not None: query_parameters['createdBy'] = self._serialize.query('created_by', created_by, 'str') if min_modified_time is not None: query_parameters['minModifiedTime'] = self._serialize.query('min_modified_time', min_modified_time, 'iso-8601') if max_modified_time is not None: query_parameters['maxModifiedTime'] = self._serialize.query('max_modified_time', max_modified_time, 'iso-8601') if deployment_status is not None: query_parameters['deploymentStatus'] = self._serialize.query('deployment_status', deployment_status, 'str') if operation_status is not None: query_parameters['operationStatus'] = self._serialize.query('operation_status', operation_status, 'str') if latest_attempts_only is not None: query_parameters['latestAttemptsOnly'] = self._serialize.query('latest_attempts_only', latest_attempts_only, 'bool') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') if created_for is not None: query_parameters['createdFor'] = self._serialize.query('created_for', created_for, 'str') if min_started_time is not None: query_parameters['minStartedTime'] = self._serialize.query('min_started_time', min_started_time, 'iso-8601') if max_started_time is not None: query_parameters['maxStartedTime'] = self._serialize.query('max_started_time', max_started_time, 'iso-8601') if source_branch is not None: query_parameters['sourceBranch'] = self._serialize.query('source_branch', source_branch, 'str') response = self._send(http_method='GET', location_id='b005ef73-cddc-448e-9ba2-5193bf36b19f', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[Deployment]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetDeploymentsResponseValue(response_value, continuation_token) class GetDeploymentsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_deployments method :param value: :type value: :class:`<[Deployment]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def get_manual_intervention(self, project, release_id, manual_intervention_id): """GetManualIntervention. Get manual intervention for a given release and manual intervention id. :param str project: Project ID or project name :param int release_id: Id of the release. :param int manual_intervention_id: Id of the manual intervention. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') if manual_intervention_id is not None: route_values['manualInterventionId'] = self._serialize.url('manual_intervention_id', manual_intervention_id, 'int') response = self._send(http_method='GET', location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', version='5.1', route_values=route_values) return self._deserialize('ManualIntervention', response) def get_manual_interventions(self, project, release_id): """GetManualInterventions. List all manual interventions for a given release. :param str project: Project ID or project name :param int release_id: Id of the release. :rtype: [ManualIntervention] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') response = self._send(http_method='GET', location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', version='5.1', route_values=route_values) return self._deserialize('[ManualIntervention]', self._unwrap_collection(response)) def update_manual_intervention(self, manual_intervention_update_metadata, project, release_id, manual_intervention_id): """UpdateManualIntervention. Update manual intervention. :param :class:` ` manual_intervention_update_metadata: Meta data to update manual intervention. :param str project: Project ID or project name :param int release_id: Id of the release. :param int manual_intervention_id: Id of the manual intervention. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') if manual_intervention_id is not None: route_values['manualInterventionId'] = self._serialize.url('manual_intervention_id', manual_intervention_id, 'int') content = self._serialize.body(manual_intervention_update_metadata, 'ManualInterventionUpdateMetadata') response = self._send(http_method='PATCH', location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', version='5.1', route_values=route_values, content=content) return self._deserialize('ManualIntervention', response) def get_releases(self, project=None, definition_id=None, definition_environment_id=None, search_text=None, created_by=None, status_filter=None, environment_status_filter=None, min_created_time=None, max_created_time=None, query_order=None, top=None, continuation_token=None, expand=None, artifact_type_id=None, source_id=None, artifact_version_id=None, source_branch_filter=None, is_deleted=None, tag_filter=None, property_filters=None, release_id_filter=None, path=None): """GetReleases. Get a list of releases :param str project: Project ID or project name :param int definition_id: Releases from this release definition Id. :param int definition_environment_id: :param str search_text: Releases with names containing searchText. :param str created_by: Releases created by this user. :param str status_filter: Releases that have this status. :param int environment_status_filter: :param datetime min_created_time: Releases that were created after this time. :param datetime max_created_time: Releases that were created before this time. :param str query_order: Gets the results in the defined order of created date for releases. Default is descending. :param int top: Number of releases to get. Default is 50. :param int continuation_token: Gets the releases after the continuation token provided. :param str expand: The property that should be expanded in the list of releases. :param str artifact_type_id: Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. :param str source_id: Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. :param str artifact_version_id: Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId. :param str source_branch_filter: Releases with given sourceBranchFilter will be returned. :param bool is_deleted: Gets the soft deleted releases, if true. :param [str] tag_filter: A comma-delimited list of tags. Only releases with these tags will be returned. :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not. :param [int] release_id_filter: A comma-delimited list of releases Ids. Only releases with these Ids will be returned. :param str path: Releases under this folder path will be returned :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definition_id is not None: query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') if definition_environment_id is not None: query_parameters['definitionEnvironmentId'] = self._serialize.query('definition_environment_id', definition_environment_id, 'int') if search_text is not None: query_parameters['searchText'] = self._serialize.query('search_text', search_text, 'str') if created_by is not None: query_parameters['createdBy'] = self._serialize.query('created_by', created_by, 'str') if status_filter is not None: query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') if environment_status_filter is not None: query_parameters['environmentStatusFilter'] = self._serialize.query('environment_status_filter', environment_status_filter, 'int') if min_created_time is not None: query_parameters['minCreatedTime'] = self._serialize.query('min_created_time', min_created_time, 'iso-8601') if max_created_time is not None: query_parameters['maxCreatedTime'] = self._serialize.query('max_created_time', max_created_time, 'iso-8601') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if artifact_type_id is not None: query_parameters['artifactTypeId'] = self._serialize.query('artifact_type_id', artifact_type_id, 'str') if source_id is not None: query_parameters['sourceId'] = self._serialize.query('source_id', source_id, 'str') if artifact_version_id is not None: query_parameters['artifactVersionId'] = self._serialize.query('artifact_version_id', artifact_version_id, 'str') if source_branch_filter is not None: query_parameters['sourceBranchFilter'] = self._serialize.query('source_branch_filter', source_branch_filter, 'str') if is_deleted is not None: query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') if tag_filter is not None: tag_filter = ",".join(tag_filter) query_parameters['tagFilter'] = self._serialize.query('tag_filter', tag_filter, 'str') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if release_id_filter is not None: release_id_filter = ",".join(map(str, release_id_filter)) query_parameters['releaseIdFilter'] = self._serialize.query('release_id_filter', release_id_filter, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[Release]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetReleasesResponseValue(response_value, continuation_token) class GetReleasesResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_releases method :param value: :type value: :class:`<[Release]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def create_release(self, release_start_metadata, project): """CreateRelease. Create a release. :param :class:` ` release_start_metadata: Metadata to create a release. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(release_start_metadata, 'ReleaseStartMetadata') response = self._send(http_method='POST', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.1', route_values=route_values, content=content) return self._deserialize('Release', response) def get_release(self, project, release_id, approval_filters=None, property_filters=None, expand=None, top_gate_records=None): """GetRelease. Get a Release :param str project: Project ID or project name :param int release_id: Id of the release. :param str approval_filters: A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by default :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included. :param str expand: A property that should be expanded in the release. :param int top_gate_records: Number of release gate records to get. Default is 5. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') query_parameters = {} if approval_filters is not None: query_parameters['approvalFilters'] = self._serialize.query('approval_filters', approval_filters, 'str') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if top_gate_records is not None: query_parameters['$topGateRecords'] = self._serialize.query('top_gate_records', top_gate_records, 'int') response = self._send(http_method='GET', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Release', response) def get_release_revision(self, project, release_id, definition_snapshot_revision, **kwargs): """GetReleaseRevision. Get release for a given revision number. :param str project: Project ID or project name :param int release_id: Id of the release. :param int definition_snapshot_revision: Definition snapshot revision number. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') query_parameters = {} if definition_snapshot_revision is not None: query_parameters['definitionSnapshotRevision'] = self._serialize.query('definition_snapshot_revision', definition_snapshot_revision, 'int') response = self._send(http_method='GET', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def update_release(self, release, project, release_id): """UpdateRelease. Update a complete release object. :param :class:` ` release: Release object for update. :param str project: Project ID or project name :param int release_id: Id of the release to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') content = self._serialize.body(release, 'Release') response = self._send(http_method='PUT', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.1', route_values=route_values, content=content) return self._deserialize('Release', response) def update_release_resource(self, release_update_metadata, project, release_id): """UpdateReleaseResource. Update few properties of a release. :param :class:` ` release_update_metadata: Properties of release to update. :param str project: Project ID or project name :param int release_id: Id of the release to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') content = self._serialize.body(release_update_metadata, 'ReleaseUpdateMetadata') response = self._send(http_method='PATCH', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.1', route_values=route_values, content=content) return self._deserialize('Release', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/security/000077500000000000000000000000001360605530400317375ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/security/__init__.py000066400000000000000000000016221360605530400340510ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.security.models import * from .security_client import SecurityClient __all__ = [ 'AccessControlEntry', 'AccessControlList', 'AccessControlListsCollection', 'AceExtendedInformation', 'ActionDefinition', 'PermissionEvaluation', 'PermissionEvaluationBatch', 'SecurityNamespaceDescription', 'SecurityClient' ] security_client.py000066400000000000000000000334731360605530400354510ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/security# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.security import models class SecurityClient(Client): """Security :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(SecurityClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def remove_access_control_entries(self, security_namespace_id, token=None, descriptors=None): """RemoveAccessControlEntries. Remove the specified ACEs from the ACL belonging to the specified token. :param str security_namespace_id: Security namespace identifier. :param str token: The token whose ACL should be modified. :param str descriptors: String containing a list of identity descriptors separated by ',' whose entries should be removed. :rtype: bool """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') query_parameters = {} if token is not None: query_parameters['token'] = self._serialize.query('token', token, 'str') if descriptors is not None: query_parameters['descriptors'] = self._serialize.query('descriptors', descriptors, 'str') response = self._send(http_method='DELETE', location_id='ac08c8ff-4323-4b08-af90-bcd018d380ce', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('bool', response) def set_access_control_entries(self, container, security_namespace_id): """SetAccessControlEntries. Add or update ACEs in the ACL for the provided token. The request body contains the target token, a list of [ACEs](https://docs.microsoft.com/en-us/rest/api/azure/devops/security/access%20control%20entries/set%20access%20control%20entries?#accesscontrolentry) and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. :param :class:` ` container: :param str security_namespace_id: Security namespace identifier. :rtype: [AccessControlEntry] """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') content = self._serialize.body(container, 'object') response = self._send(http_method='POST', location_id='ac08c8ff-4323-4b08-af90-bcd018d380ce', version='5.1', route_values=route_values, content=content) return self._deserialize('[AccessControlEntry]', self._unwrap_collection(response)) def query_access_control_lists(self, security_namespace_id, token=None, descriptors=None, include_extended_info=None, recurse=None): """QueryAccessControlLists. Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. :param str security_namespace_id: Security namespace identifier. :param str token: Security token :param str descriptors: An optional filter string containing a list of identity descriptors separated by ',' whose ACEs should be retrieved. If this is left null, entire ACLs will be returned. :param bool include_extended_info: If true, populate the extended information properties for the access control entries contained in the returned lists. :param bool recurse: If true and this is a hierarchical namespace, return child ACLs of the specified token. :rtype: [AccessControlList] """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') query_parameters = {} if token is not None: query_parameters['token'] = self._serialize.query('token', token, 'str') if descriptors is not None: query_parameters['descriptors'] = self._serialize.query('descriptors', descriptors, 'str') if include_extended_info is not None: query_parameters['includeExtendedInfo'] = self._serialize.query('include_extended_info', include_extended_info, 'bool') if recurse is not None: query_parameters['recurse'] = self._serialize.query('recurse', recurse, 'bool') response = self._send(http_method='GET', location_id='18a2ad18-7571-46ae-bec7-0c7da1495885', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[AccessControlList]', self._unwrap_collection(response)) def remove_access_control_lists(self, security_namespace_id, tokens=None, recurse=None): """RemoveAccessControlLists. Remove access control lists under the specfied security namespace. :param str security_namespace_id: Security namespace identifier. :param str tokens: One or more comma-separated security tokens :param bool recurse: If true and this is a hierarchical namespace, also remove child ACLs of the specified tokens. :rtype: bool """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') query_parameters = {} if tokens is not None: query_parameters['tokens'] = self._serialize.query('tokens', tokens, 'str') if recurse is not None: query_parameters['recurse'] = self._serialize.query('recurse', recurse, 'bool') response = self._send(http_method='DELETE', location_id='18a2ad18-7571-46ae-bec7-0c7da1495885', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('bool', response) def set_access_control_lists(self, access_control_lists, security_namespace_id): """SetAccessControlLists. Create or update one or more access control lists. All data that currently exists for the ACLs supplied will be overwritten. :param :class:` ` access_control_lists: A list of ACLs to create or update. :param str security_namespace_id: Security namespace identifier. """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') content = self._serialize.body(access_control_lists, 'VssJsonCollectionWrapper') self._send(http_method='POST', location_id='18a2ad18-7571-46ae-bec7-0c7da1495885', version='5.1', route_values=route_values, content=content) def has_permissions_batch(self, eval_batch): """HasPermissionsBatch. Evaluates multiple permissions for the calling user. Note: This method does not aggregate the results, nor does it short-circuit if one of the permissions evaluates to false. :param :class:` ` eval_batch: The set of evaluation requests. :rtype: :class:` ` """ content = self._serialize.body(eval_batch, 'PermissionEvaluationBatch') response = self._send(http_method='POST', location_id='cf1faa59-1b63-4448-bf04-13d981a46f5d', version='5.1', content=content) return self._deserialize('PermissionEvaluationBatch', response) def has_permissions(self, security_namespace_id, permissions=None, tokens=None, always_allow_administrators=None, delimiter=None): """HasPermissions. Evaluates whether the caller has the specified permissions on the specified set of security tokens. :param str security_namespace_id: Security namespace identifier. :param int permissions: Permissions to evaluate. :param str tokens: One or more security tokens to evaluate. :param bool always_allow_administrators: If true and if the caller is an administrator, always return true. :param str delimiter: Optional security token separator. Defaults to ",". :rtype: [bool] """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') if permissions is not None: route_values['permissions'] = self._serialize.url('permissions', permissions, 'int') query_parameters = {} if tokens is not None: query_parameters['tokens'] = self._serialize.query('tokens', tokens, 'str') if always_allow_administrators is not None: query_parameters['alwaysAllowAdministrators'] = self._serialize.query('always_allow_administrators', always_allow_administrators, 'bool') if delimiter is not None: query_parameters['delimiter'] = self._serialize.query('delimiter', delimiter, 'str') response = self._send(http_method='GET', location_id='dd3b8bd6-c7fc-4cbd-929a-933d9c011c9d', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[bool]', self._unwrap_collection(response)) def remove_permission(self, security_namespace_id, descriptor, permissions=None, token=None): """RemovePermission. Removes the specified permissions on a security token for a user or group. :param str security_namespace_id: Security namespace identifier. :param str descriptor: Identity descriptor of the user to remove permissions for. :param int permissions: Permissions to remove. :param str token: Security token to remove permissions for. :rtype: :class:` ` """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') if permissions is not None: route_values['permissions'] = self._serialize.url('permissions', permissions, 'int') query_parameters = {} if descriptor is not None: query_parameters['descriptor'] = self._serialize.query('descriptor', descriptor, 'str') if token is not None: query_parameters['token'] = self._serialize.query('token', token, 'str') response = self._send(http_method='DELETE', location_id='dd3b8bd6-c7fc-4cbd-929a-933d9c011c9d', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('AccessControlEntry', response) def query_security_namespaces(self, security_namespace_id=None, local_only=None): """QuerySecurityNamespaces. List all security namespaces or just the specified namespace. :param str security_namespace_id: Security namespace identifier. :param bool local_only: If true, retrieve only local security namespaces. :rtype: [SecurityNamespaceDescription] """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') query_parameters = {} if local_only is not None: query_parameters['localOnly'] = self._serialize.query('local_only', local_only, 'bool') response = self._send(http_method='GET', location_id='ce7b9f95-fde9-4be8-a86d-83b366f0b87a', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[SecurityNamespaceDescription]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/service_hooks/000077500000000000000000000000001360605530400327335ustar00rootroot00000000000000__init__.py000066400000000000000000000030611360605530400347650ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/service_hooks# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.service_hooks.models import * from .service_hooks_client import ServiceHooksClient __all__ = [ 'Consumer', 'ConsumerAction', 'Event', 'EventTypeDescriptor', 'ExternalConfigurationDescriptor', 'FormattedEventMessage', 'GraphSubjectBase', 'IdentityRef', 'InputDescriptor', 'InputFilter', 'InputFilterCondition', 'InputValidation', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'Notification', 'NotificationDetails', 'NotificationResultsSummaryDetail', 'NotificationsQuery', 'NotificationSummary', 'Publisher', 'PublisherEvent', 'PublishersQuery', 'ReferenceLinks', 'ResourceContainer', 'SessionToken', 'Subscription', 'SubscriptionDiagnostics', 'SubscriptionInputValuesQuery', 'SubscriptionsQuery', 'SubscriptionTracing', 'UpdateSubscripitonDiagnosticsParameters', 'UpdateSubscripitonTracingParameters', 'VersionedResource', 'ServiceHooksClient' ] service_hooks_client.py000066400000000000000000000460611360605530400374360ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/service_hooks# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.service_hooks import models class ServiceHooksClient(Client): """ServiceHooks :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ServiceHooksClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_consumer_action(self, consumer_id, consumer_action_id, publisher_id=None): """GetConsumerAction. Get details about a specific consumer action. :param str consumer_id: ID for a consumer. :param str consumer_action_id: ID for a consumerActionId. :param str publisher_id: :rtype: :class:` ` """ route_values = {} if consumer_id is not None: route_values['consumerId'] = self._serialize.url('consumer_id', consumer_id, 'str') if consumer_action_id is not None: route_values['consumerActionId'] = self._serialize.url('consumer_action_id', consumer_action_id, 'str') query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='c3428e90-7a69-4194-8ed8-0f153185ee0d', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ConsumerAction', response) def list_consumer_actions(self, consumer_id, publisher_id=None): """ListConsumerActions. Get a list of consumer actions for a specific consumer. :param str consumer_id: ID for a consumer. :param str publisher_id: :rtype: [ConsumerAction] """ route_values = {} if consumer_id is not None: route_values['consumerId'] = self._serialize.url('consumer_id', consumer_id, 'str') query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='c3428e90-7a69-4194-8ed8-0f153185ee0d', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ConsumerAction]', self._unwrap_collection(response)) def get_consumer(self, consumer_id, publisher_id=None): """GetConsumer. Get a specific consumer service. Optionally filter out consumer actions that do not support any event types for the specified publisher. :param str consumer_id: ID for a consumer. :param str publisher_id: :rtype: :class:` ` """ route_values = {} if consumer_id is not None: route_values['consumerId'] = self._serialize.url('consumer_id', consumer_id, 'str') query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='4301c514-5f34-4f5d-a145-f0ea7b5b7d19', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Consumer', response) def list_consumers(self, publisher_id=None): """ListConsumers. Get a list of available service hook consumer services. Optionally filter by consumers that support at least one event type from the specific publisher. :param str publisher_id: :rtype: [Consumer] """ query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='4301c514-5f34-4f5d-a145-f0ea7b5b7d19', version='5.1', query_parameters=query_parameters) return self._deserialize('[Consumer]', self._unwrap_collection(response)) def get_event_type(self, publisher_id, event_type_id): """GetEventType. Get a specific event type. :param str publisher_id: ID for a publisher. :param str event_type_id: :rtype: :class:` ` """ route_values = {} if publisher_id is not None: route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') if event_type_id is not None: route_values['eventTypeId'] = self._serialize.url('event_type_id', event_type_id, 'str') response = self._send(http_method='GET', location_id='db4777cd-8e08-4a84-8ba3-c974ea033718', version='5.1', route_values=route_values) return self._deserialize('EventTypeDescriptor', response) def list_event_types(self, publisher_id): """ListEventTypes. Get the event types for a specific publisher. :param str publisher_id: ID for a publisher. :rtype: [EventTypeDescriptor] """ route_values = {} if publisher_id is not None: route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='db4777cd-8e08-4a84-8ba3-c974ea033718', version='5.1', route_values=route_values) return self._deserialize('[EventTypeDescriptor]', self._unwrap_collection(response)) def get_notification(self, subscription_id, notification_id): """GetNotification. Get a specific notification for a subscription. :param str subscription_id: ID for a subscription. :param int notification_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') if notification_id is not None: route_values['notificationId'] = self._serialize.url('notification_id', notification_id, 'int') response = self._send(http_method='GET', location_id='0c62d343-21b0-4732-997b-017fde84dc28', version='5.1', route_values=route_values) return self._deserialize('Notification', response) def get_notifications(self, subscription_id, max_results=None, status=None, result=None): """GetNotifications. Get a list of notifications for a specific subscription. A notification includes details about the event, the request to and the response from the consumer service. :param str subscription_id: ID for a subscription. :param int max_results: Maximum number of notifications to return. Default is **100**. :param str status: Get only notifications with this status. :param str result: Get only notifications with this result type. :rtype: [Notification] """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') query_parameters = {} if max_results is not None: query_parameters['maxResults'] = self._serialize.query('max_results', max_results, 'int') if status is not None: query_parameters['status'] = self._serialize.query('status', status, 'str') if result is not None: query_parameters['result'] = self._serialize.query('result', result, 'str') response = self._send(http_method='GET', location_id='0c62d343-21b0-4732-997b-017fde84dc28', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Notification]', self._unwrap_collection(response)) def query_notifications(self, query): """QueryNotifications. Query for notifications. A notification includes details about the event, the request to and the response from the consumer service. :param :class:` ` query: :rtype: :class:` ` """ content = self._serialize.body(query, 'NotificationsQuery') response = self._send(http_method='POST', location_id='1a57562f-160a-4b5c-9185-905e95b39d36', version='5.1', content=content) return self._deserialize('NotificationsQuery', response) def query_input_values(self, input_values_query, publisher_id): """QueryInputValues. :param :class:` ` input_values_query: :param str publisher_id: :rtype: :class:` ` """ route_values = {} if publisher_id is not None: route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') content = self._serialize.body(input_values_query, 'InputValuesQuery') response = self._send(http_method='POST', location_id='d815d352-a566-4dc1-a3e3-fd245acf688c', version='5.1', route_values=route_values, content=content) return self._deserialize('InputValuesQuery', response) def get_publisher(self, publisher_id): """GetPublisher. Get a specific service hooks publisher. :param str publisher_id: ID for a publisher. :rtype: :class:` ` """ route_values = {} if publisher_id is not None: route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='1e83a210-5b53-43bc-90f0-d476a4e5d731', version='5.1', route_values=route_values) return self._deserialize('Publisher', response) def list_publishers(self): """ListPublishers. Get a list of publishers. :rtype: [Publisher] """ response = self._send(http_method='GET', location_id='1e83a210-5b53-43bc-90f0-d476a4e5d731', version='5.1') return self._deserialize('[Publisher]', self._unwrap_collection(response)) def query_publishers(self, query): """QueryPublishers. Query for service hook publishers. :param :class:` ` query: :rtype: :class:` ` """ content = self._serialize.body(query, 'PublishersQuery') response = self._send(http_method='POST', location_id='99b44a8a-65a8-4670-8f3e-e7f7842cce64', version='5.1', content=content) return self._deserialize('PublishersQuery', response) def create_subscription(self, subscription): """CreateSubscription. Create a subscription. :param :class:` ` subscription: Subscription to be created. :rtype: :class:` ` """ content = self._serialize.body(subscription, 'Subscription') response = self._send(http_method='POST', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.1', content=content) return self._deserialize('Subscription', response) def delete_subscription(self, subscription_id): """DeleteSubscription. Delete a specific service hooks subscription. :param str subscription_id: ID for a subscription. """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') self._send(http_method='DELETE', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.1', route_values=route_values) def get_subscription(self, subscription_id): """GetSubscription. Get a specific service hooks subscription. :param str subscription_id: ID for a subscription. :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') response = self._send(http_method='GET', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.1', route_values=route_values) return self._deserialize('Subscription', response) def list_subscriptions(self, publisher_id=None, event_type=None, consumer_id=None, consumer_action_id=None): """ListSubscriptions. Get a list of subscriptions. :param str publisher_id: ID for a subscription. :param str event_type: The event type to filter on (if any). :param str consumer_id: ID for a consumer. :param str consumer_action_id: ID for a consumerActionId. :rtype: [Subscription] """ query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') if event_type is not None: query_parameters['eventType'] = self._serialize.query('event_type', event_type, 'str') if consumer_id is not None: query_parameters['consumerId'] = self._serialize.query('consumer_id', consumer_id, 'str') if consumer_action_id is not None: query_parameters['consumerActionId'] = self._serialize.query('consumer_action_id', consumer_action_id, 'str') response = self._send(http_method='GET', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.1', query_parameters=query_parameters) return self._deserialize('[Subscription]', self._unwrap_collection(response)) def replace_subscription(self, subscription, subscription_id=None): """ReplaceSubscription. Update a subscription. ID for a subscription that you wish to update. :param :class:` ` subscription: :param str subscription_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') content = self._serialize.body(subscription, 'Subscription') response = self._send(http_method='PUT', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.1', route_values=route_values, content=content) return self._deserialize('Subscription', response) def create_subscriptions_query(self, query): """CreateSubscriptionsQuery. Query for service hook subscriptions. :param :class:` ` query: :rtype: :class:` ` """ content = self._serialize.body(query, 'SubscriptionsQuery') response = self._send(http_method='POST', location_id='c7c3c1cf-9e05-4c0d-a425-a0f922c2c6ed', version='5.1', content=content) return self._deserialize('SubscriptionsQuery', response) def create_test_notification(self, test_notification, use_real_data=None): """CreateTestNotification. Sends a test notification. This is useful for verifying the configuration of an updated or new service hooks subscription. :param :class:` ` test_notification: :param bool use_real_data: Only allow testing with real data in existing subscriptions. :rtype: :class:` ` """ query_parameters = {} if use_real_data is not None: query_parameters['useRealData'] = self._serialize.query('use_real_data', use_real_data, 'bool') content = self._serialize.body(test_notification, 'Notification') response = self._send(http_method='POST', location_id='1139462c-7e27-4524-a997-31b9b73551fe', version='5.1', query_parameters=query_parameters, content=content) return self._deserialize('Notification', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/task/000077500000000000000000000000001360605530400310325ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/task/__init__.py000066400000000000000000000025441360605530400331500ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.task.models import * from .task_client import TaskClient __all__ = [ 'Issue', 'JobOption', 'MaskHint', 'PlanEnvironment', 'ProjectReference', 'ReferenceLinks', 'TaskAgentJob', 'TaskAgentJobStep', 'TaskAgentJobTask', 'TaskAgentJobVariable', 'TaskAttachment', 'TaskLog', 'TaskLogReference', 'TaskOrchestrationContainer', 'TaskOrchestrationItem', 'TaskOrchestrationOwner', 'TaskOrchestrationPlan', 'TaskOrchestrationPlanGroupsQueueMetrics', 'TaskOrchestrationPlanReference', 'TaskOrchestrationQueuedPlan', 'TaskOrchestrationQueuedPlanGroup', 'TaskReference', 'Timeline', 'TimelineAttempt', 'TimelineRecord', 'TimelineRecordFeedLinesWrapper', 'TimelineReference', 'VariableValue', 'TaskClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/task/task_client.py000066400000000000000000000356111360605530400337120ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.task import models class TaskClient(Client): """Task :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TaskClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def append_log_content(self, upload_stream, scope_identifier, hub_name, plan_id, log_id, **kwargs): """AppendLogContent. :param object upload_stream: Stream to upload :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param int log_id: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', version='5.1', route_values=route_values, content=content, media_type='application/octet-stream') return self._deserialize('TaskLog', response) def create_log(self, log, scope_identifier, hub_name, plan_id): """CreateLog. :param :class:` ` log: :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') content = self._serialize.body(log, 'TaskLog') response = self._send(http_method='POST', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', version='5.1', route_values=route_values, content=content) return self._deserialize('TaskLog', response) def get_log(self, scope_identifier, hub_name, plan_id, log_id, start_line=None, end_line=None): """GetLog. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param int log_id: :param long start_line: :param long end_line: :rtype: [str] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def get_logs(self, scope_identifier, hub_name, plan_id): """GetLogs. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :rtype: [TaskLog] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', version='5.1', route_values=route_values) return self._deserialize('[TaskLog]', self._unwrap_collection(response)) def get_records(self, scope_identifier, hub_name, plan_id, timeline_id, change_id=None): """GetRecords. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :param int change_id: :rtype: [TimelineRecord] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') query_parameters = {} if change_id is not None: query_parameters['changeId'] = self._serialize.query('change_id', change_id, 'int') response = self._send(http_method='GET', location_id='8893bc5b-35b2-4be7-83cb-99e683551db4', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TimelineRecord]', self._unwrap_collection(response)) def update_records(self, records, scope_identifier, hub_name, plan_id, timeline_id): """UpdateRecords. :param :class:` ` records: :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :rtype: [TimelineRecord] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') content = self._serialize.body(records, 'VssJsonCollectionWrapper') response = self._send(http_method='PATCH', location_id='8893bc5b-35b2-4be7-83cb-99e683551db4', version='5.1', route_values=route_values, content=content) return self._deserialize('[TimelineRecord]', self._unwrap_collection(response)) def create_timeline(self, timeline, scope_identifier, hub_name, plan_id): """CreateTimeline. :param :class:` ` timeline: :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') content = self._serialize.body(timeline, 'Timeline') response = self._send(http_method='POST', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', version='5.1', route_values=route_values, content=content) return self._deserialize('Timeline', response) def delete_timeline(self, scope_identifier, hub_name, plan_id, timeline_id): """DeleteTimeline. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') self._send(http_method='DELETE', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', version='5.1', route_values=route_values) def get_timeline(self, scope_identifier, hub_name, plan_id, timeline_id, change_id=None, include_records=None): """GetTimeline. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :param int change_id: :param bool include_records: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') query_parameters = {} if change_id is not None: query_parameters['changeId'] = self._serialize.query('change_id', change_id, 'int') if include_records is not None: query_parameters['includeRecords'] = self._serialize.query('include_records', include_records, 'bool') response = self._send(http_method='GET', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Timeline', response) def get_timelines(self, scope_identifier, hub_name, plan_id): """GetTimelines. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :rtype: [Timeline] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', version='5.1', route_values=route_values) return self._deserialize('[Timeline]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/task_agent/000077500000000000000000000000001360605530400322105ustar00rootroot00000000000000__init__.py000066400000000000000000000100301360605530400342340ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/task_agent# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.task_agent.models import * from .task_agent_client import TaskAgentClient __all__ = [ 'AadOauthTokenRequest', 'AadOauthTokenResult', 'AuthenticationSchemeReference', 'AuthorizationHeader', 'AzureManagementGroup', 'AzureManagementGroupQueryResult', 'AzureSubscription', 'AzureSubscriptionQueryResult', 'ClientCertificate', 'DataSource', 'DataSourceBinding', 'DataSourceBindingBase', 'DataSourceDetails', 'DependencyBinding', 'DependencyData', 'DependsOn', 'DeploymentGroup', 'DeploymentGroupCreateParameter', 'DeploymentGroupCreateParameterPoolProperty', 'DeploymentGroupMetrics', 'DeploymentGroupReference', 'DeploymentGroupUpdateParameter', 'DeploymentMachine', 'DeploymentMachineGroup', 'DeploymentMachineGroupReference', 'DeploymentPoolSummary', 'DeploymentTargetUpdateParameter', 'EndpointAuthorization', 'EndpointUrl', 'EnvironmentCreateParameter', 'EnvironmentDeploymentExecutionRecord', 'EnvironmentInstance', 'EnvironmentReference', 'EnvironmentResource', 'EnvironmentResourceReference', 'EnvironmentUpdateParameter', 'GraphSubjectBase', 'HelpLink', 'IdentityRef', 'InputDescriptor', 'InputValidation', 'InputValidationRequest', 'InputValue', 'InputValues', 'InputValuesError', 'KubernetesResource', 'KubernetesResourceCreateParameters', 'MarketplacePurchasedLicense', 'MetricsColumnMetaData', 'MetricsColumnsHeader', 'MetricsRow', 'PackageMetadata', 'PackageVersion', 'ProjectReference', 'PublishTaskGroupMetadata', 'ReferenceLinks', 'ResourceLimit', 'ResourceUsage', 'ResultTransformationDetails', 'SecureFile', 'ServiceEndpoint', 'ServiceEndpointAuthenticationScheme', 'ServiceEndpointDetails', 'ServiceEndpointExecutionData', 'ServiceEndpointExecutionRecord', 'ServiceEndpointExecutionRecordsInput', 'ServiceEndpointRequest', 'ServiceEndpointRequestResult', 'ServiceEndpointType', 'TaskAgent', 'TaskAgentAuthorization', 'TaskAgentCloud', 'TaskAgentCloudRequest', 'TaskAgentCloudType', 'TaskAgentDelaySource', 'TaskAgentJobRequest', 'TaskAgentMessage', 'TaskAgentPool', 'TaskAgentPoolMaintenanceDefinition', 'TaskAgentPoolMaintenanceJob', 'TaskAgentPoolMaintenanceJobTargetAgent', 'TaskAgentPoolMaintenanceOptions', 'TaskAgentPoolMaintenanceRetentionPolicy', 'TaskAgentPoolMaintenanceSchedule', 'TaskAgentPoolReference', 'TaskAgentPublicKey', 'TaskAgentQueue', 'TaskAgentReference', 'TaskAgentSession', 'TaskAgentSessionKey', 'TaskAgentUpdate', 'TaskAgentUpdateReason', 'TaskDefinition', 'TaskDefinitionEndpoint', 'TaskDefinitionReference', 'TaskExecution', 'TaskGroup', 'TaskGroupCreateParameter', 'TaskGroupDefinition', 'TaskGroupRevision', 'TaskGroupStep', 'TaskGroupUpdateParameter', 'TaskHubLicenseDetails', 'TaskInputDefinition', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskOrchestrationOwner', 'TaskOutputVariable', 'TaskPackageMetadata', 'TaskReference', 'TaskSourceDefinition', 'TaskSourceDefinitionBase', 'TaskVersion', 'ValidationItem', 'VariableGroup', 'VariableGroupParameters', 'VariableGroupProviderData', 'VariableValue', 'VirtualMachine', 'VirtualMachineGroup', 'VirtualMachineGroupCreateParameters', 'TaskAgentClient' ] task_agent_client.py000066400000000000000000000404361360605530400361700ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/task_agent# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.task_agent import models class TaskAgentClient(Client): """TaskAgent :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TaskAgentClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd' def add_agent(self, agent, pool_id): """AddAgent. Adds an agent to a pool. You probably don't want to call this endpoint directly. Instead, [configure an agent](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) using the agent download package. :param :class:` ` agent: Details about the agent being added :param int pool_id: The agent pool in which to add the agent :rtype: :class:` ` """ route_values = {} if pool_id is not None: route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') content = self._serialize.body(agent, 'TaskAgent') response = self._send(http_method='POST', location_id='e298ef32-5878-4cab-993c-043836571f42', version='5.1', route_values=route_values, content=content) return self._deserialize('TaskAgent', response) def delete_agent(self, pool_id, agent_id): """DeleteAgent. Delete an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove an agent from your organization. :param int pool_id: The pool ID to remove the agent from :param int agent_id: The agent ID to remove """ route_values = {} if pool_id is not None: route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') if agent_id is not None: route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') self._send(http_method='DELETE', location_id='e298ef32-5878-4cab-993c-043836571f42', version='5.1', route_values=route_values) def get_agent(self, pool_id, agent_id, include_capabilities=None, include_assigned_request=None, include_last_completed_request=None, property_filters=None): """GetAgent. Get information about an agent. :param int pool_id: The agent pool containing the agent :param int agent_id: The agent ID to get information about :param bool include_capabilities: Whether to include the agent's capabilities in the response :param bool include_assigned_request: Whether to include details about the agent's current work :param bool include_last_completed_request: Whether to include details about the agents' most recent completed work :param [str] property_filters: Filter which custom properties will be returned :rtype: :class:` ` """ route_values = {} if pool_id is not None: route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') if agent_id is not None: route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') query_parameters = {} if include_capabilities is not None: query_parameters['includeCapabilities'] = self._serialize.query('include_capabilities', include_capabilities, 'bool') if include_assigned_request is not None: query_parameters['includeAssignedRequest'] = self._serialize.query('include_assigned_request', include_assigned_request, 'bool') if include_last_completed_request is not None: query_parameters['includeLastCompletedRequest'] = self._serialize.query('include_last_completed_request', include_last_completed_request, 'bool') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='e298ef32-5878-4cab-993c-043836571f42', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TaskAgent', response) def get_agents(self, pool_id, agent_name=None, include_capabilities=None, include_assigned_request=None, include_last_completed_request=None, property_filters=None, demands=None): """GetAgents. Get a list of agents. :param int pool_id: The agent pool containing the agents :param str agent_name: Filter on agent name :param bool include_capabilities: Whether to include the agents' capabilities in the response :param bool include_assigned_request: Whether to include details about the agents' current work :param bool include_last_completed_request: Whether to include details about the agents' most recent completed work :param [str] property_filters: Filter which custom properties will be returned :param [str] demands: Filter by demands the agents can satisfy :rtype: [TaskAgent] """ route_values = {} if pool_id is not None: route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') query_parameters = {} if agent_name is not None: query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') if include_capabilities is not None: query_parameters['includeCapabilities'] = self._serialize.query('include_capabilities', include_capabilities, 'bool') if include_assigned_request is not None: query_parameters['includeAssignedRequest'] = self._serialize.query('include_assigned_request', include_assigned_request, 'bool') if include_last_completed_request is not None: query_parameters['includeLastCompletedRequest'] = self._serialize.query('include_last_completed_request', include_last_completed_request, 'bool') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if demands is not None: demands = ",".join(demands) query_parameters['demands'] = self._serialize.query('demands', demands, 'str') response = self._send(http_method='GET', location_id='e298ef32-5878-4cab-993c-043836571f42', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TaskAgent]', self._unwrap_collection(response)) def replace_agent(self, agent, pool_id, agent_id): """ReplaceAgent. Replace an agent. You probably don't want to call this endpoint directly. Instead, [use the agent configuration script](https://docs.microsoft.com/azure/devops/pipelines/agents/agents) to remove and reconfigure an agent from your organization. :param :class:` ` agent: Updated details about the replacing agent :param int pool_id: The agent pool to use :param int agent_id: The agent to replace :rtype: :class:` ` """ route_values = {} if pool_id is not None: route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') if agent_id is not None: route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') content = self._serialize.body(agent, 'TaskAgent') response = self._send(http_method='PUT', location_id='e298ef32-5878-4cab-993c-043836571f42', version='5.1', route_values=route_values, content=content) return self._deserialize('TaskAgent', response) def update_agent(self, agent, pool_id, agent_id): """UpdateAgent. Update agent details. :param :class:` ` agent: Updated details about the agent :param int pool_id: The agent pool to use :param int agent_id: The agent to update :rtype: :class:` ` """ route_values = {} if pool_id is not None: route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') if agent_id is not None: route_values['agentId'] = self._serialize.url('agent_id', agent_id, 'int') content = self._serialize.body(agent, 'TaskAgent') response = self._send(http_method='PATCH', location_id='e298ef32-5878-4cab-993c-043836571f42', version='5.1', route_values=route_values, content=content) return self._deserialize('TaskAgent', response) def add_agent_pool(self, pool): """AddAgentPool. Create an agent pool. :param :class:` ` pool: Details about the new agent pool :rtype: :class:` ` """ content = self._serialize.body(pool, 'TaskAgentPool') response = self._send(http_method='POST', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', version='5.1', content=content) return self._deserialize('TaskAgentPool', response) def delete_agent_pool(self, pool_id): """DeleteAgentPool. Delete an agent pool. :param int pool_id: ID of the agent pool to delete """ route_values = {} if pool_id is not None: route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') self._send(http_method='DELETE', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', version='5.1', route_values=route_values) def get_agent_pool(self, pool_id, properties=None, action_filter=None): """GetAgentPool. Get information about an agent pool. :param int pool_id: An agent pool ID :param [str] properties: Agent pool properties (comma-separated) :param str action_filter: Filter by whether the calling user has use or manage permissions :rtype: :class:` ` """ route_values = {} if pool_id is not None: route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') query_parameters = {} if properties is not None: properties = ",".join(properties) query_parameters['properties'] = self._serialize.query('properties', properties, 'str') if action_filter is not None: query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') response = self._send(http_method='GET', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TaskAgentPool', response) def get_agent_pools(self, pool_name=None, properties=None, pool_type=None, action_filter=None): """GetAgentPools. Get a list of agent pools. :param str pool_name: Filter by name :param [str] properties: Filter by agent pool properties (comma-separated) :param str pool_type: Filter by pool type :param str action_filter: Filter by whether the calling user has use or manage permissions :rtype: [TaskAgentPool] """ query_parameters = {} if pool_name is not None: query_parameters['poolName'] = self._serialize.query('pool_name', pool_name, 'str') if properties is not None: properties = ",".join(properties) query_parameters['properties'] = self._serialize.query('properties', properties, 'str') if pool_type is not None: query_parameters['poolType'] = self._serialize.query('pool_type', pool_type, 'str') if action_filter is not None: query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') response = self._send(http_method='GET', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', version='5.1', query_parameters=query_parameters) return self._deserialize('[TaskAgentPool]', self._unwrap_collection(response)) def get_agent_pools_by_ids(self, pool_ids, action_filter=None): """GetAgentPoolsByIds. Get a list of agent pools. :param [int] pool_ids: pool Ids to fetch :param str action_filter: Filter by whether the calling user has use or manage permissions :rtype: [TaskAgentPool] """ query_parameters = {} if pool_ids is not None: pool_ids = ",".join(map(str, pool_ids)) query_parameters['poolIds'] = self._serialize.query('pool_ids', pool_ids, 'str') if action_filter is not None: query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') response = self._send(http_method='GET', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', version='5.1', query_parameters=query_parameters) return self._deserialize('[TaskAgentPool]', self._unwrap_collection(response)) def update_agent_pool(self, pool, pool_id): """UpdateAgentPool. Update properties on an agent pool :param :class:` ` pool: Updated agent pool details :param int pool_id: The agent pool to update :rtype: :class:` ` """ route_values = {} if pool_id is not None: route_values['poolId'] = self._serialize.url('pool_id', pool_id, 'int') content = self._serialize.body(pool, 'TaskAgentPool') response = self._send(http_method='PATCH', location_id='a8c47e17-4d56-4a56-92bb-de7ea7dc65be', version='5.1', route_values=route_values, content=content) return self._deserialize('TaskAgentPool', response) def get_yaml_schema(self): """GetYamlSchema. :rtype: object """ response = self._send(http_method='GET', location_id='1f9990b9-1dba-441f-9c2e-6485888c42b6', version='5.1') return self._deserialize('object', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/test/000077500000000000000000000000001360605530400310475ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/test/__init__.py000066400000000000000000000070541360605530400331660ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.test.models import * from .test_client import TestClient __all__ = [ 'AggregatedDataForResultTrend', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', 'AggregatedRunsByOutcome', 'AggregatedRunsByState', 'BuildConfiguration', 'BuildCoverage', 'BuildReference', 'CloneOperationInformation', 'CloneOptions', 'CloneStatistics', 'CodeCoverageData', 'CodeCoverageStatistics', 'CodeCoverageSummary', 'CoverageStatistics', 'CustomTestField', 'CustomTestFieldDefinition', 'DtlEnvironmentDetails', 'FailingSince', 'FieldDetailsForTestResults', 'FunctionCoverage', 'GraphSubjectBase', 'IdentityRef', 'JobReference', 'LastResultDetails', 'LinkedWorkItemsQuery', 'LinkedWorkItemsQueryResult', 'ModuleCoverage', 'NameValuePair', 'PhaseReference', 'PipelineReference', 'PlanUpdateModel', 'PointAssignment', 'PointsFilter', 'PointUpdateModel', 'PropertyBag', 'QueryModel', 'ReferenceLinks', 'ReleaseEnvironmentDefinitionReference', 'ReleaseReference', 'ResultRetentionSettings', 'ResultsFilter', 'RunCreateModel', 'RunFilter', 'RunStatistic', 'RunSummaryModel', 'RunUpdateModel', 'ShallowReference', 'ShallowTestCaseResult', 'SharedStepModel', 'StageReference', 'SuiteCreateModel', 'SuiteEntry', 'SuiteEntryUpdateModel', 'SuiteTestCase', 'SuiteTestCaseUpdateModel', 'SuiteUpdateModel', 'TeamContext', 'TeamProjectReference', 'TestActionResultModel', 'TestAttachment', 'TestAttachmentReference', 'TestAttachmentRequestModel', 'TestCaseResult', 'TestCaseResultAttachmentModel', 'TestCaseResultIdentifier', 'TestCaseResultUpdateModel', 'TestConfiguration', 'TestEnvironment', 'TestFailureDetails', 'TestFailuresAnalysis', 'TestFlakyIdentifier', 'TestHistoryQuery', 'TestIterationDetailsModel', 'TestMessageLogDetails', 'TestMethod', 'TestOperationReference', 'TestOutcomeSettings', 'TestPlan', 'TestPlanCloneRequest', 'TestPoint', 'TestPointsQuery', 'TestResolutionState', 'TestResultCreateModel', 'TestResultDocument', 'TestResultHistory', 'TestResultHistoryDetailsForGroup', 'TestResultHistoryForGroup', 'TestResultMetaData', 'TestResultModelBase', 'TestResultParameterModel', 'TestResultPayload', 'TestResultsContext', 'TestResultsDetails', 'TestResultsDetailsForGroup', 'TestResultsGroupsForBuild', 'TestResultsGroupsForRelease', 'TestResultsQuery', 'TestResultSummary', 'TestResultTrendFilter', 'TestRun', 'TestRunCoverage', 'TestRunStatistic', 'TestSession', 'TestSettings', 'TestSubResult', 'TestSuite', 'TestSuiteCloneRequest', 'TestSummaryForWorkItem', 'TestTag', 'TestToWorkItemLinks', 'TestVariable', 'WorkItemReference', 'WorkItemToTestLinks', 'TestClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/test/test_client.py000066400000000000000000001203151360605530400337400ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.test import models class TestClient(Client): """Test :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TestClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'c2aa639c-3ccc-4740-b3b6-ce2a1e1d984e' def get_action_results(self, project, run_id, test_case_result_id, iteration_id, action_path=None): """GetActionResults. Gets the action results for an iteration in a test result. :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result that contains the iterations. :param int iteration_id: ID of the iteration that contains the actions. :param str action_path: Path of a specific action, used to get just that action. :rtype: [TestActionResultModel] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') if action_path is not None: route_values['actionPath'] = self._serialize.url('action_path', action_path, 'str') response = self._send(http_method='GET', location_id='eaf40c31-ff84-4062-aafd-d5664be11a37', version='5.1', route_values=route_values) return self._deserialize('[TestActionResultModel]', self._unwrap_collection(response)) def get_test_iteration(self, project, run_id, test_case_result_id, iteration_id, include_action_results=None): """GetTestIteration. Get iteration for a result :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result that contains the iterations. :param int iteration_id: Id of the test results Iteration. :param bool include_action_results: Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') query_parameters = {} if include_action_results is not None: query_parameters['includeActionResults'] = self._serialize.query('include_action_results', include_action_results, 'bool') response = self._send(http_method='GET', location_id='73eb9074-3446-4c44-8296-2f811950ff8d', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestIterationDetailsModel', response) def get_test_iterations(self, project, run_id, test_case_result_id, include_action_results=None): """GetTestIterations. Get iterations for a result :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result that contains the iterations. :param bool include_action_results: Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration. :rtype: [TestIterationDetailsModel] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') query_parameters = {} if include_action_results is not None: query_parameters['includeActionResults'] = self._serialize.query('include_action_results', include_action_results, 'bool') response = self._send(http_method='GET', location_id='73eb9074-3446-4c44-8296-2f811950ff8d', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestIterationDetailsModel]', self._unwrap_collection(response)) def get_result_parameters(self, project, run_id, test_case_result_id, iteration_id, param_name=None): """GetResultParameters. Get a list of parameterized results :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result that contains the iterations. :param int iteration_id: ID of the iteration that contains the parameterized results. :param str param_name: Name of the parameter. :rtype: [TestResultParameterModel] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') query_parameters = {} if param_name is not None: query_parameters['paramName'] = self._serialize.query('param_name', param_name, 'str') response = self._send(http_method='GET', location_id='7c69810d-3354-4af3-844a-180bd25db08a', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestResultParameterModel]', self._unwrap_collection(response)) def get_point(self, project, plan_id, suite_id, point_ids, wit_fields=None): """GetPoint. Get a test point. :param str project: Project ID or project name :param int plan_id: ID of the test plan. :param int suite_id: ID of the suite that contains the point. :param int point_ids: ID of the test point to get. :param str wit_fields: Comma-separated list of work item field names. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if point_ids is not None: route_values['pointIds'] = self._serialize.url('point_ids', point_ids, 'int') query_parameters = {} if wit_fields is not None: query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') response = self._send(http_method='GET', location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestPoint', response) def get_points(self, project, plan_id, suite_id, wit_fields=None, configuration_id=None, test_case_id=None, test_point_ids=None, include_point_details=None, skip=None, top=None): """GetPoints. Get a list of test points. :param str project: Project ID or project name :param int plan_id: ID of the test plan. :param int suite_id: ID of the suite that contains the points. :param str wit_fields: Comma-separated list of work item field names. :param str configuration_id: Get test points for specific configuration. :param str test_case_id: Get test points for a specific test case, valid when configurationId is not set. :param str test_point_ids: Get test points for comma-separated list of test point IDs, valid only when configurationId and testCaseId are not set. :param bool include_point_details: Include all properties for the test point. :param int skip: Number of test points to skip.. :param int top: Number of test points to return. :rtype: [TestPoint] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') query_parameters = {} if wit_fields is not None: query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') if configuration_id is not None: query_parameters['configurationId'] = self._serialize.query('configuration_id', configuration_id, 'str') if test_case_id is not None: query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'str') if test_point_ids is not None: query_parameters['testPointIds'] = self._serialize.query('test_point_ids', test_point_ids, 'str') if include_point_details is not None: query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestPoint]', self._unwrap_collection(response)) def update_test_points(self, point_update_model, project, plan_id, suite_id, point_ids): """UpdateTestPoints. Update test points. :param :class:` ` point_update_model: Data to update. :param str project: Project ID or project name :param int plan_id: ID of the test plan. :param int suite_id: ID of the suite that contains the points. :param str point_ids: ID of the test point to get. Use a comma-separated list of IDs to update multiple test points. :rtype: [TestPoint] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if point_ids is not None: route_values['pointIds'] = self._serialize.url('point_ids', point_ids, 'str') content = self._serialize.body(point_update_model, 'PointUpdateModel') response = self._send(http_method='PATCH', location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c', version='5.1', route_values=route_values, content=content) return self._deserialize('[TestPoint]', self._unwrap_collection(response)) def add_test_results_to_test_run(self, results, project, run_id): """AddTestResultsToTestRun. Add test results to a test run. :param [TestCaseResult] results: List of test results to add. :param str project: Project ID or project name :param int run_id: Test run ID into which test results to add. :rtype: [TestCaseResult] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') content = self._serialize.body(results, '[TestCaseResult]') response = self._send(http_method='POST', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', version='5.1', route_values=route_values, content=content) return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) def get_test_result_by_id(self, project, run_id, test_case_result_id, details_to_include=None): """GetTestResultById. Get a test result for a test run. :param str project: Project ID or project name :param int run_id: Test run ID of a test result to fetch. :param int test_case_result_id: Test result ID. :param str details_to_include: Details to include with test results. Default is None. Other values are Iterations, WorkItems and SubResults. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') query_parameters = {} if details_to_include is not None: query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str') response = self._send(http_method='GET', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestCaseResult', response) def get_test_results(self, project, run_id, details_to_include=None, skip=None, top=None, outcomes=None): """GetTestResults. Get test results for a test run. :param str project: Project ID or project name :param int run_id: Test run ID of test results to fetch. :param str details_to_include: Details to include with test results. Default is None. Other values are Iterations and WorkItems. :param int skip: Number of test results to skip from beginning. :param int top: Number of test results to return. Maximum is 1000 when detailsToInclude is None and 200 otherwise. :param [TestOutcome] outcomes: Comma separated list of test outcomes to filter test results. :rtype: [TestCaseResult] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') query_parameters = {} if details_to_include is not None: query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if outcomes is not None: outcomes = ",".join(map(str, outcomes)) query_parameters['outcomes'] = self._serialize.query('outcomes', outcomes, 'str') response = self._send(http_method='GET', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) def update_test_results(self, results, project, run_id): """UpdateTestResults. Update test results in a test run. :param [TestCaseResult] results: List of test results to update. :param str project: Project ID or project name :param int run_id: Test run ID whose test results to update. :rtype: [TestCaseResult] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') content = self._serialize.body(results, '[TestCaseResult]') response = self._send(http_method='PATCH', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', version='5.1', route_values=route_values, content=content) return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) def get_test_run_statistics(self, project, run_id): """GetTestRunStatistics. Get test run statistics , used when we want to get summary of a run by outcome. :param str project: Project ID or project name :param int run_id: ID of the run to get. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') response = self._send(http_method='GET', location_id='0a42c424-d764-4a16-a2d5-5c85f87d0ae8', version='5.1', route_values=route_values) return self._deserialize('TestRunStatistic', response) def create_test_run(self, test_run, project): """CreateTestRun. Create new test run. :param :class:` ` test_run: Run details RunCreateModel :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(test_run, 'RunCreateModel') response = self._send(http_method='POST', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.1', route_values=route_values, content=content) return self._deserialize('TestRun', response) def delete_test_run(self, project, run_id): """DeleteTestRun. Delete a test run by its ID. :param str project: Project ID or project name :param int run_id: ID of the run to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') self._send(http_method='DELETE', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.1', route_values=route_values) def get_test_run_by_id(self, project, run_id, include_details=None): """GetTestRunById. Get a test run by its ID. :param str project: Project ID or project name :param int run_id: ID of the run to get. :param bool include_details: Defualt value is true. It includes details like run statistics,release,build,Test enviornment,Post process state and more :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') query_parameters = {} if include_details is not None: query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') response = self._send(http_method='GET', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestRun', response) def get_test_runs(self, project, build_uri=None, owner=None, tmi_run_id=None, plan_id=None, include_run_details=None, automated=None, skip=None, top=None): """GetTestRuns. Get a list of test runs. :param str project: Project ID or project name :param str build_uri: URI of the build that the runs used. :param str owner: Team foundation ID of the owner of the runs. :param str tmi_run_id: :param int plan_id: ID of the test plan that the runs are a part of. :param bool include_run_details: If true, include all the properties of the runs. :param bool automated: If true, only returns automated runs. :param int skip: Number of test runs to skip. :param int top: Number of test runs to return. :rtype: [TestRun] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if build_uri is not None: query_parameters['buildUri'] = self._serialize.query('build_uri', build_uri, 'str') if owner is not None: query_parameters['owner'] = self._serialize.query('owner', owner, 'str') if tmi_run_id is not None: query_parameters['tmiRunId'] = self._serialize.query('tmi_run_id', tmi_run_id, 'str') if plan_id is not None: query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'int') if include_run_details is not None: query_parameters['includeRunDetails'] = self._serialize.query('include_run_details', include_run_details, 'bool') if automated is not None: query_parameters['automated'] = self._serialize.query('automated', automated, 'bool') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestRun]', self._unwrap_collection(response)) def query_test_runs(self, project, min_last_updated_date, max_last_updated_date, state=None, plan_ids=None, is_automated=None, publish_context=None, build_ids=None, build_def_ids=None, branch_name=None, release_ids=None, release_def_ids=None, release_env_ids=None, release_env_def_ids=None, run_title=None, top=None, continuation_token=None): """QueryTestRuns. Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate. :param str project: Project ID or project name :param datetime min_last_updated_date: Minimum Last Modified Date of run to be queried (Mandatory). :param datetime max_last_updated_date: Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days). :param str state: Current state of the Runs to be queried. :param [int] plan_ids: Plan Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param bool is_automated: Automation type of the Runs to be queried. :param str publish_context: PublishContext of the Runs to be queried. :param [int] build_ids: Build Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param [int] build_def_ids: Build Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param str branch_name: Source Branch name of the Runs to be queried. :param [int] release_ids: Release Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param [int] release_def_ids: Release Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param [int] release_env_ids: Release Environment Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param [int] release_env_def_ids: Release Environment Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param str run_title: Run Title of the Runs to be queried. :param int top: Number of runs to be queried. Limit is 100 :param str continuation_token: continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user. :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if min_last_updated_date is not None: query_parameters['minLastUpdatedDate'] = self._serialize.query('min_last_updated_date', min_last_updated_date, 'iso-8601') if max_last_updated_date is not None: query_parameters['maxLastUpdatedDate'] = self._serialize.query('max_last_updated_date', max_last_updated_date, 'iso-8601') if state is not None: query_parameters['state'] = self._serialize.query('state', state, 'str') if plan_ids is not None: plan_ids = ",".join(map(str, plan_ids)) query_parameters['planIds'] = self._serialize.query('plan_ids', plan_ids, 'str') if is_automated is not None: query_parameters['isAutomated'] = self._serialize.query('is_automated', is_automated, 'bool') if publish_context is not None: query_parameters['publishContext'] = self._serialize.query('publish_context', publish_context, 'str') if build_ids is not None: build_ids = ",".join(map(str, build_ids)) query_parameters['buildIds'] = self._serialize.query('build_ids', build_ids, 'str') if build_def_ids is not None: build_def_ids = ",".join(map(str, build_def_ids)) query_parameters['buildDefIds'] = self._serialize.query('build_def_ids', build_def_ids, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') if release_ids is not None: release_ids = ",".join(map(str, release_ids)) query_parameters['releaseIds'] = self._serialize.query('release_ids', release_ids, 'str') if release_def_ids is not None: release_def_ids = ",".join(map(str, release_def_ids)) query_parameters['releaseDefIds'] = self._serialize.query('release_def_ids', release_def_ids, 'str') if release_env_ids is not None: release_env_ids = ",".join(map(str, release_env_ids)) query_parameters['releaseEnvIds'] = self._serialize.query('release_env_ids', release_env_ids, 'str') if release_env_def_ids is not None: release_env_def_ids = ",".join(map(str, release_env_def_ids)) query_parameters['releaseEnvDefIds'] = self._serialize.query('release_env_def_ids', release_env_def_ids, 'str') if run_title is not None: query_parameters['runTitle'] = self._serialize.query('run_title', run_title, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[TestRun]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.QueryTestRunsResponseValue(response_value, continuation_token) class QueryTestRunsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the query_test_runs method :param value: :type value: :class:`<[TestRun]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def update_test_run(self, run_update_model, project, run_id): """UpdateTestRun. Update test run by its ID. :param :class:` ` run_update_model: Run details RunUpdateModel :param str project: Project ID or project name :param int run_id: ID of the run to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') content = self._serialize.body(run_update_model, 'RunUpdateModel') response = self._send(http_method='PATCH', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.1', route_values=route_values, content=content) return self._deserialize('TestRun', response) def add_test_cases_to_suite(self, project, plan_id, suite_id, test_case_ids): """AddTestCasesToSuite. Add test cases to suite. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suite. :param int suite_id: ID of the test suite to which the test cases must be added. :param str test_case_ids: IDs of the test cases to add to the suite. Ids are specified in comma separated format. :rtype: [SuiteTestCase] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if test_case_ids is not None: route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str') route_values['action'] = 'TestCases' response = self._send(http_method='POST', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.1', route_values=route_values) return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) def get_test_case_by_id(self, project, plan_id, suite_id, test_case_ids): """GetTestCaseById. Get a specific test case in a test suite with test case id. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suites. :param int suite_id: ID of the suite that contains the test case. :param int test_case_ids: ID of the test case to get. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if test_case_ids is not None: route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'int') route_values['action'] = 'TestCases' response = self._send(http_method='GET', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.1', route_values=route_values) return self._deserialize('SuiteTestCase', response) def get_test_cases(self, project, plan_id, suite_id): """GetTestCases. Get all test cases in a suite. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suites. :param int suite_id: ID of the suite to get. :rtype: [SuiteTestCase] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') route_values['action'] = 'TestCases' response = self._send(http_method='GET', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.1', route_values=route_values) return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) def remove_test_cases_from_suite_url(self, project, plan_id, suite_id, test_case_ids): """RemoveTestCasesFromSuiteUrl. The test points associated with the test cases are removed from the test suite. The test case work item is not deleted from the system. See test cases resource to delete a test case permanently. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suite. :param int suite_id: ID of the suite to get. :param str test_case_ids: IDs of the test cases to remove from the suite. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if test_case_ids is not None: route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str') route_values['action'] = 'TestCases' self._send(http_method='DELETE', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.1', route_values=route_values) def update_suite_test_cases(self, suite_test_case_update_model, project, plan_id, suite_id, test_case_ids): """UpdateSuiteTestCases. Updates the properties of the test case association in a suite. :param :class:` ` suite_test_case_update_model: Model for updation of the properties of test case suite association. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suite. :param int suite_id: ID of the test suite to which the test cases must be added. :param str test_case_ids: IDs of the test cases to add to the suite. Ids are specified in comma separated format. :rtype: [SuiteTestCase] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if test_case_ids is not None: route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str') route_values['action'] = 'TestCases' content = self._serialize.body(suite_test_case_update_model, 'SuiteTestCaseUpdateModel') response = self._send(http_method='PATCH', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.1', route_values=route_values, content=content) return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/test_plan/000077500000000000000000000000001360605530400320615ustar00rootroot00000000000000__init__.py000066400000000000000000000041641360605530400341200ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/test_plan# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.test_plan.models import * from .test_plan_client import TestPlanClient __all__ = [ 'BuildDefinitionReference', 'CloneOperationCommonResponse', 'CloneOptions', 'CloneStatistics', 'CloneTestPlanOperationInformation', 'CloneTestPlanParams', 'CloneTestSuiteOperationInformation', 'CloneTestSuiteParams', 'Configuration', 'DestinationTestPlanCloneParams', 'DestinationTestSuiteInfo', 'GraphSubjectBase', 'IdentityRef', 'LastResultDetails', 'NameValuePair', 'PointAssignment', 'ReferenceLinks', 'ReleaseEnvironmentDefinitionReference', 'Results', 'SourceTestPlanInfo', 'SourceTestplanResponse', 'SourceTestSuiteInfo', 'SuiteEntry', 'SuiteEntryUpdateParams', 'SuiteTestCaseCreateUpdateParameters', 'TeamProjectReference', 'TestCase', 'TestCaseReference', 'TestConfiguration', 'TestConfigurationCreateUpdateParameters', 'TestConfigurationReference', 'TestEnvironment', 'TestOutcomeSettings', 'TestPlan', 'TestPlanCreateParams', 'TestPlanDetailedReference', 'TestPlanReference', 'TestPlansHubRefreshData', 'TestPlanUpdateParams', 'TestPoint', 'TestPointCount', 'TestPointResults', 'TestPointUpdateParams', 'TestSettings', 'TestSuite', 'TestSuiteCreateParams', 'TestSuiteCreateUpdateCommonParams', 'TestSuiteReference', 'TestSuiteReferenceWithProject', 'TestSuiteUpdateParams', 'TestVariable', 'TestVariableCreateUpdateParameters', 'WorkItem', 'WorkItemDetails', 'TestPlanClient' ] test_plan_client.py000066400000000000000000000040561360605530400357100ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/test_plan# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.test_plan import models class TestPlanClient(Client): """TestPlan :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TestPlanClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_suites_by_test_case_id(self, test_case_id): """GetSuitesByTestCaseId. Find the list of all test suites in which a given test case is present. This is helpful if you need to find out which test suites are using a test case, when you need to make changes to a test case. :param int test_case_id: ID of the test case for which suites need to be fetched. :rtype: [TestSuite] """ query_parameters = {} if test_case_id is not None: query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'int') response = self._send(http_method='GET', location_id='a4080e84-f17b-4fad-84f1-7960b6525bf2', version='5.1', query_parameters=query_parameters) return self._deserialize('[TestSuite]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/test_results/000077500000000000000000000000001360605530400326305ustar00rootroot00000000000000__init__.py000066400000000000000000000057631360605530400346750ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/test_results# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.test_results.models import * from .test_results_client import TestResultsClient __all__ = [ 'AggregatedDataForResultTrend', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', 'AggregatedRunsByOutcome', 'AggregatedRunsByState', 'BuildConfiguration', 'BuildCoverage', 'BuildReference', 'CodeCoverageData', 'CodeCoverageStatistics', 'CodeCoverageSummary', 'CoverageStatistics', 'CustomTestField', 'DtlEnvironmentDetails', 'FailingSince', 'FieldDetailsForTestResults', 'FileCoverageRequest', 'FlakyDetection', 'FlakyDetectionPipelines', 'FlakySettings', 'FunctionCoverage', 'GraphSubjectBase', 'IdentityRef', 'JobReference', 'ModuleCoverage', 'PhaseReference', 'PipelineReference', 'QueryModel', 'ReferenceLinks', 'ReleaseReference', 'ResultsFilter', 'RunCreateModel', 'RunFilter', 'RunStatistic', 'RunSummaryModel', 'RunUpdateModel', 'ShallowReference', 'ShallowTestCaseResult', 'SharedStepModel', 'StageReference', 'TeamProjectReference', 'TestActionResultModel', 'TestAttachment', 'TestAttachmentReference', 'TestAttachmentRequestModel', 'TestCaseResult', 'TestCaseResultAttachmentModel', 'TestCaseResultIdentifier', 'TestEnvironment', 'TestFailureDetails', 'TestFailuresAnalysis', 'TestFlakyIdentifier', 'TestHistoryQuery', 'TestIterationDetailsModel', 'TestLog', 'TestLogReference', 'TestLogStoreEndpointDetails', 'TestMessageLogDetails', 'TestMethod', 'TestOperationReference', 'TestResolutionState', 'TestResultDocument', 'TestResultHistory', 'TestResultHistoryDetailsForGroup', 'TestResultHistoryForGroup', 'TestResultMetaData', 'TestResultMetaDataUpdateInput', 'TestResultModelBase', 'TestResultParameterModel', 'TestResultPayload', 'TestResultsContext', 'TestResultsDetails', 'TestResultsDetailsForGroup', 'TestResultsQuery', 'TestResultsSettings', 'TestResultSummary', 'TestResultsUpdateSettings', 'TestResultTrendFilter', 'TestRun', 'TestRunCoverage', 'TestRunStatistic', 'TestSettings', 'TestSubResult', 'TestSummaryForWorkItem', 'TestTag', 'TestTagSummary', 'TestTagsUpdateModel', 'TestToWorkItemLinks', 'WorkItemReference', 'WorkItemToTestLinks', 'TestResultsClient' ] test_results_client.py000066400000000000000000000041211360605530400372170ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/test_results# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.test_results import models class TestResultsClient(Client): """TestResults :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TestResultsClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_test_run_statistics(self, project, run_id): """GetTestRunStatistics. Get test run statistics , used when we want to get summary of a run by outcome. :param str project: Project ID or project name :param int run_id: ID of the run to get. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') response = self._send(http_method='GET', location_id='82b986e8-ca9e-4a89-b39e-f65c69bc104a', version='5.1', route_values=route_values) return self._deserialize('TestRunStatistic', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/tfvc/000077500000000000000000000000001360605530400310325ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/tfvc/__init__.py000066400000000000000000000030771360605530400331520ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.tfvc.models import * from .tfvc_client import TfvcClient __all__ = [ 'AssociatedWorkItem', 'Change', 'CheckinNote', 'FileContentMetadata', 'GitRepository', 'GitRepositoryRef', 'GraphSubjectBase', 'IdentityRef', 'ItemContent', 'ItemModel', 'ReferenceLinks', 'TeamProjectCollectionReference', 'TeamProjectReference', 'TfvcBranch', 'TfvcBranchMapping', 'TfvcBranchRef', 'TfvcChange', 'TfvcChangeset', 'TfvcChangesetRef', 'TfvcChangesetSearchCriteria', 'TfvcChangesetsRequestData', 'TfvcItem', 'TfvcItemDescriptor', 'TfvcItemRequestData', 'TfvcLabel', 'TfvcLabelRef', 'TfvcLabelRequestData', 'TfvcMappingFilter', 'TfvcMergeSource', 'TfvcPolicyFailureInfo', 'TfvcPolicyOverrideInfo', 'TfvcShallowBranchRef', 'TfvcShelveset', 'TfvcShelvesetRef', 'TfvcShelvesetRequestData', 'TfvcStatistics', 'TfvcVersionDescriptor', 'VersionControlProjectInfo', 'VstsInfo', 'TfvcClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/tfvc/tfvc_client.py000066400000000000000000001341751360605530400337170ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.tfvc import models class TfvcClient(Client): """Tfvc :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TfvcClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '8aa40520-446d-40e6-89f6-9c9f9ce44c48' def get_branch(self, path, project=None, include_parent=None, include_children=None): """GetBranch. Get a single branch hierarchy at the given path with parents or children as specified. :param str path: Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder. :param str project: Project ID or project name :param bool include_parent: Return the parent branch, if there is one. Default: False :param bool include_children: Return child branches, if there are any. Default: False :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if include_parent is not None: query_parameters['includeParent'] = self._serialize.query('include_parent', include_parent, 'bool') if include_children is not None: query_parameters['includeChildren'] = self._serialize.query('include_children', include_children, 'bool') response = self._send(http_method='GET', location_id='bc1f417e-239d-42e7-85e1-76e80cb2d6eb', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcBranch', response) def get_branches(self, project=None, include_parent=None, include_children=None, include_deleted=None, include_links=None): """GetBranches. Get a collection of branch roots -- first-level children, branches with no parents. :param str project: Project ID or project name :param bool include_parent: Return the parent branch, if there is one. Default: False :param bool include_children: Return the child branches for each root branch. Default: False :param bool include_deleted: Return deleted branches. Default: False :param bool include_links: Return links. Default: False :rtype: [TfvcBranch] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if include_parent is not None: query_parameters['includeParent'] = self._serialize.query('include_parent', include_parent, 'bool') if include_children is not None: query_parameters['includeChildren'] = self._serialize.query('include_children', include_children, 'bool') if include_deleted is not None: query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='bc1f417e-239d-42e7-85e1-76e80cb2d6eb', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcBranch]', self._unwrap_collection(response)) def get_branch_refs(self, scope_path, project=None, include_deleted=None, include_links=None): """GetBranchRefs. Get branch hierarchies below the specified scopePath :param str scope_path: Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder. :param str project: Project ID or project name :param bool include_deleted: Return deleted branches. Default: False :param bool include_links: Return links. Default: False :rtype: [TfvcBranchRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if include_deleted is not None: query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='bc1f417e-239d-42e7-85e1-76e80cb2d6eb', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcBranchRef]', self._unwrap_collection(response)) def get_changeset_changes(self, id=None, skip=None, top=None, continuation_token=None): """GetChangesetChanges. Retrieve Tfvc changes for a given changeset. :param int id: ID of the changeset. Default: null :param int skip: Number of results to skip. Default: null :param int top: The maximum number of results to return. Default: null :param str continuation_token: Return the next page of results. Default: null :rtype: :class:`` """ route_values = {} if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='f32b86f2-15b9-4fe6-81b1-6f8938617ee5', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[TfvcChange]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetChangesetChangesResponseValue(response_value, continuation_token) class GetChangesetChangesResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_changeset_changes method :param value: :type value: :class:`<[TfvcChange]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def create_changeset(self, changeset, project=None): """CreateChangeset. Create a new changeset. :param :class:` ` changeset: :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(changeset, 'TfvcChangeset') response = self._send(http_method='POST', location_id='0bc8f0a4-6bfb-42a9-ba84-139da7b99c49', version='5.1', route_values=route_values, content=content) return self._deserialize('TfvcChangesetRef', response) def get_changeset(self, id, project=None, max_change_count=None, include_details=None, include_work_items=None, max_comment_length=None, include_source_rename=None, skip=None, top=None, orderby=None, search_criteria=None): """GetChangeset. Retrieve a Tfvc Changeset :param int id: Changeset Id to retrieve. :param str project: Project ID or project name :param int max_change_count: Number of changes to return (maximum 100 changes) Default: 0 :param bool include_details: Include policy details and check-in notes in the response. Default: false :param bool include_work_items: Include workitems. Default: false :param int max_comment_length: Include details about associated work items in the response. Default: null :param bool include_source_rename: Include renames. Default: false :param int skip: Number of results to skip. Default: null :param int top: The maximum number of results to return. Default: null :param str orderby: Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. :param :class:` ` search_criteria: Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if max_change_count is not None: query_parameters['maxChangeCount'] = self._serialize.query('max_change_count', max_change_count, 'int') if include_details is not None: query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') if include_work_items is not None: query_parameters['includeWorkItems'] = self._serialize.query('include_work_items', include_work_items, 'bool') if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if include_source_rename is not None: query_parameters['includeSourceRename'] = self._serialize.query('include_source_rename', include_source_rename, 'bool') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if orderby is not None: query_parameters['$orderby'] = self._serialize.query('orderby', orderby, 'str') if search_criteria is not None: if search_criteria.item_path is not None: query_parameters['searchCriteria.itemPath'] = search_criteria.item_path if search_criteria.author is not None: query_parameters['searchCriteria.author'] = search_criteria.author if search_criteria.from_date is not None: query_parameters['searchCriteria.fromDate'] = search_criteria.from_date if search_criteria.to_date is not None: query_parameters['searchCriteria.toDate'] = search_criteria.to_date if search_criteria.from_id is not None: query_parameters['searchCriteria.fromId'] = search_criteria.from_id if search_criteria.to_id is not None: query_parameters['searchCriteria.toId'] = search_criteria.to_id if search_criteria.follow_renames is not None: query_parameters['searchCriteria.followRenames'] = search_criteria.follow_renames if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if search_criteria.mappings is not None: query_parameters['searchCriteria.mappings'] = search_criteria.mappings response = self._send(http_method='GET', location_id='0bc8f0a4-6bfb-42a9-ba84-139da7b99c49', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcChangeset', response) def get_changesets(self, project=None, max_comment_length=None, skip=None, top=None, orderby=None, search_criteria=None): """GetChangesets. Retrieve Tfvc Changesets :param str project: Project ID or project name :param int max_comment_length: Include details about associated work items in the response. Default: null :param int skip: Number of results to skip. Default: null :param int top: The maximum number of results to return. Default: null :param str orderby: Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. :param :class:` ` search_criteria: Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null :rtype: [TfvcChangesetRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if orderby is not None: query_parameters['$orderby'] = self._serialize.query('orderby', orderby, 'str') if search_criteria is not None: if search_criteria.item_path is not None: query_parameters['searchCriteria.itemPath'] = search_criteria.item_path if search_criteria.author is not None: query_parameters['searchCriteria.author'] = search_criteria.author if search_criteria.from_date is not None: query_parameters['searchCriteria.fromDate'] = search_criteria.from_date if search_criteria.to_date is not None: query_parameters['searchCriteria.toDate'] = search_criteria.to_date if search_criteria.from_id is not None: query_parameters['searchCriteria.fromId'] = search_criteria.from_id if search_criteria.to_id is not None: query_parameters['searchCriteria.toId'] = search_criteria.to_id if search_criteria.follow_renames is not None: query_parameters['searchCriteria.followRenames'] = search_criteria.follow_renames if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if search_criteria.mappings is not None: query_parameters['searchCriteria.mappings'] = search_criteria.mappings response = self._send(http_method='GET', location_id='0bc8f0a4-6bfb-42a9-ba84-139da7b99c49', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcChangesetRef]', self._unwrap_collection(response)) def get_batched_changesets(self, changesets_request_data): """GetBatchedChangesets. Returns changesets for a given list of changeset Ids. :param :class:` ` changesets_request_data: List of changeset IDs. :rtype: [TfvcChangesetRef] """ content = self._serialize.body(changesets_request_data, 'TfvcChangesetsRequestData') response = self._send(http_method='POST', location_id='b7e7c173-803c-4fea-9ec8-31ee35c5502a', version='5.1', content=content) return self._deserialize('[TfvcChangesetRef]', self._unwrap_collection(response)) def get_changeset_work_items(self, id=None): """GetChangesetWorkItems. Retrieves the work items associated with a particular changeset. :param int id: ID of the changeset. Default: null :rtype: [AssociatedWorkItem] """ route_values = {} if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') response = self._send(http_method='GET', location_id='64ae0bea-1d71-47c9-a9e5-fe73f5ea0ff4', version='5.1', route_values=route_values) return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) def get_items_batch(self, item_request_data, project=None): """GetItemsBatch. Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. :param :class:` ` item_request_data: :param str project: Project ID or project name :rtype: [[TfvcItem]] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(item_request_data, 'TfvcItemRequestData') response = self._send(http_method='POST', location_id='fe6f827b-5f64-480f-b8af-1eca3b80e833', version='5.1', route_values=route_values, content=content) return self._deserialize('[[TfvcItem]]', self._unwrap_collection(response)) def get_items_batch_zip(self, item_request_data, project=None, **kwargs): """GetItemsBatchZip. Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. :param :class:` ` item_request_data: :param str project: Project ID or project name :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(item_request_data, 'TfvcItemRequestData') response = self._send(http_method='POST', location_id='fe6f827b-5f64-480f-b8af-1eca3b80e833', version='5.1', route_values=route_values, content=content, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_item(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None): """GetItem. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str path: Version control path of an individual item to return. :param str project: Project ID or project name :param str file_name: file name of item returned. :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcItem', response) def get_item_content(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetItemContent. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str path: Version control path of an individual item to return. :param str project: Project ID or project name :param str file_name: file name of item returned. :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_items(self, project=None, scope_path=None, recursion_level=None, include_links=None, version_descriptor=None): """GetItems. Get a list of Tfvc items :param str project: Project ID or project name :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param bool include_links: True to include links. :param :class:` ` version_descriptor: :rtype: [TfvcItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcItem]', self._unwrap_collection(response)) def get_item_text(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetItemText. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str path: Version control path of an individual item to return. :param str project: Project ID or project name :param str file_name: file name of item returned. :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_item_zip(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetItemZip. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str path: Version control path of an individual item to return. :param str project: Project ID or project name :param str file_name: file name of item returned. :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_label_items(self, label_id, top=None, skip=None): """GetLabelItems. Get items under a label. :param str label_id: Unique identifier of label :param int top: Max number of items to return :param int skip: Number of items to skip :rtype: [TfvcItem] """ route_values = {} if label_id is not None: route_values['labelId'] = self._serialize.url('label_id', label_id, 'str') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='06166e34-de17-4b60-8cd1-23182a346fda', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcItem]', self._unwrap_collection(response)) def get_label(self, label_id, request_data, project=None): """GetLabel. Get a single deep label. :param str label_id: Unique identifier of label :param :class:` ` request_data: maxItemCount :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if label_id is not None: route_values['labelId'] = self._serialize.url('label_id', label_id, 'str') query_parameters = {} if request_data is not None: if request_data.label_scope is not None: query_parameters['requestData.labelScope'] = request_data.label_scope if request_data.name is not None: query_parameters['requestData.name'] = request_data.name if request_data.owner is not None: query_parameters['requestData.owner'] = request_data.owner if request_data.item_label_filter is not None: query_parameters['requestData.itemLabelFilter'] = request_data.item_label_filter if request_data.max_item_count is not None: query_parameters['requestData.maxItemCount'] = request_data.max_item_count if request_data.include_links is not None: query_parameters['requestData.includeLinks'] = request_data.include_links response = self._send(http_method='GET', location_id='a5d9bd7f-b661-4d0e-b9be-d9c16affae54', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcLabel', response) def get_labels(self, request_data, project=None, top=None, skip=None): """GetLabels. Get a collection of shallow label references. :param :class:` ` request_data: labelScope, name, owner, and itemLabelFilter :param str project: Project ID or project name :param int top: Max number of labels to return :param int skip: Number of labels to skip :rtype: [TfvcLabelRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if request_data is not None: if request_data.label_scope is not None: query_parameters['requestData.labelScope'] = request_data.label_scope if request_data.name is not None: query_parameters['requestData.name'] = request_data.name if request_data.owner is not None: query_parameters['requestData.owner'] = request_data.owner if request_data.item_label_filter is not None: query_parameters['requestData.itemLabelFilter'] = request_data.item_label_filter if request_data.max_item_count is not None: query_parameters['requestData.maxItemCount'] = request_data.max_item_count if request_data.include_links is not None: query_parameters['requestData.includeLinks'] = request_data.include_links if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='a5d9bd7f-b661-4d0e-b9be-d9c16affae54', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcLabelRef]', self._unwrap_collection(response)) def get_shelveset_changes(self, shelveset_id, top=None, skip=None): """GetShelvesetChanges. Get changes included in a shelveset. :param str shelveset_id: Shelveset's unique ID :param int top: Max number of changes to return :param int skip: Number of changes to skip :rtype: [TfvcChange] """ query_parameters = {} if shelveset_id is not None: query_parameters['shelvesetId'] = self._serialize.query('shelveset_id', shelveset_id, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='dbaf075b-0445-4c34-9e5b-82292f856522', version='5.1', query_parameters=query_parameters) return self._deserialize('[TfvcChange]', self._unwrap_collection(response)) def get_shelveset(self, shelveset_id, request_data=None): """GetShelveset. Get a single deep shelveset. :param str shelveset_id: Shelveset's unique ID :param :class:` ` request_data: includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength :rtype: :class:` ` """ query_parameters = {} if shelveset_id is not None: query_parameters['shelvesetId'] = self._serialize.query('shelveset_id', shelveset_id, 'str') if request_data is not None: if request_data.name is not None: query_parameters['requestData.name'] = request_data.name if request_data.owner is not None: query_parameters['requestData.owner'] = request_data.owner if request_data.max_comment_length is not None: query_parameters['requestData.maxCommentLength'] = request_data.max_comment_length if request_data.max_change_count is not None: query_parameters['requestData.maxChangeCount'] = request_data.max_change_count if request_data.include_details is not None: query_parameters['requestData.includeDetails'] = request_data.include_details if request_data.include_work_items is not None: query_parameters['requestData.includeWorkItems'] = request_data.include_work_items if request_data.include_links is not None: query_parameters['requestData.includeLinks'] = request_data.include_links response = self._send(http_method='GET', location_id='e36d44fb-e907-4b0a-b194-f83f1ed32ad3', version='5.1', query_parameters=query_parameters) return self._deserialize('TfvcShelveset', response) def get_shelvesets(self, request_data=None, top=None, skip=None): """GetShelvesets. Return a collection of shallow shelveset references. :param :class:` ` request_data: name, owner, and maxCommentLength :param int top: Max number of shelvesets to return :param int skip: Number of shelvesets to skip :rtype: [TfvcShelvesetRef] """ query_parameters = {} if request_data is not None: if request_data.name is not None: query_parameters['requestData.name'] = request_data.name if request_data.owner is not None: query_parameters['requestData.owner'] = request_data.owner if request_data.max_comment_length is not None: query_parameters['requestData.maxCommentLength'] = request_data.max_comment_length if request_data.max_change_count is not None: query_parameters['requestData.maxChangeCount'] = request_data.max_change_count if request_data.include_details is not None: query_parameters['requestData.includeDetails'] = request_data.include_details if request_data.include_work_items is not None: query_parameters['requestData.includeWorkItems'] = request_data.include_work_items if request_data.include_links is not None: query_parameters['requestData.includeLinks'] = request_data.include_links if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='e36d44fb-e907-4b0a-b194-f83f1ed32ad3', version='5.1', query_parameters=query_parameters) return self._deserialize('[TfvcShelvesetRef]', self._unwrap_collection(response)) def get_shelveset_work_items(self, shelveset_id): """GetShelvesetWorkItems. Get work items associated with a shelveset. :param str shelveset_id: Shelveset's unique ID :rtype: [AssociatedWorkItem] """ query_parameters = {} if shelveset_id is not None: query_parameters['shelvesetId'] = self._serialize.query('shelveset_id', shelveset_id, 'str') response = self._send(http_method='GET', location_id='a7a0c1c1-373e-425a-b031-a519474d743d', version='5.1', query_parameters=query_parameters) return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/wiki/000077500000000000000000000000001360605530400310335ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/wiki/__init__.py000066400000000000000000000022101360605530400331370ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.wiki.models import * from .wiki_client import WikiClient __all__ = [ 'GitRepository', 'GitRepositoryRef', 'GitVersionDescriptor', 'ReferenceLinks', 'TeamProjectCollectionReference', 'TeamProjectReference', 'WikiAttachment', 'WikiAttachmentResponse', 'WikiCreateBaseParameters', 'WikiCreateParametersV2', 'WikiPage', 'WikiPageCreateOrUpdateParameters', 'WikiPageMove', 'WikiPageMoveParameters', 'WikiPageMoveResponse', 'WikiPageResponse', 'WikiPageViewStats', 'WikiUpdateParameters', 'WikiV2', 'WikiClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/wiki/wiki_client.py000066400000000000000000000576531360605530400337260ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.wiki import models class WikiClient(Client): """Wiki :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(WikiClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'bf7d82a0-8aa5-4613-94ef-6172a5ea01f3' def create_attachment(self, upload_stream, project, wiki_identifier, name, version_descriptor=None, **kwargs): """CreateAttachment. Creates an attachment in the wiki. :param object upload_stream: Stream to upload :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str name: Wiki attachment name. :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='c4382d8d-fefc-40e0-92c5-49852e9e17c0', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/octet-stream') response_object = models.WikiAttachmentResponse() response_object.attachment = self._deserialize('WikiAttachment', response) response_object.eTag = response.headers.get('ETag') return response_object def create_page_move(self, page_move_parameters, project, wiki_identifier, comment=None, version_descriptor=None): """CreatePageMove. Creates a page move operation that updates the path and order of the page as provided in the parameters. :param :class:` ` page_move_parameters: Page more operation parameters. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str comment: Comment that is to be associated with this page move. :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if comment is not None: query_parameters['comment'] = self._serialize.query('comment', comment, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options content = self._serialize.body(page_move_parameters, 'WikiPageMoveParameters') response = self._send(http_method='POST', location_id='e37bbe71-cbae-49e5-9a4e-949143b9d910', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) response_object = models.WikiPageMoveResponse() response_object.page_move = self._deserialize('WikiPageMove', response) response_object.eTag = response.headers.get('ETag') return response_object def create_or_update_page(self, parameters, project, wiki_identifier, path, version, comment=None, version_descriptor=None): """CreateOrUpdatePage. Creates or edits a wiki page. :param :class:` ` parameters: Wiki create or update operation parameters. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param String version: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request. :param str comment: Comment to be associated with the page operation. :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if comment is not None: query_parameters['comment'] = self._serialize.query('comment', comment, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options additional_headers = {} if version is not None: additional_headers['If-Match'] = version content = self._serialize.body(parameters, 'WikiPageCreateOrUpdateParameters') response = self._send(http_method='PUT', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.1', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers, content=content) response_object = models.WikiPageResponse() response_object.page = self._deserialize('WikiPage', response) response_object.eTag = response.headers.get('ETag') return response_object def delete_page(self, project, wiki_identifier, path, comment=None, version_descriptor=None): """DeletePage. Deletes a wiki page. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param str comment: Comment to be associated with this page delete. :param :class:` ` version_descriptor: GitVersionDescriptor for the page. (Optional in case of ProjectWiki). :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if comment is not None: query_parameters['comment'] = self._serialize.query('comment', comment, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options response = self._send(http_method='DELETE', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.1', route_values=route_values, query_parameters=query_parameters) response_object = models.WikiPageResponse() response_object.page = self._deserialize('WikiPage', response) response_object.eTag = response.headers.get('ETag') return response_object def get_page(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None): """GetPage. Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.1', route_values=route_values, query_parameters=query_parameters) response_object = models.WikiPageResponse() response_object.page = self._deserialize('WikiPage', response) response_object.eTag = response.headers.get('ETag') return response_object def get_page_text(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetPageText. Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_page_zip(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetPageZip. Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def create_wiki(self, wiki_create_params, project=None): """CreateWiki. Creates the wiki resource. :param :class:` ` wiki_create_params: Parameters for the wiki creation. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(wiki_create_params, 'WikiCreateParametersV2') response = self._send(http_method='POST', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.1', route_values=route_values, content=content) return self._deserialize('WikiV2', response) def delete_wiki(self, wiki_identifier, project=None): """DeleteWiki. Deletes the wiki corresponding to the wiki name or Id provided. :param str wiki_identifier: Wiki name or Id. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') response = self._send(http_method='DELETE', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.1', route_values=route_values) return self._deserialize('WikiV2', response) def get_all_wikis(self, project=None): """GetAllWikis. Gets all wikis in a project or collection. :param str project: Project ID or project name :rtype: [WikiV2] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.1', route_values=route_values) return self._deserialize('[WikiV2]', self._unwrap_collection(response)) def get_wiki(self, wiki_identifier, project=None): """GetWiki. Gets the wiki corresponding to the wiki name or Id provided. :param str wiki_identifier: Wiki name or id. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') response = self._send(http_method='GET', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.1', route_values=route_values) return self._deserialize('WikiV2', response) def update_wiki(self, update_parameters, wiki_identifier, project=None): """UpdateWiki. Updates the wiki corresponding to the wiki Id or name provided using the update parameters. :param :class:` ` update_parameters: Update parameters. :param str wiki_identifier: Wiki name or Id. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') content = self._serialize.body(update_parameters, 'WikiUpdateParameters') response = self._send(http_method='PATCH', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.1', route_values=route_values, content=content) return self._deserialize('WikiV2', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/work/000077500000000000000000000000001360605530400310525ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/work/__init__.py000066400000000000000000000044661360605530400331750ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.work.models import * from .work_client import WorkClient __all__ = [ 'Activity', 'BacklogColumn', 'BacklogConfiguration', 'BacklogFields', 'BacklogLevel', 'BacklogLevelConfiguration', 'BacklogLevelWorkItems', 'Board', 'BoardBadge', 'BoardCardRuleSettings', 'BoardCardSettings', 'BoardChart', 'BoardChartReference', 'BoardColumn', 'BoardFields', 'BoardReference', 'BoardRow', 'BoardSuggestedValue', 'BoardUserSettings', 'CapacityContractBase', 'CapacityPatch', 'CategoryConfiguration', 'CreatePlan', 'DateRange', 'DeliveryViewData', 'FieldReference', 'FilterClause', 'GraphSubjectBase', 'IdentityRef', 'IterationWorkItems', 'Link', 'Member', 'ParentChildWIMap', 'Plan', 'PlanViewData', 'PredefinedQuery', 'ProcessConfiguration', 'ReferenceLinks', 'ReorderOperation', 'ReorderResult', 'Rule', 'TeamContext', 'TeamFieldValue', 'TeamFieldValues', 'TeamFieldValuesPatch', 'TeamIterationAttributes', 'TeamMemberCapacity', 'TeamMemberCapacityIdentityRef', 'TeamSetting', 'TeamSettingsDataContractBase', 'TeamSettingsDaysOff', 'TeamSettingsDaysOffPatch', 'TeamSettingsIteration', 'TeamSettingsPatch', 'TimelineCriteriaStatus', 'TimelineIterationStatus', 'TimelineTeamData', 'TimelineTeamIteration', 'TimelineTeamStatus', 'UpdatePlan', 'WorkItem', 'WorkItemColor', 'WorkItemCommentVersionRef', 'WorkItemFieldReference', 'WorkItemLink', 'WorkItemReference', 'WorkItemRelation', 'WorkItemTrackingResource', 'WorkItemTrackingResourceReference', 'WorkItemTypeReference', 'WorkItemTypeStateInfo', 'WorkClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/work/work_client.py000066400000000000000000001477171360605530400337650ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.work import models class WorkClient(Client): """Work :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(WorkClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '1d4f49f9-02b9-4e26-b826-2cdb6195f2a9' def get_backlog_configurations(self, team_context): """GetBacklogConfigurations. Gets backlog configuration for a team :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='7799f497-3cb5-4f16-ad4f-5cd06012db64', version='5.1', route_values=route_values) return self._deserialize('BacklogConfiguration', response) def get_column_suggested_values(self, project=None): """GetColumnSuggestedValues. Get available board columns in a project :param str project: Project ID or project name :rtype: [BoardSuggestedValue] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='eb7ec5a3-1ba3-4fd1-b834-49a5a387e57d', version='5.1', route_values=route_values) return self._deserialize('[BoardSuggestedValue]', self._unwrap_collection(response)) def get_row_suggested_values(self, project=None): """GetRowSuggestedValues. Get available board rows in a project :param str project: Project ID or project name :rtype: [BoardSuggestedValue] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='bb494cc6-a0f5-4c6c-8dca-ea6912e79eb9', version='5.1', route_values=route_values) return self._deserialize('[BoardSuggestedValue]', self._unwrap_collection(response)) def get_board(self, team_context, id): """GetBoard. Get board :param :class:` ` team_context: The team context for the operation :param str id: identifier for board, either board's backlog level name (Eg:"Stories") or Id :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='23ad19fc-3b8e-4877-8462-b3f92bc06b40', version='5.1', route_values=route_values) return self._deserialize('Board', response) def get_boards(self, team_context): """GetBoards. Get boards :param :class:` ` team_context: The team context for the operation :rtype: [BoardReference] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='23ad19fc-3b8e-4877-8462-b3f92bc06b40', version='5.1', route_values=route_values) return self._deserialize('[BoardReference]', self._unwrap_collection(response)) def set_board_options(self, options, team_context, id): """SetBoardOptions. Update board options :param {str} options: options to updated :param :class:` ` team_context: The team context for the operation :param str id: identifier for board, either category plural name (Eg:"Stories") or guid :rtype: {str} """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') content = self._serialize.body(options, '{str}') response = self._send(http_method='PUT', location_id='23ad19fc-3b8e-4877-8462-b3f92bc06b40', version='5.1', route_values=route_values, content=content) return self._deserialize('{str}', self._unwrap_collection(response)) def get_capacities_with_identity_ref(self, team_context, iteration_id): """GetCapacitiesWithIdentityRef. Get a team's capacity :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: [TeamMemberCapacityIdentityRef] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') response = self._send(http_method='GET', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', version='5.1', route_values=route_values) return self._deserialize('[TeamMemberCapacityIdentityRef]', self._unwrap_collection(response)) def get_capacity_with_identity_ref(self, team_context, iteration_id, team_member_id): """GetCapacityWithIdentityRef. Get a team member's capacity :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :param str team_member_id: ID of the team member :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') if team_member_id is not None: route_values['teamMemberId'] = self._serialize.url('team_member_id', team_member_id, 'str') response = self._send(http_method='GET', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', version='5.1', route_values=route_values) return self._deserialize('TeamMemberCapacityIdentityRef', response) def replace_capacities_with_identity_ref(self, capacities, team_context, iteration_id): """ReplaceCapacitiesWithIdentityRef. Replace a team's capacity :param [TeamMemberCapacityIdentityRef] capacities: Team capacity to replace :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: [TeamMemberCapacityIdentityRef] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') content = self._serialize.body(capacities, '[TeamMemberCapacityIdentityRef]') response = self._send(http_method='PUT', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', version='5.1', route_values=route_values, content=content) return self._deserialize('[TeamMemberCapacityIdentityRef]', self._unwrap_collection(response)) def update_capacity_with_identity_ref(self, patch, team_context, iteration_id, team_member_id): """UpdateCapacityWithIdentityRef. Update a team member's capacity :param :class:` ` patch: Updated capacity :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :param str team_member_id: ID of the team member :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') if team_member_id is not None: route_values['teamMemberId'] = self._serialize.url('team_member_id', team_member_id, 'str') content = self._serialize.body(patch, 'CapacityPatch') response = self._send(http_method='PATCH', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', version='5.1', route_values=route_values, content=content) return self._deserialize('TeamMemberCapacityIdentityRef', response) def get_board_card_rule_settings(self, team_context, board): """GetBoardCardRuleSettings. Get board card Rule settings for the board id or board by name :param :class:` ` team_context: The team context for the operation :param str board: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='b044a3d9-02ea-49c7-91a1-b730949cc896', version='5.1', route_values=route_values) return self._deserialize('BoardCardRuleSettings', response) def update_board_card_rule_settings(self, board_card_rule_settings, team_context, board): """UpdateBoardCardRuleSettings. Update board card Rule settings for the board id or board by name :param :class:` ` board_card_rule_settings: :param :class:` ` team_context: The team context for the operation :param str board: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') content = self._serialize.body(board_card_rule_settings, 'BoardCardRuleSettings') response = self._send(http_method='PATCH', location_id='b044a3d9-02ea-49c7-91a1-b730949cc896', version='5.1', route_values=route_values, content=content) return self._deserialize('BoardCardRuleSettings', response) def get_board_card_settings(self, team_context, board): """GetBoardCardSettings. Get board card settings for the board id or board by name :param :class:` ` team_context: The team context for the operation :param str board: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='07c3b467-bc60-4f05-8e34-599ce288fafc', version='5.1', route_values=route_values) return self._deserialize('BoardCardSettings', response) def update_board_card_settings(self, board_card_settings_to_save, team_context, board): """UpdateBoardCardSettings. Update board card settings for the board id or board by name :param :class:` ` board_card_settings_to_save: :param :class:` ` team_context: The team context for the operation :param str board: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') content = self._serialize.body(board_card_settings_to_save, 'BoardCardSettings') response = self._send(http_method='PUT', location_id='07c3b467-bc60-4f05-8e34-599ce288fafc', version='5.1', route_values=route_values, content=content) return self._deserialize('BoardCardSettings', response) def get_board_chart(self, team_context, board, name): """GetBoardChart. Get a board chart :param :class:` ` team_context: The team context for the operation :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id :param str name: The chart name :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', version='5.1', route_values=route_values) return self._deserialize('BoardChart', response) def get_board_charts(self, team_context, board): """GetBoardCharts. Get board charts :param :class:` ` team_context: The team context for the operation :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id :rtype: [BoardChartReference] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', version='5.1', route_values=route_values) return self._deserialize('[BoardChartReference]', self._unwrap_collection(response)) def update_board_chart(self, chart, team_context, board, name): """UpdateBoardChart. Update a board chart :param :class:` ` chart: :param :class:` ` team_context: The team context for the operation :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id :param str name: The chart name :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') content = self._serialize.body(chart, 'BoardChart') response = self._send(http_method='PATCH', location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', version='5.1', route_values=route_values, content=content) return self._deserialize('BoardChart', response) def get_board_columns(self, team_context, board): """GetBoardColumns. Get columns on a board :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardColumn] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='c555d7ff-84e1-47df-9923-a3fe0cd8751b', version='5.1', route_values=route_values) return self._deserialize('[BoardColumn]', self._unwrap_collection(response)) def update_board_columns(self, board_columns, team_context, board): """UpdateBoardColumns. Update columns on a board :param [BoardColumn] board_columns: List of board columns to update :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardColumn] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') content = self._serialize.body(board_columns, '[BoardColumn]') response = self._send(http_method='PUT', location_id='c555d7ff-84e1-47df-9923-a3fe0cd8751b', version='5.1', route_values=route_values, content=content) return self._deserialize('[BoardColumn]', self._unwrap_collection(response)) def get_delivery_timeline_data(self, project, id, revision=None, start_date=None, end_date=None): """GetDeliveryTimelineData. Get Delivery View Data :param str project: Project ID or project name :param str id: Identifier for delivery view :param int revision: Revision of the plan for which you want data. If the current plan is a different revision you will get an ViewRevisionMismatchException exception. If you do not supply a revision you will get data for the latest revision. :param datetime start_date: The start date of timeline :param datetime end_date: The end date of timeline :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if revision is not None: query_parameters['revision'] = self._serialize.query('revision', revision, 'int') if start_date is not None: query_parameters['startDate'] = self._serialize.query('start_date', start_date, 'iso-8601') if end_date is not None: query_parameters['endDate'] = self._serialize.query('end_date', end_date, 'iso-8601') response = self._send(http_method='GET', location_id='bdd0834e-101f-49f0-a6ae-509f384a12b4', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('DeliveryViewData', response) def delete_team_iteration(self, team_context, id): """DeleteTeamIteration. Delete a team's iteration by iterationId :param :class:` ` team_context: The team context for the operation :param str id: ID of the iteration """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') self._send(http_method='DELETE', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', version='5.1', route_values=route_values) def get_team_iteration(self, team_context, id): """GetTeamIteration. Get team's iteration by iterationId :param :class:` ` team_context: The team context for the operation :param str id: ID of the iteration :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', version='5.1', route_values=route_values) return self._deserialize('TeamSettingsIteration', response) def get_team_iterations(self, team_context, timeframe=None): """GetTeamIterations. Get a team's iterations using timeframe filter :param :class:` ` team_context: The team context for the operation :param str timeframe: A filter for which iterations are returned based on relative time. Only Current is supported currently. :rtype: [TeamSettingsIteration] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') query_parameters = {} if timeframe is not None: query_parameters['$timeframe'] = self._serialize.query('timeframe', timeframe, 'str') response = self._send(http_method='GET', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TeamSettingsIteration]', self._unwrap_collection(response)) def post_team_iteration(self, iteration, team_context): """PostTeamIteration. Add an iteration to the team :param :class:` ` iteration: Iteration to add :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(iteration, 'TeamSettingsIteration') response = self._send(http_method='POST', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', version='5.1', route_values=route_values, content=content) return self._deserialize('TeamSettingsIteration', response) def create_plan(self, posted_plan, project): """CreatePlan. Add a new plan for the team :param :class:` ` posted_plan: Plan definition :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(posted_plan, 'CreatePlan') response = self._send(http_method='POST', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.1', route_values=route_values, content=content) return self._deserialize('Plan', response) def delete_plan(self, project, id): """DeletePlan. Delete the specified plan :param str project: Project ID or project name :param str id: Identifier of the plan """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') self._send(http_method='DELETE', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.1', route_values=route_values) def get_plan(self, project, id): """GetPlan. Get the information for the specified plan :param str project: Project ID or project name :param str id: Identifier of the plan :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.1', route_values=route_values) return self._deserialize('Plan', response) def get_plans(self, project): """GetPlans. Get the information for all the plans configured for the given team :param str project: Project ID or project name :rtype: [Plan] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.1', route_values=route_values) return self._deserialize('[Plan]', self._unwrap_collection(response)) def update_plan(self, updated_plan, project, id): """UpdatePlan. Update the information for the specified plan :param :class:` ` updated_plan: Plan definition to be updated :param str project: Project ID or project name :param str id: Identifier of the plan :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') content = self._serialize.body(updated_plan, 'UpdatePlan') response = self._send(http_method='PUT', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.1', route_values=route_values, content=content) return self._deserialize('Plan', response) def get_board_rows(self, team_context, board): """GetBoardRows. Get rows on a board :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardRow] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='0863355d-aefd-4d63-8669-984c9b7b0e78', version='5.1', route_values=route_values) return self._deserialize('[BoardRow]', self._unwrap_collection(response)) def update_board_rows(self, board_rows, team_context, board): """UpdateBoardRows. Update rows on a board :param [BoardRow] board_rows: List of board rows to update :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardRow] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') content = self._serialize.body(board_rows, '[BoardRow]') response = self._send(http_method='PUT', location_id='0863355d-aefd-4d63-8669-984c9b7b0e78', version='5.1', route_values=route_values, content=content) return self._deserialize('[BoardRow]', self._unwrap_collection(response)) def get_team_days_off(self, team_context, iteration_id): """GetTeamDaysOff. Get team's days off for an iteration :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') response = self._send(http_method='GET', location_id='2d4faa2e-9150-4cbf-a47a-932b1b4a0773', version='5.1', route_values=route_values) return self._deserialize('TeamSettingsDaysOff', response) def update_team_days_off(self, days_off_patch, team_context, iteration_id): """UpdateTeamDaysOff. Set a team's days off for an iteration :param :class:` ` days_off_patch: Team's days off patch containting a list of start and end dates :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') content = self._serialize.body(days_off_patch, 'TeamSettingsDaysOffPatch') response = self._send(http_method='PATCH', location_id='2d4faa2e-9150-4cbf-a47a-932b1b4a0773', version='5.1', route_values=route_values, content=content) return self._deserialize('TeamSettingsDaysOff', response) def get_team_field_values(self, team_context): """GetTeamFieldValues. Get a collection of team field values :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='07ced576-58ed-49e6-9c1e-5cb53ab8bf2a', version='5.1', route_values=route_values) return self._deserialize('TeamFieldValues', response) def update_team_field_values(self, patch, team_context): """UpdateTeamFieldValues. Update team field values :param :class:` ` patch: :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(patch, 'TeamFieldValuesPatch') response = self._send(http_method='PATCH', location_id='07ced576-58ed-49e6-9c1e-5cb53ab8bf2a', version='5.1', route_values=route_values, content=content) return self._deserialize('TeamFieldValues', response) def get_team_settings(self, team_context): """GetTeamSettings. Get a team's settings :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='c3c1012b-bea7-49d7-b45e-1664e566f84c', version='5.1', route_values=route_values) return self._deserialize('TeamSetting', response) def update_team_settings(self, team_settings_patch, team_context): """UpdateTeamSettings. Update a team's settings :param :class:` ` team_settings_patch: TeamSettings changes :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(team_settings_patch, 'TeamSettingsPatch') response = self._send(http_method='PATCH', location_id='c3c1012b-bea7-49d7-b45e-1664e566f84c', version='5.1', route_values=route_values, content=content) return self._deserialize('TeamSetting', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/work_item_tracking/000077500000000000000000000000001360605530400337525ustar00rootroot00000000000000__init__.py000066400000000000000000000056021360605530400360070ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/work_item_tracking# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from ...v5_1.work_item_tracking.models import * from .work_item_tracking_client import WorkItemTrackingClient __all__ = [ 'AccountMyWorkResult', 'AccountRecentActivityWorkItemModel', 'AccountRecentActivityWorkItemModel2', 'AccountRecentActivityWorkItemModelBase', 'AccountRecentMentionWorkItemModel', 'AccountWorkWorkItemModel', 'ArtifactUriQuery', 'ArtifactUriQueryResult', 'AttachmentReference', 'Comment', 'CommentCreate', 'CommentList', 'CommentMention', 'CommentReaction', 'CommentUpdate', 'CommentVersion', 'FieldDependentRule', 'FieldsToEvaluate', 'GraphSubjectBase', 'IdentityRef', 'IdentityReference', 'JsonPatchOperation', 'Link', 'ProjectWorkItemStateColors', 'ProvisioningResult', 'QueryBatchGetRequest', 'QueryHierarchyItem', 'QueryHierarchyItemsResult', 'ReferenceLinks', 'ReportingWorkItemLinksBatch', 'ReportingWorkItemRevisionsBatch', 'ReportingWorkItemRevisionsFilter', 'StreamedBatch', 'TeamContext', 'Wiql', 'WorkArtifactLink', 'WorkItem', 'WorkItemBatchGetRequest', 'WorkItemClassificationNode', 'WorkItemComment', 'WorkItemComments', 'WorkItemCommentVersionRef', 'WorkItemDelete', 'WorkItemDeleteReference', 'WorkItemDeleteShallowReference', 'WorkItemDeleteUpdate', 'WorkItemField', 'WorkItemFieldOperation', 'WorkItemFieldReference', 'WorkItemFieldUpdate', 'WorkItemHistory', 'WorkItemIcon', 'WorkItemLink', 'WorkItemNextStateOnTransition', 'WorkItemQueryClause', 'WorkItemQueryResult', 'WorkItemQuerySortColumn', 'WorkItemReference', 'WorkItemRelation', 'WorkItemRelationType', 'WorkItemRelationUpdates', 'WorkItemStateColor', 'WorkItemStateTransition', 'WorkItemTemplate', 'WorkItemTemplateReference', 'WorkItemTrackingReference', 'WorkItemTrackingResource', 'WorkItemTrackingResourceReference', 'WorkItemType', 'WorkItemTypeCategory', 'WorkItemTypeColor', 'WorkItemTypeColorAndIcon', 'WorkItemTypeFieldInstance', 'WorkItemTypeFieldInstanceBase', 'WorkItemTypeFieldWithReferences', 'WorkItemTypeReference', 'WorkItemTypeStateColors', 'WorkItemTypeTemplate', 'WorkItemTypeTemplateUpdateModel', 'WorkItemUpdate', 'WorkItemTrackingClient' ] work_item_tracking_client.py000066400000000000000000002301741360605530400414740ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/released/work_item_tracking# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from ...v5_1.work_item_tracking import models class WorkItemTrackingClient(Client): """WorkItemTracking :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(WorkItemTrackingClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '5264459e-e5e0-4bd8-b118-0985e68a4ec5' def create_attachment(self, upload_stream, project=None, file_name=None, upload_type=None, area_path=None, **kwargs): """CreateAttachment. Uploads an attachment. :param object upload_stream: Stream to upload :param str project: Project ID or project name :param str file_name: The name of the file :param str upload_type: Attachment upload type: Simple or Chunked :param str area_path: Target project Area Path :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if upload_type is not None: query_parameters['uploadType'] = self._serialize.query('upload_type', upload_type, 'str') if area_path is not None: query_parameters['areaPath'] = self._serialize.query('area_path', area_path, 'str') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/octet-stream') return self._deserialize('AttachmentReference', response) def get_attachment_content(self, id, project=None, file_name=None, download=None, **kwargs): """GetAttachmentContent. Downloads an attachment. :param str id: Attachment ID :param str project: Project ID or project name :param str file_name: Name of the file :param bool download: If set to true always download attachment :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') response = self._send(http_method='GET', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_attachment_zip(self, id, project=None, file_name=None, download=None, **kwargs): """GetAttachmentZip. Downloads an attachment. :param str id: Attachment ID :param str project: Project ID or project name :param str file_name: Name of the file :param bool download: If set to true always download attachment :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') response = self._send(http_method='GET', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_classification_nodes(self, project, ids, depth=None, error_policy=None): """GetClassificationNodes. Gets root classification nodes or list of classification nodes for a given list of nodes ids, for a given project. In case ids parameter is supplied you will get list of classification nodes for those ids. Otherwise you will get root classification nodes for this project. :param str project: Project ID or project name :param [int] ids: Comma separated integer classification nodes ids. It's not required, if you want root nodes. :param int depth: Depth of children to fetch. :param str error_policy: Flag to handle errors in getting some nodes. Possible options are Fail and Omit. :rtype: [WorkItemClassificationNode] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if ids is not None: ids = ",".join(map(str, ids)) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') if error_policy is not None: query_parameters['errorPolicy'] = self._serialize.query('error_policy', error_policy, 'str') response = self._send(http_method='GET', location_id='a70579d1-f53a-48ee-a5be-7be8659023b9', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemClassificationNode]', self._unwrap_collection(response)) def get_root_nodes(self, project, depth=None): """GetRootNodes. Gets root classification nodes under the project. :param str project: Project ID or project name :param int depth: Depth of children to fetch. :rtype: [WorkItemClassificationNode] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') response = self._send(http_method='GET', location_id='a70579d1-f53a-48ee-a5be-7be8659023b9', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemClassificationNode]', self._unwrap_collection(response)) def create_or_update_classification_node(self, posted_node, project, structure_group, path=None): """CreateOrUpdateClassificationNode. Create new or update an existing classification node. :param :class:` ` posted_node: Node to create or update. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if structure_group is not None: route_values['structureGroup'] = self._serialize.url('structure_group', structure_group, 'TreeStructureGroup') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') content = self._serialize.body(posted_node, 'WorkItemClassificationNode') response = self._send(http_method='POST', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', version='5.1', route_values=route_values, content=content) return self._deserialize('WorkItemClassificationNode', response) def delete_classification_node(self, project, structure_group, path=None, reclassify_id=None): """DeleteClassificationNode. Delete an existing classification node. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. :param int reclassify_id: Id of the target classification node for reclassification. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if structure_group is not None: route_values['structureGroup'] = self._serialize.url('structure_group', structure_group, 'TreeStructureGroup') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') query_parameters = {} if reclassify_id is not None: query_parameters['$reclassifyId'] = self._serialize.query('reclassify_id', reclassify_id, 'int') self._send(http_method='DELETE', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', version='5.1', route_values=route_values, query_parameters=query_parameters) def get_classification_node(self, project, structure_group, path=None, depth=None): """GetClassificationNode. Gets the classification node for a given node path. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. :param int depth: Depth of children to fetch. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if structure_group is not None: route_values['structureGroup'] = self._serialize.url('structure_group', structure_group, 'TreeStructureGroup') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') query_parameters = {} if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') response = self._send(http_method='GET', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemClassificationNode', response) def update_classification_node(self, posted_node, project, structure_group, path=None): """UpdateClassificationNode. Update an existing classification node. :param :class:` ` posted_node: Node to create or update. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if structure_group is not None: route_values['structureGroup'] = self._serialize.url('structure_group', structure_group, 'TreeStructureGroup') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') content = self._serialize.body(posted_node, 'WorkItemClassificationNode') response = self._send(http_method='PATCH', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', version='5.1', route_values=route_values, content=content) return self._deserialize('WorkItemClassificationNode', response) def create_field(self, work_item_field, project=None): """CreateField. Create a new field. :param :class:` ` work_item_field: New field definition :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(work_item_field, 'WorkItemField') response = self._send(http_method='POST', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', version='5.1', route_values=route_values, content=content) return self._deserialize('WorkItemField', response) def delete_field(self, field_name_or_ref_name, project=None): """DeleteField. Deletes the field. :param str field_name_or_ref_name: Field simple name or reference name :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if field_name_or_ref_name is not None: route_values['fieldNameOrRefName'] = self._serialize.url('field_name_or_ref_name', field_name_or_ref_name, 'str') self._send(http_method='DELETE', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', version='5.1', route_values=route_values) def get_field(self, field_name_or_ref_name, project=None): """GetField. Gets information on a specific field. :param str field_name_or_ref_name: Field simple name or reference name :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if field_name_or_ref_name is not None: route_values['fieldNameOrRefName'] = self._serialize.url('field_name_or_ref_name', field_name_or_ref_name, 'str') response = self._send(http_method='GET', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', version='5.1', route_values=route_values) return self._deserialize('WorkItemField', response) def get_fields(self, project=None, expand=None): """GetFields. Returns information for all fields. :param str project: Project ID or project name :param str expand: Use ExtensionFields to include extension fields, otherwise exclude them. Unless the feature flag for this parameter is enabled, extension fields are always included. :rtype: [WorkItemField] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemField]', self._unwrap_collection(response)) def create_query(self, posted_query, project, query, validate_wiql_only=None): """CreateQuery. Creates a query, or moves a query. :param :class:` ` posted_query: The query to create. :param str project: Project ID or project name :param str query: The parent id or path under which the query is to be created. :param bool validate_wiql_only: If you only want to validate your WIQL query without actually creating one, set it to true. Default is false. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if query is not None: route_values['query'] = self._serialize.url('query', query, 'str') query_parameters = {} if validate_wiql_only is not None: query_parameters['validateWiqlOnly'] = self._serialize.query('validate_wiql_only', validate_wiql_only, 'bool') content = self._serialize.body(posted_query, 'QueryHierarchyItem') response = self._send(http_method='POST', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('QueryHierarchyItem', response) def delete_query(self, project, query): """DeleteQuery. Delete a query or a folder. This deletes any permission change on the deleted query or folder and any of its descendants if it is a folder. It is important to note that the deleted permission changes cannot be recovered upon undeleting the query or folder. :param str project: Project ID or project name :param str query: ID or path of the query or folder to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if query is not None: route_values['query'] = self._serialize.url('query', query, 'str') self._send(http_method='DELETE', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.1', route_values=route_values) def get_queries(self, project, expand=None, depth=None, include_deleted=None): """GetQueries. Gets the root queries and their children :param str project: Project ID or project name :param str expand: Include the query string (wiql), clauses, query result columns, and sort options in the results. :param int depth: In the folder of queries, return child queries and folders to this depth. :param bool include_deleted: Include deleted queries and folders :rtype: [QueryHierarchyItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') if include_deleted is not None: query_parameters['$includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') response = self._send(http_method='GET', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[QueryHierarchyItem]', self._unwrap_collection(response)) def get_query(self, project, query, expand=None, depth=None, include_deleted=None): """GetQuery. Retrieves an individual query and its children :param str project: Project ID or project name :param str query: ID or path of the query. :param str expand: Include the query string (wiql), clauses, query result columns, and sort options in the results. :param int depth: In the folder of queries, return child queries and folders to this depth. :param bool include_deleted: Include deleted queries and folders :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if query is not None: route_values['query'] = self._serialize.url('query', query, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') if include_deleted is not None: query_parameters['$includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') response = self._send(http_method='GET', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('QueryHierarchyItem', response) def search_queries(self, project, filter, top=None, expand=None, include_deleted=None): """SearchQueries. Searches all queries the user has access to in the current project :param str project: Project ID or project name :param str filter: The text to filter the queries with. :param int top: The number of queries to return (Default is 50 and maximum is 200). :param str expand: :param bool include_deleted: Include deleted queries and folders :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query('filter', filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if include_deleted is not None: query_parameters['$includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') response = self._send(http_method='GET', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('QueryHierarchyItemsResult', response) def update_query(self, query_update, project, query, undelete_descendants=None): """UpdateQuery. Update a query or a folder. This allows you to update, rename and move queries and folders. :param :class:` ` query_update: The query to update. :param str project: Project ID or project name :param str query: The ID or path for the query to update. :param bool undelete_descendants: Undelete the children of this folder. It is important to note that this will not bring back the permission changes that were previously applied to the descendants. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if query is not None: route_values['query'] = self._serialize.url('query', query, 'str') query_parameters = {} if undelete_descendants is not None: query_parameters['$undeleteDescendants'] = self._serialize.query('undelete_descendants', undelete_descendants, 'bool') content = self._serialize.body(query_update, 'QueryHierarchyItem') response = self._send(http_method='PATCH', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('QueryHierarchyItem', response) def get_queries_batch(self, query_get_request, project): """GetQueriesBatch. Gets a list of queries by ids (Maximum 1000) :param :class:` ` query_get_request: :param str project: Project ID or project name :rtype: [QueryHierarchyItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(query_get_request, 'QueryBatchGetRequest') response = self._send(http_method='POST', location_id='549816f9-09b0-4e75-9e81-01fbfcd07426', version='5.1', route_values=route_values, content=content) return self._deserialize('[QueryHierarchyItem]', self._unwrap_collection(response)) def destroy_work_item(self, id, project=None): """DestroyWorkItem. Destroys the specified work item permanently from the Recycle Bin. This action can not be undone. :param int id: ID of the work item to be destroyed permanently :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') self._send(http_method='DELETE', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.1', route_values=route_values) def get_deleted_work_item(self, id, project=None): """GetDeletedWorkItem. Gets a deleted work item from Recycle Bin. :param int id: ID of the work item to be returned :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') response = self._send(http_method='GET', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.1', route_values=route_values) return self._deserialize('WorkItemDelete', response) def get_deleted_work_items(self, ids, project=None): """GetDeletedWorkItems. Gets the work items from the recycle bin, whose IDs have been specified in the parameters :param [int] ids: Comma separated list of IDs of the deleted work items to be returned :param str project: Project ID or project name :rtype: [WorkItemDeleteReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if ids is not None: ids = ",".join(map(str, ids)) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') response = self._send(http_method='GET', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemDeleteReference]', self._unwrap_collection(response)) def get_deleted_work_item_shallow_references(self, project=None): """GetDeletedWorkItemShallowReferences. Gets a list of the IDs and the URLs of the deleted the work items in the Recycle Bin. :param str project: Project ID or project name :rtype: [WorkItemDeleteShallowReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.1', route_values=route_values) return self._deserialize('[WorkItemDeleteShallowReference]', self._unwrap_collection(response)) def restore_work_item(self, payload, id, project=None): """RestoreWorkItem. Restores the deleted work item from Recycle Bin. :param :class:` ` payload: Paylod with instructions to update the IsDeleted flag to false :param int id: ID of the work item to be restored :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') content = self._serialize.body(payload, 'WorkItemDeleteUpdate') response = self._send(http_method='PATCH', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.1', route_values=route_values, content=content) return self._deserialize('WorkItemDelete', response) def get_revision(self, id, revision_number, project=None, expand=None): """GetRevision. Returns a fully hydrated work item for the requested revision :param int id: :param int revision_number: :param str project: Project ID or project name :param str expand: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') if revision_number is not None: route_values['revisionNumber'] = self._serialize.url('revision_number', revision_number, 'int') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) def get_revisions(self, id, project=None, top=None, skip=None, expand=None): """GetRevisions. Returns the list of fully hydrated work item revisions, paged. :param int id: :param str project: Project ID or project name :param int top: :param int skip: :param str expand: :rtype: [WorkItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItem]', self._unwrap_collection(response)) def get_update(self, id, update_number, project=None): """GetUpdate. Returns a single update for a work item :param int id: :param int update_number: :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') if update_number is not None: route_values['updateNumber'] = self._serialize.url('update_number', update_number, 'int') response = self._send(http_method='GET', location_id='6570bf97-d02c-4a91-8d93-3abe9895b1a9', version='5.1', route_values=route_values) return self._deserialize('WorkItemUpdate', response) def get_updates(self, id, project=None, top=None, skip=None): """GetUpdates. Returns a the deltas between work item revisions :param int id: :param str project: Project ID or project name :param int top: :param int skip: :rtype: [WorkItemUpdate] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='6570bf97-d02c-4a91-8d93-3abe9895b1a9', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemUpdate]', self._unwrap_collection(response)) def query_by_wiql(self, wiql, team_context=None, time_precision=None, top=None): """QueryByWiql. Gets the results of the query given its WIQL. :param :class:` ` wiql: The query containing the WIQL. :param :class:` ` team_context: The team context for the operation :param bool time_precision: Whether or not to use time precision. :param int top: The max number of results to return. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') query_parameters = {} if time_precision is not None: query_parameters['timePrecision'] = self._serialize.query('time_precision', time_precision, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') content = self._serialize.body(wiql, 'Wiql') response = self._send(http_method='POST', location_id='1a9c53f7-f243-4447-b110-35ef023636e4', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('WorkItemQueryResult', response) def get_query_result_count(self, id, team_context=None, time_precision=None, top=None): """GetQueryResultCount. Gets the results of the query given the query ID. :param str id: The query ID. :param :class:` ` team_context: The team context for the operation :param bool time_precision: Whether or not to use time precision. :param int top: The max number of results to return. :rtype: int """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if time_precision is not None: query_parameters['timePrecision'] = self._serialize.query('time_precision', time_precision, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='HEAD', location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('int', response) def query_by_id(self, id, team_context=None, time_precision=None, top=None): """QueryById. Gets the results of the query given the query ID. :param str id: The query ID. :param :class:` ` team_context: The team context for the operation :param bool time_precision: Whether or not to use time precision. :param int top: The max number of results to return. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if time_precision is not None: query_parameters['timePrecision'] = self._serialize.query('time_precision', time_precision, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemQueryResult', response) def get_work_item_icon_json(self, icon, color=None, v=None): """GetWorkItemIconJson. Get a work item icon given the friendly name and icon color. :param str icon: The name of the icon :param str color: The 6-digit hex color for the icon :param int v: The version of the icon (used only for cache invalidation) :rtype: :class:` ` """ route_values = {} if icon is not None: route_values['icon'] = self._serialize.url('icon', icon, 'str') query_parameters = {} if color is not None: query_parameters['color'] = self._serialize.query('color', color, 'str') if v is not None: query_parameters['v'] = self._serialize.query('v', v, 'int') response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemIcon', response) def get_work_item_icons(self): """GetWorkItemIcons. Get a list of all work item icons. :rtype: [WorkItemIcon] """ response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', version='5.1') return self._deserialize('[WorkItemIcon]', self._unwrap_collection(response)) def get_work_item_icon_svg(self, icon, color=None, v=None, **kwargs): """GetWorkItemIconSvg. Get a work item icon given the friendly name and icon color. :param str icon: The name of the icon :param str color: The 6-digit hex color for the icon :param int v: The version of the icon (used only for cache invalidation) :rtype: object """ route_values = {} if icon is not None: route_values['icon'] = self._serialize.url('icon', icon, 'str') query_parameters = {} if color is not None: query_parameters['color'] = self._serialize.query('color', color, 'str') if v is not None: query_parameters['v'] = self._serialize.query('v', v, 'int') response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='image/svg+xml') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_work_item_icon_xaml(self, icon, color=None, v=None, **kwargs): """GetWorkItemIconXaml. Get a work item icon given the friendly name and icon color. :param str icon: The name of the icon :param str color: The 6-digit hex color for the icon :param int v: The version of the icon (used only for cache invalidation) :rtype: object """ route_values = {} if icon is not None: route_values['icon'] = self._serialize.url('icon', icon, 'str') query_parameters = {} if color is not None: query_parameters['color'] = self._serialize.query('color', color, 'str') if v is not None: query_parameters['v'] = self._serialize.query('v', v, 'int') response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='image/xaml+xml') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_reporting_links_by_link_type(self, project=None, link_types=None, types=None, continuation_token=None, start_date_time=None): """GetReportingLinksByLinkType. Get a batch of work item links :param str project: Project ID or project name :param [str] link_types: A list of types to filter the results to specific link types. Omit this parameter to get work item links of all link types. :param [str] types: A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. :param str continuation_token: Specifies the continuationToken to start the batch from. Omit this parameter to get the first batch of links. :param datetime start_date_time: Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if link_types is not None: link_types = ",".join(link_types) query_parameters['linkTypes'] = self._serialize.query('link_types', link_types, 'str') if types is not None: types = ",".join(types) query_parameters['types'] = self._serialize.query('types', types, 'str') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if start_date_time is not None: query_parameters['startDateTime'] = self._serialize.query('start_date_time', start_date_time, 'iso-8601') response = self._send(http_method='GET', location_id='b5b5b6d0-0308-40a1-b3f4-b9bb3c66878f', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReportingWorkItemLinksBatch', response) def get_relation_type(self, relation): """GetRelationType. Gets the work item relation type definition. :param str relation: The relation name :rtype: :class:` ` """ route_values = {} if relation is not None: route_values['relation'] = self._serialize.url('relation', relation, 'str') response = self._send(http_method='GET', location_id='f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165', version='5.1', route_values=route_values) return self._deserialize('WorkItemRelationType', response) def get_relation_types(self): """GetRelationTypes. Gets the work item relation types. :rtype: [WorkItemRelationType] """ response = self._send(http_method='GET', location_id='f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165', version='5.1') return self._deserialize('[WorkItemRelationType]', self._unwrap_collection(response)) def read_reporting_revisions_get(self, project=None, fields=None, types=None, continuation_token=None, start_date_time=None, include_identity_ref=None, include_deleted=None, include_tag_ref=None, include_latest_only=None, expand=None, include_discussion_changes_only=None, max_page_size=None): """ReadReportingRevisionsGet. Get a batch of work item revisions with the option of including deleted items :param str project: Project ID or project name :param [str] fields: A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. :param [str] types: A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. :param str continuation_token: Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. :param datetime start_date_time: Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. :param bool include_identity_ref: Return an identity reference instead of a string value for identity fields. :param bool include_deleted: Specify if the deleted item should be returned. :param bool include_tag_ref: Specify if the tag objects should be returned for System.Tags field. :param bool include_latest_only: Return only the latest revisions of work items, skipping all historical revisions :param str expand: Return all the fields in work item revisions, including long text fields which are not returned by default :param bool include_discussion_changes_only: Return only the those revisions of work items, where only history field was changed :param int max_page_size: The maximum number of results to return in this batch :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if fields is not None: fields = ",".join(fields) query_parameters['fields'] = self._serialize.query('fields', fields, 'str') if types is not None: types = ",".join(types) query_parameters['types'] = self._serialize.query('types', types, 'str') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if start_date_time is not None: query_parameters['startDateTime'] = self._serialize.query('start_date_time', start_date_time, 'iso-8601') if include_identity_ref is not None: query_parameters['includeIdentityRef'] = self._serialize.query('include_identity_ref', include_identity_ref, 'bool') if include_deleted is not None: query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') if include_tag_ref is not None: query_parameters['includeTagRef'] = self._serialize.query('include_tag_ref', include_tag_ref, 'bool') if include_latest_only is not None: query_parameters['includeLatestOnly'] = self._serialize.query('include_latest_only', include_latest_only, 'bool') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if include_discussion_changes_only is not None: query_parameters['includeDiscussionChangesOnly'] = self._serialize.query('include_discussion_changes_only', include_discussion_changes_only, 'bool') if max_page_size is not None: query_parameters['$maxPageSize'] = self._serialize.query('max_page_size', max_page_size, 'int') response = self._send(http_method='GET', location_id='f828fe59-dd87-495d-a17c-7a8d6211ca6c', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReportingWorkItemRevisionsBatch', response) def read_reporting_revisions_post(self, filter, project=None, continuation_token=None, start_date_time=None, expand=None): """ReadReportingRevisionsPost. Get a batch of work item revisions. This request may be used if your list of fields is large enough that it may run the URL over the length limit. :param :class:` ` filter: An object that contains request settings: field filter, type filter, identity format :param str project: Project ID or project name :param str continuation_token: Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. :param datetime start_date_time: Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. :param str expand: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if start_date_time is not None: query_parameters['startDateTime'] = self._serialize.query('start_date_time', start_date_time, 'iso-8601') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') content = self._serialize.body(filter, 'ReportingWorkItemRevisionsFilter') response = self._send(http_method='POST', location_id='f828fe59-dd87-495d-a17c-7a8d6211ca6c', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('ReportingWorkItemRevisionsBatch', response) def create_work_item(self, document, project, type, validate_only=None, bypass_rules=None, suppress_notifications=None, expand=None): """CreateWorkItem. Creates a single work item. :param :class:`<[JsonPatchOperation]> ` document: The JSON Patch document representing the work item :param str project: Project ID or project name :param str type: The work item type of the work item to create :param bool validate_only: Indicate if you only want to validate the changes without saving the work item :param bool bypass_rules: Do not enforce the work item type rules on this update :param bool suppress_notifications: Do not fire any notifications for this change :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') query_parameters = {} if validate_only is not None: query_parameters['validateOnly'] = self._serialize.query('validate_only', validate_only, 'bool') if bypass_rules is not None: query_parameters['bypassRules'] = self._serialize.query('bypass_rules', bypass_rules, 'bool') if suppress_notifications is not None: query_parameters['suppressNotifications'] = self._serialize.query('suppress_notifications', suppress_notifications, 'bool') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='POST', location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/json-patch+json') return self._deserialize('WorkItem', response) def get_work_item_template(self, project, type, fields=None, as_of=None, expand=None): """GetWorkItemTemplate. Returns a single work item from a template. :param str project: Project ID or project name :param str type: The work item type name :param str fields: Comma-separated list of requested fields :param datetime as_of: AsOf UTC date time string :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') query_parameters = {} if fields is not None: query_parameters['fields'] = self._serialize.query('fields', fields, 'str') if as_of is not None: query_parameters['asOf'] = self._serialize.query('as_of', as_of, 'iso-8601') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) def delete_work_item(self, id, project=None, destroy=None): """DeleteWorkItem. Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. WARNING: If the destroy parameter is set to true, work items deleted by this command will NOT go to recycle-bin and there is no way to restore/recover them after deletion. It is recommended NOT to use this parameter. If you do, please use this parameter with extreme caution. :param int id: ID of the work item to be deleted :param str project: Project ID or project name :param bool destroy: Optional parameter, if set to true, the work item is deleted permanently. Please note: the destroy action is PERMANENT and cannot be undone. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if destroy is not None: query_parameters['destroy'] = self._serialize.query('destroy', destroy, 'bool') response = self._send(http_method='DELETE', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemDelete', response) def get_work_item(self, id, project=None, fields=None, as_of=None, expand=None): """GetWorkItem. Returns a single work item. :param int id: The work item id :param str project: Project ID or project name :param [str] fields: Comma-separated list of requested fields :param datetime as_of: AsOf UTC date time string :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if fields is not None: fields = ",".join(fields) query_parameters['fields'] = self._serialize.query('fields', fields, 'str') if as_of is not None: query_parameters['asOf'] = self._serialize.query('as_of', as_of, 'iso-8601') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) def get_work_items(self, ids, project=None, fields=None, as_of=None, expand=None, error_policy=None): """GetWorkItems. Returns a list of work items (Maximum 200) :param [int] ids: The comma-separated list of requested work item ids. (Maximum 200 ids allowed). :param str project: Project ID or project name :param [str] fields: Comma-separated list of requested fields :param datetime as_of: AsOf UTC date time string :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. :param str error_policy: The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}. :rtype: [WorkItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if ids is not None: ids = ",".join(map(str, ids)) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') if fields is not None: fields = ",".join(fields) query_parameters['fields'] = self._serialize.query('fields', fields, 'str') if as_of is not None: query_parameters['asOf'] = self._serialize.query('as_of', as_of, 'iso-8601') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if error_policy is not None: query_parameters['errorPolicy'] = self._serialize.query('error_policy', error_policy, 'str') response = self._send(http_method='GET', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItem]', self._unwrap_collection(response)) def update_work_item(self, document, id, project=None, validate_only=None, bypass_rules=None, suppress_notifications=None, expand=None): """UpdateWorkItem. Updates a single work item. :param :class:`<[JsonPatchOperation]> ` document: The JSON Patch document representing the update :param int id: The id of the work item to update :param str project: Project ID or project name :param bool validate_only: Indicate if you only want to validate the changes without saving the work item :param bool bypass_rules: Do not enforce the work item type rules on this update :param bool suppress_notifications: Do not fire any notifications for this change :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if validate_only is not None: query_parameters['validateOnly'] = self._serialize.query('validate_only', validate_only, 'bool') if bypass_rules is not None: query_parameters['bypassRules'] = self._serialize.query('bypass_rules', bypass_rules, 'bool') if suppress_notifications is not None: query_parameters['suppressNotifications'] = self._serialize.query('suppress_notifications', suppress_notifications, 'bool') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/json-patch+json') return self._deserialize('WorkItem', response) def get_work_items_batch(self, work_item_get_request, project=None): """GetWorkItemsBatch. Gets work items for a list of work item ids (Maximum 200) :param :class:` ` work_item_get_request: :param str project: Project ID or project name :rtype: [WorkItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(work_item_get_request, 'WorkItemBatchGetRequest') response = self._send(http_method='POST', location_id='908509b6-4248-4475-a1cd-829139ba419f', version='5.1', route_values=route_values, content=content) return self._deserialize('[WorkItem]', self._unwrap_collection(response)) def get_work_item_type_categories(self, project): """GetWorkItemTypeCategories. Get all work item type categories. :param str project: Project ID or project name :rtype: [WorkItemTypeCategory] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='9b9f5734-36c8-415e-ba67-f83b45c31408', version='5.1', route_values=route_values) return self._deserialize('[WorkItemTypeCategory]', self._unwrap_collection(response)) def get_work_item_type_category(self, project, category): """GetWorkItemTypeCategory. Get specific work item type category by name. :param str project: Project ID or project name :param str category: The category name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if category is not None: route_values['category'] = self._serialize.url('category', category, 'str') response = self._send(http_method='GET', location_id='9b9f5734-36c8-415e-ba67-f83b45c31408', version='5.1', route_values=route_values) return self._deserialize('WorkItemTypeCategory', response) def get_work_item_type(self, project, type): """GetWorkItemType. Returns a work item type definition. :param str project: Project ID or project name :param str type: Work item type name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa', version='5.1', route_values=route_values) return self._deserialize('WorkItemType', response) def get_work_item_types(self, project): """GetWorkItemTypes. Returns the list of work item types :param str project: Project ID or project name :rtype: [WorkItemType] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa', version='5.1', route_values=route_values) return self._deserialize('[WorkItemType]', self._unwrap_collection(response)) def get_work_item_type_fields_with_references(self, project, type, expand=None): """GetWorkItemTypeFieldsWithReferences. Get a list of fields for a work item type with detailed references. :param str project: Project ID or project name :param str type: Work item type. :param str expand: Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties. :rtype: [WorkItemTypeFieldWithReferences] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='bd293ce5-3d25-4192-8e67-e8092e879efb', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemTypeFieldWithReferences]', self._unwrap_collection(response)) def get_work_item_type_field_with_references(self, project, type, field, expand=None): """GetWorkItemTypeFieldWithReferences. Get a field for a work item type with detailed references. :param str project: Project ID or project name :param str type: Work item type. :param str field: :param str expand: Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') if field is not None: route_values['field'] = self._serialize.url('field', field, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='bd293ce5-3d25-4192-8e67-e8092e879efb', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemTypeFieldWithReferences', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/000077500000000000000000000000001360605530400270555ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/__init__.py000066400000000000000000000010551360605530400311670ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/accounts/000077500000000000000000000000001360605530400306745ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/accounts/__init__.py000066400000000000000000000013461360605530400330110ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .accounts_client import AccountsClient __all__ = [ 'Account', 'AccountCreateInfoInternal', 'AccountPreferencesInternal', 'AccountsClient' ] accounts_client.py000066400000000000000000000043761360605530400343560ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/accounts# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class AccountsClient(Client): """Accounts :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(AccountsClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '0d55247a-1c47-4462-9b1f-5e2125590ee6' def get_accounts(self, owner_id=None, member_id=None, properties=None): """GetAccounts. Get a list of accounts for a specific owner or a specific member. :param str owner_id: ID for the owner of the accounts. :param str member_id: ID for a member of the accounts. :param str properties: :rtype: [Account] """ query_parameters = {} if owner_id is not None: query_parameters['ownerId'] = self._serialize.query('owner_id', owner_id, 'str') if member_id is not None: query_parameters['memberId'] = self._serialize.query('member_id', member_id, 'str') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='229a6a53-b428-4ffb-a835-e8f36b5b4b1e', version='5.0', query_parameters=query_parameters) return self._deserialize('[Account]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/accounts/models.py000066400000000000000000000143151360605530400325350ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class Account(Model): """Account. :param account_id: Identifier for an Account :type account_id: str :param account_name: Name for an account :type account_name: str :param account_owner: Owner of account :type account_owner: str :param account_status: Current account status :type account_status: object :param account_type: Type of account: Personal, Organization :type account_type: object :param account_uri: Uri for an account :type account_uri: str :param created_by: Who created the account :type created_by: str :param created_date: Date account was created :type created_date: datetime :param has_moved: :type has_moved: bool :param last_updated_by: Identity of last person to update the account :type last_updated_by: str :param last_updated_date: Date account was last updated :type last_updated_date: datetime :param namespace_id: Namespace for an account :type namespace_id: str :param new_collection_id: :type new_collection_id: str :param organization_name: Organization that created the account :type organization_name: str :param properties: Extended properties :type properties: :class:`object ` :param status_reason: Reason for current status :type status_reason: str """ _attribute_map = { 'account_id': {'key': 'accountId', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'account_owner': {'key': 'accountOwner', 'type': 'str'}, 'account_status': {'key': 'accountStatus', 'type': 'object'}, 'account_type': {'key': 'accountType', 'type': 'object'}, 'account_uri': {'key': 'accountUri', 'type': 'str'}, 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'has_moved': {'key': 'hasMoved', 'type': 'bool'}, 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'str'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, 'new_collection_id': {'key': 'newCollectionId', 'type': 'str'}, 'organization_name': {'key': 'organizationName', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'status_reason': {'key': 'statusReason', 'type': 'str'} } def __init__(self, account_id=None, account_name=None, account_owner=None, account_status=None, account_type=None, account_uri=None, created_by=None, created_date=None, has_moved=None, last_updated_by=None, last_updated_date=None, namespace_id=None, new_collection_id=None, organization_name=None, properties=None, status_reason=None): super(Account, self).__init__() self.account_id = account_id self.account_name = account_name self.account_owner = account_owner self.account_status = account_status self.account_type = account_type self.account_uri = account_uri self.created_by = created_by self.created_date = created_date self.has_moved = has_moved self.last_updated_by = last_updated_by self.last_updated_date = last_updated_date self.namespace_id = namespace_id self.new_collection_id = new_collection_id self.organization_name = organization_name self.properties = properties self.status_reason = status_reason class AccountCreateInfoInternal(Model): """AccountCreateInfoInternal. :param account_name: :type account_name: str :param creator: :type creator: str :param organization: :type organization: str :param preferences: :type preferences: :class:`AccountPreferencesInternal ` :param properties: :type properties: :class:`object ` :param service_definitions: :type service_definitions: list of { key: str; value: str } """ _attribute_map = { 'account_name': {'key': 'accountName', 'type': 'str'}, 'creator': {'key': 'creator', 'type': 'str'}, 'organization': {'key': 'organization', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'AccountPreferencesInternal'}, 'properties': {'key': 'properties', 'type': 'object'}, 'service_definitions': {'key': 'serviceDefinitions', 'type': '[{ key: str; value: str }]'} } def __init__(self, account_name=None, creator=None, organization=None, preferences=None, properties=None, service_definitions=None): super(AccountCreateInfoInternal, self).__init__() self.account_name = account_name self.creator = creator self.organization = organization self.preferences = preferences self.properties = properties self.service_definitions = service_definitions class AccountPreferencesInternal(Model): """AccountPreferencesInternal. :param culture: :type culture: object :param language: :type language: object :param time_zone: :type time_zone: object """ _attribute_map = { 'culture': {'key': 'culture', 'type': 'object'}, 'language': {'key': 'language', 'type': 'object'}, 'time_zone': {'key': 'timeZone', 'type': 'object'} } def __init__(self, culture=None, language=None, time_zone=None): super(AccountPreferencesInternal, self).__init__() self.culture = culture self.language = language self.time_zone = time_zone __all__ = [ 'Account', 'AccountCreateInfoInternal', 'AccountPreferencesInternal', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/boards/000077500000000000000000000000001360605530400303275ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/boards/__init__.py000066400000000000000000000023531360605530400324430ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .boards_client import BoardsClient __all__ = [ 'Board', 'BoardColumn', 'BoardColumnBase', 'BoardColumnCollectionResponse', 'BoardColumnCreate', 'BoardColumnResponse', 'BoardColumnUpdate', 'BoardItem', 'BoardItemCollectionResponse', 'BoardItemIdAndType', 'BoardItemReference', 'BoardItemResponse', 'BoardReference', 'BoardResponse', 'BoardRow', 'BoardRowBase', 'BoardRowCollectionResponse', 'BoardRowCreate', 'BoardRowResponse', 'BoardRowUpdate', 'CreateBoard', 'EntityReference', 'NewBoardItem', 'ReferenceLinks', 'UpdateBoard', 'UpdateBoardItem', 'BoardsClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/boards/boards_client.py000066400000000000000000000022371360605530400335150ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class BoardsClient(Client): """Boards :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(BoardsClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '11635d5f-a4f9-43ea-a48b-d56be43fee0f' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/boards/models.py000066400000000000000000000475241360605530400322000ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class BoardColumnBase(Model): """BoardColumnBase. :param description: Board column description. :type description: str :param name: Name of the column. :type name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, description=None, name=None): super(BoardColumnBase, self).__init__() self.description = description self.name = name class BoardColumnCollectionResponse(Model): """BoardColumnCollectionResponse. :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param board_columns: The resulting collection of BoardColumn. :type board_columns: list of :class:`BoardColumn ` :param eTag: The last change date and time for all the columns in the collection. :type eTag: list of str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'board_columns': {'key': 'boardColumns', 'type': '[BoardColumn]'}, 'eTag': {'key': 'eTag', 'type': '[str]'} } def __init__(self, _links=None, board_columns=None, eTag=None): super(BoardColumnCollectionResponse, self).__init__() self._links = _links self.board_columns = board_columns self.eTag = eTag class BoardColumnCreate(BoardColumnBase): """BoardColumnCreate. :param description: Board column description. :type description: str :param name: Name of the column. :type name: str :param next_column_id: Next column identifier or supported directive: $first or $last. :type next_column_id: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'next_column_id': {'key': 'nextColumnId', 'type': 'str'} } def __init__(self, description=None, name=None, next_column_id=None): super(BoardColumnCreate, self).__init__(description=description, name=name) self.next_column_id = next_column_id class BoardColumnResponse(Model): """BoardColumnResponse. :param board_column: The resulting BoardColumn. :type board_column: :class:`BoardColumn ` :param eTag: The last change date and time for all the columns in the collection. :type eTag: list of str """ _attribute_map = { 'board_column': {'key': 'boardColumn', 'type': 'BoardColumn'}, 'eTag': {'key': 'eTag', 'type': '[str]'} } def __init__(self, board_column=None, eTag=None): super(BoardColumnResponse, self).__init__() self.board_column = board_column self.eTag = eTag class BoardColumnUpdate(BoardColumnCreate): """BoardColumnUpdate. :param description: Board column description. :type description: str :param next_column_id: Next column identifier or supported directive: $first or $last. :type next_column_id: str :param name: Name of the column. :type name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'next_column_id': {'key': 'nextColumnId', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, description=None, next_column_id=None, name=None): super(BoardColumnUpdate, self).__init__(description=description, next_column_id=next_column_id) self.name = name class BoardItemCollectionResponse(Model): """BoardItemCollectionResponse. :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param board_items: The resulting collection of BoardItem. :type board_items: list of :class:`BoardItem ` :param eTag: The last change date and time for all items in the collection. :type eTag: list of str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'board_items': {'key': 'boardItems', 'type': '[BoardItem]'}, 'eTag': {'key': 'eTag', 'type': '[str]'} } def __init__(self, _links=None, board_items=None, eTag=None): super(BoardItemCollectionResponse, self).__init__() self._links = _links self.board_items = board_items self.eTag = eTag class BoardItemIdAndType(Model): """BoardItemIdAndType. :param item_id: Item id. :type item_id: str :param item_type: Item type. :type item_type: str """ _attribute_map = { 'item_id': {'key': 'itemId', 'type': 'str'}, 'item_type': {'key': 'itemType', 'type': 'str'} } def __init__(self, item_id=None, item_type=None): super(BoardItemIdAndType, self).__init__() self.item_id = item_id self.item_type = item_type class BoardItemReference(BoardItemIdAndType): """BoardItemReference. :param item_id: Item id. :type item_id: str :param item_type: Item type. :type item_type: str :param unique_id: Board's unique identifier. Compound identifier generated using the item identifier and item type. :type unique_id: str :param url: Full http link to the resource. :type url: str """ _attribute_map = { 'item_id': {'key': 'itemId', 'type': 'str'}, 'item_type': {'key': 'itemType', 'type': 'str'}, 'unique_id': {'key': 'uniqueId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, item_id=None, item_type=None, unique_id=None, url=None): super(BoardItemReference, self).__init__(item_id=item_id, item_type=item_type) self.unique_id = unique_id self.url = url class BoardItemResponse(Model): """BoardItemResponse. :param eTag: The last changed date for the board item. :type eTag: list of str :param item: The resulting BoardItem. :type item: :class:`BoardItem ` """ _attribute_map = { 'eTag': {'key': 'eTag', 'type': '[str]'}, 'item': {'key': 'item', 'type': 'BoardItem'} } def __init__(self, eTag=None, item=None): super(BoardItemResponse, self).__init__() self.eTag = eTag self.item = item class BoardResponse(Model): """BoardResponse. :param board: The resulting Board. :type board: :class:`Board ` :param eTag: The last date and time the board was changed. :type eTag: list of str """ _attribute_map = { 'board': {'key': 'board', 'type': 'Board'}, 'eTag': {'key': 'eTag', 'type': '[str]'} } def __init__(self, board=None, eTag=None): super(BoardResponse, self).__init__() self.board = board self.eTag = eTag class BoardRowBase(Model): """BoardRowBase. :param name: Row name. :type name: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'} } def __init__(self, name=None): super(BoardRowBase, self).__init__() self.name = name class BoardRowCollectionResponse(Model): """BoardRowCollectionResponse. :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param board_rows: The resulting collection of BoardRow. :type board_rows: list of :class:`BoardRow ` :param eTag: The last change date and time for all the rows in the collection. :type eTag: list of str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'board_rows': {'key': 'boardRows', 'type': '[BoardRow]'}, 'eTag': {'key': 'eTag', 'type': '[str]'} } def __init__(self, _links=None, board_rows=None, eTag=None): super(BoardRowCollectionResponse, self).__init__() self._links = _links self.board_rows = board_rows self.eTag = eTag class BoardRowCreate(BoardRowBase): """BoardRowCreate. :param name: Row name. :type name: str :param next_row_id: Next row identifier or supported directive: $first or $last. :type next_row_id: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'next_row_id': {'key': 'nextRowId', 'type': 'str'} } def __init__(self, name=None, next_row_id=None): super(BoardRowCreate, self).__init__(name=name) self.next_row_id = next_row_id class BoardRowResponse(Model): """BoardRowResponse. :param board_row: The resulting collection of BoardRow. :type board_row: :class:`BoardRow ` :param eTag: The last change date and time for all the rows in the collection. :type eTag: list of str """ _attribute_map = { 'board_row': {'key': 'boardRow', 'type': 'BoardRow'}, 'eTag': {'key': 'eTag', 'type': '[str]'} } def __init__(self, board_row=None, eTag=None): super(BoardRowResponse, self).__init__() self.board_row = board_row self.eTag = eTag class BoardRowUpdate(BoardRowCreate): """BoardRowUpdate. :param name: Row name. :type name: str :param next_row_id: Next row identifier or supported directive: $first or $last. :type next_row_id: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'next_row_id': {'key': 'nextRowId', 'type': 'str'}, } def __init__(self, name=None, next_row_id=None): super(BoardRowUpdate, self).__init__(name=name, next_row_id=next_row_id) class CreateBoard(Model): """CreateBoard. :param description: Description of the board. :type description: str :param name: Name of the board to create. :type name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, description=None, name=None): super(CreateBoard, self).__init__() self.description = description self.name = name class EntityReference(Model): """EntityReference. :param name: Name of the resource. :type name: str :param url: Full http link to the resource. :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, url=None): super(EntityReference, self).__init__() self.name = name self.url = url class NewBoardItem(BoardItemIdAndType): """NewBoardItem. :param item_id: Item id. :type item_id: str :param item_type: Item type. :type item_type: str :param column_id: Board column identifier. :type column_id: str :param next_item_unique_id: Next item unique identifier or supported directive: $first or $last. :type next_item_unique_id: str :param row_id: Board row identifier. :type row_id: str """ _attribute_map = { 'item_id': {'key': 'itemId', 'type': 'str'}, 'item_type': {'key': 'itemType', 'type': 'str'}, 'column_id': {'key': 'columnId', 'type': 'str'}, 'next_item_unique_id': {'key': 'nextItemUniqueId', 'type': 'str'}, 'row_id': {'key': 'rowId', 'type': 'str'} } def __init__(self, item_id=None, item_type=None, column_id=None, next_item_unique_id=None, row_id=None): super(NewBoardItem, self).__init__(item_id=item_id, item_type=item_type) self.column_id = column_id self.next_item_unique_id = next_item_unique_id self.row_id = row_id class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class UpdateBoard(Model): """UpdateBoard. :param description: New description of the board. :type description: str :param name: New name of the board. :type name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, description=None, name=None): super(UpdateBoard, self).__init__() self.description = description self.name = name class UpdateBoardItem(Model): """UpdateBoardItem. :param column_id: Board column identifier. :type column_id: str :param next_item_unique_id: Next unique item identifier or supported directive: $first or $last. :type next_item_unique_id: str :param row_id: Board row identifier. :type row_id: str """ _attribute_map = { 'column_id': {'key': 'columnId', 'type': 'str'}, 'next_item_unique_id': {'key': 'nextItemUniqueId', 'type': 'str'}, 'row_id': {'key': 'rowId', 'type': 'str'} } def __init__(self, column_id=None, next_item_unique_id=None, row_id=None): super(UpdateBoardItem, self).__init__() self.column_id = column_id self.next_item_unique_id = next_item_unique_id self.row_id = row_id class BoardColumn(BoardColumnBase): """BoardColumn. :param description: Board column description. :type description: str :param name: Name of the column. :type name: str :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param id: Id of the resource. :type id: str :param next_column_id: Next column identifier. :type next_column_id: str :param url: Full http link to the resource. :type url: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'str'}, 'next_column_id': {'key': 'nextColumnId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, description=None, name=None, _links=None, id=None, next_column_id=None, url=None): super(BoardColumn, self).__init__(description=description, name=name) self._links = _links self.id = id self.next_column_id = next_column_id self.url = url class BoardItem(BoardItemReference): """BoardItem. :param item_id: Item id. :type item_id: str :param item_type: Item type. :type item_type: str :param unique_id: Board's unique identifier. Compound identifier generated using the item identifier and item type. :type unique_id: str :param url: Full http link to the resource. :type url: str :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param board_id: Board id for this item. :type board_id: int :param column: Board column id for this item. :type column: str :param next_item_unique_id: Next item unique identifier. :type next_item_unique_id: str :param row: Board row id for this item. :type row: str """ _attribute_map = { 'item_id': {'key': 'itemId', 'type': 'str'}, 'item_type': {'key': 'itemType', 'type': 'str'}, 'unique_id': {'key': 'uniqueId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'board_id': {'key': 'boardId', 'type': 'int'}, 'column': {'key': 'column', 'type': 'str'}, 'next_item_unique_id': {'key': 'nextItemUniqueId', 'type': 'str'}, 'row': {'key': 'row', 'type': 'str'} } def __init__(self, item_id=None, item_type=None, unique_id=None, url=None, _links=None, board_id=None, column=None, next_item_unique_id=None, row=None): super(BoardItem, self).__init__(item_id=item_id, item_type=item_type, unique_id=unique_id, url=url) self._links = _links self.board_id = board_id self.column = column self.next_item_unique_id = next_item_unique_id self.row = row class BoardReference(EntityReference): """BoardReference. :param name: Name of the resource. :type name: str :param url: Full http link to the resource. :type url: str :param id: Id of the resource. :type id: int """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'} } def __init__(self, name=None, url=None, id=None): super(BoardReference, self).__init__(name=name, url=url) self.id = id class BoardRow(BoardRowBase): """BoardRow. :param name: Row name. :type name: str :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param id: Id of the resource. :type id: str :param next_row_id: Next row identifier. :type next_row_id: str :param url: Full http link to the resource. :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'str'}, 'next_row_id': {'key': 'nextRowId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, _links=None, id=None, next_row_id=None, url=None): super(BoardRow, self).__init__(name=name) self._links = _links self.id = id self.next_row_id = next_row_id self.url = url class Board(BoardReference): """Board. :param name: Name of the resource. :type name: str :param url: Full http link to the resource. :type url: str :param id: Id of the resource. :type id: int :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param description: Description of the board. :type description: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'} } def __init__(self, name=None, url=None, id=None, _links=None, description=None): super(Board, self).__init__(name=name, url=url, id=id) self._links = _links self.description = description __all__ = [ 'BoardColumnBase', 'BoardColumnCollectionResponse', 'BoardColumnCreate', 'BoardColumnResponse', 'BoardColumnUpdate', 'BoardItemCollectionResponse', 'BoardItemIdAndType', 'BoardItemReference', 'BoardItemResponse', 'BoardResponse', 'BoardRowBase', 'BoardRowCollectionResponse', 'BoardRowCreate', 'BoardRowResponse', 'BoardRowUpdate', 'CreateBoard', 'EntityReference', 'NewBoardItem', 'ReferenceLinks', 'UpdateBoard', 'UpdateBoardItem', 'BoardColumn', 'BoardItem', 'BoardReference', 'BoardRow', 'Board', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/build/000077500000000000000000000000001360605530400301545ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/build/__init__.py000066400000000000000000000050521360605530400322670ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .build_client import BuildClient __all__ = [ 'AgentPoolQueue', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', 'AggregatedRunsByOutcome', 'AggregatedRunsByState', 'ArtifactResource', 'AssociatedWorkItem', 'Attachment', 'AuthorizationHeader', 'Build', 'BuildArtifact', 'BuildBadge', 'BuildController', 'BuildDefinition', 'BuildDefinition3_2', 'BuildDefinitionReference', 'BuildDefinitionReference3_2', 'BuildDefinitionRevision', 'BuildDefinitionStep', 'BuildDefinitionTemplate', 'BuildDefinitionTemplate3_2', 'BuildDefinitionVariable', 'BuildLog', 'BuildLogReference', 'BuildMetric', 'BuildOption', 'BuildOptionDefinition', 'BuildOptionDefinitionReference', 'BuildOptionGroupDefinition', 'BuildOptionInputDefinition', 'BuildReportMetadata', 'BuildRepository', 'BuildRequestValidationResult', 'BuildResourceUsage', 'BuildSettings', 'Change', 'DataSourceBindingBase', 'DefinitionReference', 'DefinitionResourceReference', 'Deployment', 'Folder', 'GraphSubjectBase', 'IdentityRef', 'Issue', 'JsonPatchOperation', 'ProcessParameters', 'PullRequest', 'ReferenceLinks', 'ReleaseReference', 'RepositoryWebhook', 'ResourceRef', 'RetentionPolicy', 'SourceProviderAttributes', 'SourceRepositories', 'SourceRepository', 'SourceRepositoryItem', 'SupportedTrigger', 'TaskAgentPoolReference', 'TaskDefinitionReference', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskOrchestrationPlanReference', 'TaskReference', 'TaskSourceDefinitionBase', 'TeamProjectReference', 'TestResultsContext', 'Timeline', 'TimelineAttempt', 'TimelineRecord', 'TimelineReference', 'VariableGroup', 'VariableGroupReference', 'WebApiConnectedServiceRef', 'XamlBuildControllerReference', 'BuildClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/build/build_client.py000066400000000000000000003236771360605530400332050ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class BuildClient(Client): """Build :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(BuildClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '965220d5-5bb9-42cf-8d67-9b146df2a5a4' def create_artifact(self, artifact, project, build_id): """CreateArtifact. Associates an artifact with a build. :param :class:` ` artifact: The artifact. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') content = self._serialize.body(artifact, 'BuildArtifact') response = self._send(http_method='POST', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.0', route_values=route_values, content=content) return self._deserialize('BuildArtifact', response) def get_artifact(self, project, build_id, artifact_name): """GetArtifact. Gets a specific artifact for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if artifact_name is not None: query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildArtifact', response) def get_artifact_content_zip(self, project, build_id, artifact_name, **kwargs): """GetArtifactContentZip. Gets a specific artifact for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if artifact_name is not None: query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_artifacts(self, project, build_id): """GetArtifacts. Gets all artifacts for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [BuildArtifact] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.0', route_values=route_values) return self._deserialize('[BuildArtifact]', self._unwrap_collection(response)) def get_file(self, project, build_id, artifact_name, file_id, file_name, **kwargs): """GetFile. Gets a file from the build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. :param str file_id: The primary key for the file. :param str file_name: The name that the file will be set to. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if artifact_name is not None: query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') if file_id is not None: query_parameters['fileId'] = self._serialize.query('file_id', file_id, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_attachments(self, project, build_id, type): """GetAttachments. [Preview API] Gets the list of attachments of a specific type that are associated with a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: The type of attachment. :rtype: [Attachment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='f2192269-89fa-4f94-baf6-8fb128c55159', version='5.0-preview.2', route_values=route_values) return self._deserialize('[Attachment]', self._unwrap_collection(response)) def get_attachment(self, project, build_id, timeline_id, record_id, type, name, **kwargs): """GetAttachment. [Preview API] Gets a specific attachment. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str timeline_id: The ID of the timeline. :param str record_id: The ID of the timeline record. :param str type: The type of the attachment. :param str name: The name of the attachment. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') if record_id is not None: route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='af5122d3-3438-485e-a25a-2dbbfde84ee6', version='5.0-preview.2', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def authorize_project_resources(self, resources, project): """AuthorizeProjectResources. [Preview API] :param [DefinitionResourceReference] resources: :param str project: Project ID or project name :rtype: [DefinitionResourceReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(resources, '[DefinitionResourceReference]') response = self._send(http_method='PATCH', location_id='398c85bc-81aa-4822-947c-a194a05f0fef', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def get_project_resources(self, project, type=None, id=None): """GetProjectResources. [Preview API] :param str project: Project ID or project name :param str type: :param str id: :rtype: [DefinitionResourceReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') if id is not None: query_parameters['id'] = self._serialize.query('id', id, 'str') response = self._send(http_method='GET', location_id='398c85bc-81aa-4822-947c-a194a05f0fef', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def list_branches(self, project, provider_name, service_endpoint_id=None, repository=None): """ListBranches. [Preview API] Gets a list of branches for the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') response = self._send(http_method='GET', location_id='e05d4403-9b81-4244-8763-20fde28d1976', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def get_build_badge(self, project, repo_type, repo_id=None, branch_name=None): """GetBuildBadge. [Preview API] Gets a badge that indicates the status of the most recent build for the specified branch. :param str project: Project ID or project name :param str repo_type: The repository type. :param str repo_id: The repository ID. :param str branch_name: The branch name. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repo_type is not None: route_values['repoType'] = self._serialize.url('repo_type', repo_type, 'str') query_parameters = {} if repo_id is not None: query_parameters['repoId'] = self._serialize.query('repo_id', repo_id, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='21b3b9ce-fad5-4567-9ad0-80679794e003', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildBadge', response) def get_build_badge_data(self, project, repo_type, repo_id=None, branch_name=None): """GetBuildBadgeData. [Preview API] Gets a badge that indicates the status of the most recent build for the specified branch. :param str project: Project ID or project name :param str repo_type: The repository type. :param str repo_id: The repository ID. :param str branch_name: The branch name. :rtype: str """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repo_type is not None: route_values['repoType'] = self._serialize.url('repo_type', repo_type, 'str') query_parameters = {} if repo_id is not None: query_parameters['repoId'] = self._serialize.query('repo_id', repo_id, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='21b3b9ce-fad5-4567-9ad0-80679794e003', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def delete_build(self, project, build_id): """DeleteBuild. Deletes a build. :param str project: Project ID or project name :param int build_id: The ID of the build. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') self._send(http_method='DELETE', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.0', route_values=route_values) def get_build(self, project, build_id, property_filters=None): """GetBuild. Gets a build :param str project: Project ID or project name :param int build_id: :param str property_filters: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if property_filters is not None: query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Build', response) def get_builds(self, project, definitions=None, queues=None, build_number=None, min_time=None, max_time=None, requested_for=None, reason_filter=None, status_filter=None, result_filter=None, tag_filters=None, properties=None, top=None, continuation_token=None, max_builds_per_definition=None, deleted_filter=None, query_order=None, branch_name=None, build_ids=None, repository_id=None, repository_type=None): """GetBuilds. Gets a list of builds. :param str project: Project ID or project name :param [int] definitions: A comma-delimited list of definition IDs. If specified, filters to builds for these definitions. :param [int] queues: A comma-delimited list of queue IDs. If specified, filters to builds that ran against these queues. :param str build_number: If specified, filters to builds that match this build number. Append * to do a prefix search. :param datetime min_time: If specified, filters to builds that finished/started/queued after this date based on the queryOrder specified. :param datetime max_time: If specified, filters to builds that finished/started/queued before this date based on the queryOrder specified. :param str requested_for: If specified, filters to builds requested for the specified user. :param str reason_filter: If specified, filters to builds that match this reason. :param str status_filter: If specified, filters to builds that match this status. :param str result_filter: If specified, filters to builds that match this result. :param [str] tag_filters: A comma-delimited list of tags. If specified, filters to builds that have the specified tags. :param [str] properties: A comma-delimited list of properties to retrieve. :param int top: The maximum number of builds to return. :param str continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of builds. :param int max_builds_per_definition: The maximum number of builds to return per definition. :param str deleted_filter: Indicates whether to exclude, include, or only return deleted builds. :param str query_order: The order in which builds should be returned. :param str branch_name: If specified, filters to builds that built branches that built this branch. :param [int] build_ids: A comma-delimited list that specifies the IDs of builds to retrieve. :param str repository_id: If specified, filters to builds that built from this repository. :param str repository_type: If specified, filters to builds that built from repositories of this type. :rtype: [Build] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definitions is not None: definitions = ",".join(map(str, definitions)) query_parameters['definitions'] = self._serialize.query('definitions', definitions, 'str') if queues is not None: queues = ",".join(map(str, queues)) query_parameters['queues'] = self._serialize.query('queues', queues, 'str') if build_number is not None: query_parameters['buildNumber'] = self._serialize.query('build_number', build_number, 'str') if min_time is not None: query_parameters['minTime'] = self._serialize.query('min_time', min_time, 'iso-8601') if max_time is not None: query_parameters['maxTime'] = self._serialize.query('max_time', max_time, 'iso-8601') if requested_for is not None: query_parameters['requestedFor'] = self._serialize.query('requested_for', requested_for, 'str') if reason_filter is not None: query_parameters['reasonFilter'] = self._serialize.query('reason_filter', reason_filter, 'str') if status_filter is not None: query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') if result_filter is not None: query_parameters['resultFilter'] = self._serialize.query('result_filter', result_filter, 'str') if tag_filters is not None: tag_filters = ",".join(tag_filters) query_parameters['tagFilters'] = self._serialize.query('tag_filters', tag_filters, 'str') if properties is not None: properties = ",".join(properties) query_parameters['properties'] = self._serialize.query('properties', properties, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if max_builds_per_definition is not None: query_parameters['maxBuildsPerDefinition'] = self._serialize.query('max_builds_per_definition', max_builds_per_definition, 'int') if deleted_filter is not None: query_parameters['deletedFilter'] = self._serialize.query('deleted_filter', deleted_filter, 'str') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') if build_ids is not None: build_ids = ",".join(map(str, build_ids)) query_parameters['buildIds'] = self._serialize.query('build_ids', build_ids, 'str') if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if repository_type is not None: query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Build]', self._unwrap_collection(response)) def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None, source_build_id=None): """QueueBuild. Queues a build :param :class:` ` build: :param str project: Project ID or project name :param bool ignore_warnings: :param str check_in_ticket: :param int source_build_id: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if ignore_warnings is not None: query_parameters['ignoreWarnings'] = self._serialize.query('ignore_warnings', ignore_warnings, 'bool') if check_in_ticket is not None: query_parameters['checkInTicket'] = self._serialize.query('check_in_ticket', check_in_ticket, 'str') if source_build_id is not None: query_parameters['sourceBuildId'] = self._serialize.query('source_build_id', source_build_id, 'int') content = self._serialize.body(build, 'Build') response = self._send(http_method='POST', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Build', response) def update_build(self, build, project, build_id, retry=None): """UpdateBuild. Updates a build. :param :class:` ` build: The build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param bool retry: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if retry is not None: query_parameters['retry'] = self._serialize.query('retry', retry, 'bool') content = self._serialize.body(build, 'Build') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Build', response) def update_builds(self, builds, project): """UpdateBuilds. Updates multiple builds. :param [Build] builds: The builds to update. :param str project: Project ID or project name :rtype: [Build] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(builds, '[Build]') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.0', route_values=route_values, content=content) return self._deserialize('[Build]', self._unwrap_collection(response)) def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): """GetBuildChanges. Gets the changes associated with a build :param str project: Project ID or project name :param int build_id: :param str continuation_token: :param int top: The maximum number of changes to return :param bool include_source_change: :rtype: [Change] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if include_source_change is not None: query_parameters['includeSourceChange'] = self._serialize.query('include_source_change', include_source_change, 'bool') response = self._send(http_method='GET', location_id='54572c7b-bbd3-45d4-80dc-28be08941620', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Change]', self._unwrap_collection(response)) def get_changes_between_builds(self, project, from_build_id=None, to_build_id=None, top=None): """GetChangesBetweenBuilds. [Preview API] Gets the changes made to the repository between two given builds. :param str project: Project ID or project name :param int from_build_id: The ID of the first build. :param int to_build_id: The ID of the last build. :param int top: The maximum number of changes to return. :rtype: [Change] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if from_build_id is not None: query_parameters['fromBuildId'] = self._serialize.query('from_build_id', from_build_id, 'int') if to_build_id is not None: query_parameters['toBuildId'] = self._serialize.query('to_build_id', to_build_id, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='f10f0ea5-18a1-43ec-a8fb-2042c7be9b43', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Change]', self._unwrap_collection(response)) def get_build_controller(self, controller_id): """GetBuildController. Gets a controller :param int controller_id: :rtype: :class:` ` """ route_values = {} if controller_id is not None: route_values['controllerId'] = self._serialize.url('controller_id', controller_id, 'int') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', version='5.0', route_values=route_values) return self._deserialize('BuildController', response) def get_build_controllers(self, name=None): """GetBuildControllers. Gets controller, optionally filtered by name :param str name: :rtype: [BuildController] """ query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', version='5.0', query_parameters=query_parameters) return self._deserialize('[BuildController]', self._unwrap_collection(response)) def create_definition(self, definition, project, definition_to_clone_id=None, definition_to_clone_revision=None): """CreateDefinition. Creates a new definition. :param :class:` ` definition: The definition. :param str project: Project ID or project name :param int definition_to_clone_id: :param int definition_to_clone_revision: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definition_to_clone_id is not None: query_parameters['definitionToCloneId'] = self._serialize.query('definition_to_clone_id', definition_to_clone_id, 'int') if definition_to_clone_revision is not None: query_parameters['definitionToCloneRevision'] = self._serialize.query('definition_to_clone_revision', definition_to_clone_revision, 'int') content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='POST', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('BuildDefinition', response) def delete_definition(self, project, definition_id): """DeleteDefinition. Deletes a definition and all associated builds. :param str project: Project ID or project name :param int definition_id: The ID of the definition. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') self._send(http_method='DELETE', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.0', route_values=route_values) def get_definition(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): """GetDefinition. Gets a definition, optionally at a specific revision. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int revision: The revision number to retrieve. If this is not specified, the latest version will be returned. :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. :param [str] property_filters: A comma-delimited list of properties to include in the results. :param bool include_latest_builds: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if revision is not None: query_parameters['revision'] = self._serialize.query('revision', revision, 'int') if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if include_latest_builds is not None: query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) def get_definitions(self, project, name=None, repository_id=None, repository_type=None, query_order=None, top=None, continuation_token=None, min_metrics_time=None, definition_ids=None, path=None, built_after=None, not_built_after=None, include_all_properties=None, include_latest_builds=None, task_id_filter=None, process_type=None, yaml_filename=None): """GetDefinitions. Gets a list of definitions. :param str project: Project ID or project name :param str name: If specified, filters to definitions whose names match this pattern. :param str repository_id: A repository ID. If specified, filters to definitions that use this repository. :param str repository_type: If specified, filters to definitions that have a repository of this type. :param str query_order: Indicates the order in which definitions should be returned. :param int top: The maximum number of definitions to return. :param str continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of definitions. :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. :param [int] definition_ids: A comma-delimited list that specifies the IDs of definitions to retrieve. :param str path: If specified, filters to definitions under this folder. :param datetime built_after: If specified, filters to definitions that have builds after this date. :param datetime not_built_after: If specified, filters to definitions that do not have builds after this date. :param bool include_all_properties: Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned. :param bool include_latest_builds: Indicates whether to return the latest and latest completed builds for this definition. :param str task_id_filter: If specified, filters to definitions that use the specified task. :param int process_type: If specified, filters to definitions with the given process type. :param str yaml_filename: If specified, filters to YAML definitions that match the given filename. :rtype: [BuildDefinitionReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if repository_type is not None: query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') if definition_ids is not None: definition_ids = ",".join(map(str, definition_ids)) query_parameters['definitionIds'] = self._serialize.query('definition_ids', definition_ids, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if built_after is not None: query_parameters['builtAfter'] = self._serialize.query('built_after', built_after, 'iso-8601') if not_built_after is not None: query_parameters['notBuiltAfter'] = self._serialize.query('not_built_after', not_built_after, 'iso-8601') if include_all_properties is not None: query_parameters['includeAllProperties'] = self._serialize.query('include_all_properties', include_all_properties, 'bool') if include_latest_builds is not None: query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') if task_id_filter is not None: query_parameters['taskIdFilter'] = self._serialize.query('task_id_filter', task_id_filter, 'str') if process_type is not None: query_parameters['processType'] = self._serialize.query('process_type', process_type, 'int') if yaml_filename is not None: query_parameters['yamlFilename'] = self._serialize.query('yaml_filename', yaml_filename, 'str') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[BuildDefinitionReference]', self._unwrap_collection(response)) def restore_definition(self, project, definition_id, deleted): """RestoreDefinition. Restores a deleted definition :param str project: Project ID or project name :param int definition_id: The identifier of the definition to restore. :param bool deleted: When false, restores a deleted definition. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if deleted is not None: query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') response = self._send(http_method='PATCH', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) def update_definition(self, definition, project, definition_id, secrets_source_definition_id=None, secrets_source_definition_revision=None): """UpdateDefinition. Updates an existing definition. :param :class:` ` definition: The new version of the defintion. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int secrets_source_definition_id: :param int secrets_source_definition_revision: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if secrets_source_definition_id is not None: query_parameters['secretsSourceDefinitionId'] = self._serialize.query('secrets_source_definition_id', secrets_source_definition_id, 'int') if secrets_source_definition_revision is not None: query_parameters['secretsSourceDefinitionRevision'] = self._serialize.query('secrets_source_definition_revision', secrets_source_definition_revision, 'int') content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='PUT', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('BuildDefinition', response) def get_file_contents(self, project, provider_name, service_endpoint_id=None, repository=None, commit_or_branch=None, path=None, **kwargs): """GetFileContents. [Preview API] Gets the contents of a file in the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories. :param str commit_or_branch: The identifier of the commit or branch from which a file's contents are retrieved. :param str path: The path to the file to retrieve, relative to the root of the repository. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') if commit_or_branch is not None: query_parameters['commitOrBranch'] = self._serialize.query('commit_or_branch', commit_or_branch, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='29d12225-b1d9-425f-b668-6c594a981313', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def create_folder(self, folder, project, path): """CreateFolder. [Preview API] Creates a new folder. :param :class:` ` folder: The folder. :param str project: Project ID or project name :param str path: The full path of the folder. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') content = self._serialize.body(folder, 'Folder') response = self._send(http_method='PUT', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('Folder', response) def delete_folder(self, project, path): """DeleteFolder. [Preview API] Deletes a definition folder. Definitions and their corresponding builds will also be deleted. :param str project: Project ID or project name :param str path: The full path to the folder. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') self._send(http_method='DELETE', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', version='5.0-preview.2', route_values=route_values) def get_folders(self, project, path=None, query_order=None): """GetFolders. [Preview API] Gets a list of build definition folders. :param str project: Project ID or project name :param str path: The path to start with. :param str query_order: The order in which folders should be returned. :rtype: [Folder] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') query_parameters = {} if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') response = self._send(http_method='GET', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Folder]', self._unwrap_collection(response)) def update_folder(self, folder, project, path): """UpdateFolder. [Preview API] Updates an existing folder at given existing path :param :class:` ` folder: The new version of the folder. :param str project: Project ID or project name :param str path: The full path to the folder. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') content = self._serialize.body(folder, 'Folder') response = self._send(http_method='POST', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('Folder', response) def get_latest_build(self, project, definition, branch_name=None): """GetLatestBuild. [Preview API] Gets the latest build for a definition, optionally scoped to a specific branch. :param str project: Project ID or project name :param str definition: definition name with optional leading folder path, or the definition id :param str branch_name: optional parameter that indicates the specific branch to use :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition is not None: route_values['definition'] = self._serialize.url('definition', definition, 'str') query_parameters = {} if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='54481611-01f4-47f3-998f-160da0f0c229', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Build', response) def get_build_log(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): """GetBuildLog. Gets an individual log file for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int log_id: The ID of the log file. :param long start_line: The start line. :param long end_line: The end line. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_build_log_lines(self, project, build_id, log_id, start_line=None, end_line=None): """GetBuildLogLines. Gets an individual log file for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int log_id: The ID of the log file. :param long start_line: The start line. :param long end_line: The end line. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def get_build_logs(self, project, build_id): """GetBuildLogs. Gets the logs for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [BuildLog] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.0', route_values=route_values) return self._deserialize('[BuildLog]', self._unwrap_collection(response)) def get_build_logs_zip(self, project, build_id, **kwargs): """GetBuildLogsZip. Gets the logs for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.0', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_build_log_zip(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): """GetBuildLogZip. Gets an individual log file for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int log_id: The ID of the log file. :param long start_line: The start line. :param long end_line: The end line. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_project_metrics(self, project, metric_aggregation_type=None, min_metrics_time=None): """GetProjectMetrics. [Preview API] Gets build metrics for a project. :param str project: Project ID or project name :param str metric_aggregation_type: The aggregation type to use (hourly, daily). :param datetime min_metrics_time: The date from which to calculate metrics. :rtype: [BuildMetric] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if metric_aggregation_type is not None: route_values['metricAggregationType'] = self._serialize.url('metric_aggregation_type', metric_aggregation_type, 'str') query_parameters = {} if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') response = self._send(http_method='GET', location_id='7433fae7-a6bc-41dc-a6e2-eef9005ce41a', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[BuildMetric]', self._unwrap_collection(response)) def get_definition_metrics(self, project, definition_id, min_metrics_time=None): """GetDefinitionMetrics. [Preview API] Gets build metrics for a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param datetime min_metrics_time: The date from which to calculate metrics. :rtype: [BuildMetric] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') response = self._send(http_method='GET', location_id='d973b939-0ce0-4fec-91d8-da3940fa1827', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[BuildMetric]', self._unwrap_collection(response)) def get_build_option_definitions(self, project=None): """GetBuildOptionDefinitions. Gets all build definition options supported by the system. :param str project: Project ID or project name :rtype: [BuildOptionDefinition] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='591cb5a4-2d46-4f3a-a697-5cd42b6bd332', version='5.0', route_values=route_values) return self._deserialize('[BuildOptionDefinition]', self._unwrap_collection(response)) def get_path_contents(self, project, provider_name, service_endpoint_id=None, repository=None, commit_or_branch=None, path=None): """GetPathContents. [Preview API] Gets the contents of a directory in the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories. :param str commit_or_branch: The identifier of the commit or branch from which a file's contents are retrieved. :param str path: The path contents to list, relative to the root of the repository. :rtype: [SourceRepositoryItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') if commit_or_branch is not None: query_parameters['commitOrBranch'] = self._serialize.query('commit_or_branch', commit_or_branch, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='7944d6fb-df01-4709-920a-7a189aa34037', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[SourceRepositoryItem]', self._unwrap_collection(response)) def get_build_properties(self, project, build_id, filter=None): """GetBuildProperties. [Preview API] Gets properties for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param [str] filter: A comma-delimited list of properties. If specified, filters to these specific properties. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if filter is not None: filter = ",".join(filter) query_parameters['filter'] = self._serialize.query('filter', filter, 'str') response = self._send(http_method='GET', location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def update_build_properties(self, document, project, build_id): """UpdateBuildProperties. [Preview API] Updates properties for a build. :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') return self._deserialize('object', response) def get_definition_properties(self, project, definition_id, filter=None): """GetDefinitionProperties. [Preview API] Gets properties for a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param [str] filter: A comma-delimited list of properties. If specified, filters to these specific properties. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if filter is not None: filter = ",".join(filter) query_parameters['filter'] = self._serialize.query('filter', filter, 'str') response = self._send(http_method='GET', location_id='d9826ad7-2a68-46a9-a6e9-677698777895', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def update_definition_properties(self, document, project, definition_id): """UpdateDefinitionProperties. [Preview API] Updates properties for a definition. :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='d9826ad7-2a68-46a9-a6e9-677698777895', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') return self._deserialize('object', response) def get_pull_request(self, project, provider_name, pull_request_id, repository_id=None, service_endpoint_id=None): """GetPullRequest. [Preview API] Gets a pull request object from source provider. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str pull_request_id: Vendor-specific id of the pull request. :param str repository_id: Vendor-specific identifier or the name of the repository that contains the pull request. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'str') query_parameters = {} if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') response = self._send(http_method='GET', location_id='d8763ec7-9ff0-4fb4-b2b2-9d757906ff14', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PullRequest', response) def get_build_report(self, project, build_id, type=None): """GetBuildReport. [Preview API] Gets a build report. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildReportMetadata', response) def get_build_report_html_content(self, project, build_id, type=None, **kwargs): """GetBuildReportHtmlContent. [Preview API] Gets a build report. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/html') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def list_repositories(self, project, provider_name, service_endpoint_id=None, repository=None, result_set=None, page_results=None, continuation_token=None): """ListRepositories. [Preview API] Gets a list of source code repositories. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of a single repository to get. :param str result_set: 'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set. :param bool page_results: If set to true, this will limit the set of results and will return a continuation token to continue the query. :param str continuation_token: When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') if result_set is not None: query_parameters['resultSet'] = self._serialize.query('result_set', result_set, 'str') if page_results is not None: query_parameters['pageResults'] = self._serialize.query('page_results', page_results, 'bool') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='d44d1680-f978-4834-9b93-8c6e132329c9', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('SourceRepositories', response) def authorize_definition_resources(self, resources, project, definition_id): """AuthorizeDefinitionResources. [Preview API] :param [DefinitionResourceReference] resources: :param str project: Project ID or project name :param int definition_id: :rtype: [DefinitionResourceReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') content = self._serialize.body(resources, '[DefinitionResourceReference]') response = self._send(http_method='PATCH', location_id='ea623316-1967-45eb-89ab-e9e6110cf2d6', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def get_definition_resources(self, project, definition_id): """GetDefinitionResources. [Preview API] :param str project: Project ID or project name :param int definition_id: :rtype: [DefinitionResourceReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='ea623316-1967-45eb-89ab-e9e6110cf2d6', version='5.0-preview.1', route_values=route_values) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def get_resource_usage(self): """GetResourceUsage. [Preview API] Gets information about build resources in the system. :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='3813d06c-9e36-4ea1-aac3-61a485d60e3d', version='5.0-preview.2') return self._deserialize('BuildResourceUsage', response) def get_definition_revisions(self, project, definition_id): """GetDefinitionRevisions. Gets all revisions of a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :rtype: [BuildDefinitionRevision] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='7c116775-52e5-453e-8c5d-914d9762d8c4', version='5.0', route_values=route_values) return self._deserialize('[BuildDefinitionRevision]', self._unwrap_collection(response)) def get_build_settings(self, project=None): """GetBuildSettings. Gets the build settings. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', version='5.0', route_values=route_values) return self._deserialize('BuildSettings', response) def update_build_settings(self, settings, project=None): """UpdateBuildSettings. Updates the build settings. :param :class:` ` settings: The new settings. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(settings, 'BuildSettings') response = self._send(http_method='PATCH', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', version='5.0', route_values=route_values, content=content) return self._deserialize('BuildSettings', response) def list_source_providers(self, project): """ListSourceProviders. [Preview API] Get a list of source providers and their capabilities. :param str project: Project ID or project name :rtype: [SourceProviderAttributes] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='3ce81729-954f-423d-a581-9fea01d25186', version='5.0-preview.1', route_values=route_values) return self._deserialize('[SourceProviderAttributes]', self._unwrap_collection(response)) def get_status_badge(self, project, definition, branch_name=None, stage_name=None, job_name=None, configuration=None, label=None): """GetStatusBadge. [Preview API]

Gets the build status for a definition, optionally scoped to a specific branch, stage, job, and configuration.

If there are more than one, then it is required to pass in a stageName value when specifying a jobName, and the same rule then applies for both if passing a configuration parameter.

:param str project: Project ID or project name :param str definition: Either the definition name with optional leading folder path, or the definition id. :param str branch_name: Only consider the most recent build for this branch. :param str stage_name: Use this stage within the pipeline to render the status. :param str job_name: Use this job within a stage of the pipeline to render the status. :param str configuration: Use this job configuration to render the status :param str label: Replaces the default text on the left side of the badge. :rtype: str """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition is not None: route_values['definition'] = self._serialize.url('definition', definition, 'str') query_parameters = {} if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') if stage_name is not None: query_parameters['stageName'] = self._serialize.query('stage_name', stage_name, 'str') if job_name is not None: query_parameters['jobName'] = self._serialize.query('job_name', job_name, 'str') if configuration is not None: query_parameters['configuration'] = self._serialize.query('configuration', configuration, 'str') if label is not None: query_parameters['label'] = self._serialize.query('label', label, 'str') response = self._send(http_method='GET', location_id='07acfdce-4757-4439-b422-ddd13a2fcc10', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def add_build_tag(self, project, build_id, tag): """AddBuildTag. Adds a tag to a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str tag: The tag to add. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def add_build_tags(self, tags, project, build_id): """AddBuildTags. Adds tags to a build. :param [str] tags: The tags to add. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.0', route_values=route_values, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_build_tag(self, project, build_id, tag): """DeleteBuildTag. Removes a tag from a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str tag: The tag to remove. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_build_tags(self, project, build_id): """GetBuildTags. Gets the tags for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_tags(self, project): """GetTags. Gets a list of all build and definition tags in the project. :param str project: Project ID or project name :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', version='5.0', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def add_definition_tag(self, project, definition_id, tag): """AddDefinitionTag. [Preview API] Adds a tag to a definition :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param str tag: The tag to add. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='cb894432-134a-4d31-a839-83beceaace4b', version='5.0-preview.2', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def add_definition_tags(self, tags, project, definition_id): """AddDefinitionTags. [Preview API] Adds multiple tags to a definition. :param [str] tags: The tags to add. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='cb894432-134a-4d31-a839-83beceaace4b', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_definition_tag(self, project, definition_id, tag): """DeleteDefinitionTag. [Preview API] Removes a tag from a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param str tag: The tag to remove. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='cb894432-134a-4d31-a839-83beceaace4b', version='5.0-preview.2', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_definition_tags(self, project, definition_id, revision=None): """GetDefinitionTags. [Preview API] Gets the tags for a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int revision: The definition revision number. If not specified, uses the latest revision of the definition. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if revision is not None: query_parameters['revision'] = self._serialize.query('revision', revision, 'int') response = self._send(http_method='GET', location_id='cb894432-134a-4d31-a839-83beceaace4b', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_template(self, project, template_id): """DeleteTemplate. Deletes a build definition template. :param str project: Project ID or project name :param str template_id: The ID of the template. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') self._send(http_method='DELETE', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.0', route_values=route_values) def get_template(self, project, template_id): """GetTemplate. Gets a specific build definition template. :param str project: Project ID or project name :param str template_id: The ID of the requested template. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.0', route_values=route_values) return self._deserialize('BuildDefinitionTemplate', response) def get_templates(self, project): """GetTemplates. Gets all definition templates. :param str project: Project ID or project name :rtype: [BuildDefinitionTemplate] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.0', route_values=route_values) return self._deserialize('[BuildDefinitionTemplate]', self._unwrap_collection(response)) def save_template(self, template, project, template_id): """SaveTemplate. Updates an existing build definition template. :param :class:` ` template: The new version of the template. :param str project: Project ID or project name :param str template_id: The ID of the template. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') content = self._serialize.body(template, 'BuildDefinitionTemplate') response = self._send(http_method='PUT', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.0', route_values=route_values, content=content) return self._deserialize('BuildDefinitionTemplate', response) def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None, plan_id=None): """GetBuildTimeline. Gets details for a build :param str project: Project ID or project name :param int build_id: :param str timeline_id: :param int change_id: :param str plan_id: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') query_parameters = {} if change_id is not None: query_parameters['changeId'] = self._serialize.query('change_id', change_id, 'int') if plan_id is not None: query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='8baac422-4c6e-4de5-8532-db96d92acffa', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Timeline', response) def restore_webhooks(self, trigger_types, project, provider_name, service_endpoint_id=None, repository=None): """RestoreWebhooks. [Preview API] Recreates the webhooks for the specified triggers in the given source code repository. :param [DefinitionTriggerType] trigger_types: The types of triggers to restore webhooks for. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') content = self._serialize.body(trigger_types, '[DefinitionTriggerType]') self._send(http_method='POST', location_id='793bceb8-9736-4030-bd2f-fb3ce6d6b478', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) def list_webhooks(self, project, provider_name, service_endpoint_id=None, repository=None): """ListWebhooks. [Preview API] Gets a list of webhooks installed in the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories. :rtype: [RepositoryWebhook] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') response = self._send(http_method='GET', location_id='8f20ff82-9498-4812-9f6e-9c01bdc50e99', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[RepositoryWebhook]', self._unwrap_collection(response)) def get_build_work_items_refs(self, project, build_id, top=None): """GetBuildWorkItemsRefs. Gets the work items associated with a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int top: The maximum number of work items to return. :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) def get_build_work_items_refs_from_commits(self, commit_ids, project, build_id, top=None): """GetBuildWorkItemsRefsFromCommits. Gets the work items associated with a build, filtered to specific commits. :param [str] commit_ids: A comma-delimited list of commit IDs. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int top: The maximum number of work items to return, or the number of commits to consider if no commit IDs are specified. :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') content = self._serialize.body(commit_ids, '[str]') response = self._send(http_method='POST', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) def get_work_items_between_builds(self, project, from_build_id, to_build_id, top=None): """GetWorkItemsBetweenBuilds. [Preview API] Gets all the work items between two builds. :param str project: Project ID or project name :param int from_build_id: The ID of the first build. :param int to_build_id: The ID of the last build. :param int top: The maximum number of work items to return. :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if from_build_id is not None: query_parameters['fromBuildId'] = self._serialize.query('from_build_id', from_build_id, 'int') if to_build_id is not None: query_parameters['toBuildId'] = self._serialize.query('to_build_id', to_build_id, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='52ba8915-5518-42e3-a4bb-b0182d159e2d', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/build/models.py000066400000000000000000003643251360605530400320260ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AgentPoolQueue(Model): """AgentPoolQueue. :param _links: :type _links: :class:`ReferenceLinks ` :param id: The ID of the queue. :type id: int :param name: The name of the queue. :type name: str :param pool: The pool used by this queue. :type pool: :class:`TaskAgentPoolReference ` :param url: The full http link to the resource. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, id=None, name=None, pool=None, url=None): super(AgentPoolQueue, self).__init__() self._links = _links self.id = id self.name = name self.pool = pool self.url = url class AggregatedResultsAnalysis(Model): """AggregatedResultsAnalysis. :param duration: :type duration: object :param not_reported_results_by_outcome: :type not_reported_results_by_outcome: dict :param previous_context: :type previous_context: :class:`TestResultsContext ` :param results_by_outcome: :type results_by_outcome: dict :param results_difference: :type results_difference: :class:`AggregatedResultsDifference ` :param run_summary_by_outcome: :type run_summary_by_outcome: dict :param run_summary_by_state: :type run_summary_by_state: dict :param total_tests: :type total_tests: int """ _attribute_map = { 'duration': {'key': 'duration', 'type': 'object'}, 'not_reported_results_by_outcome': {'key': 'notReportedResultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'previous_context': {'key': 'previousContext', 'type': 'TestResultsContext'}, 'results_by_outcome': {'key': 'resultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'results_difference': {'key': 'resultsDifference', 'type': 'AggregatedResultsDifference'}, 'run_summary_by_outcome': {'key': 'runSummaryByOutcome', 'type': '{AggregatedRunsByOutcome}'}, 'run_summary_by_state': {'key': 'runSummaryByState', 'type': '{AggregatedRunsByState}'}, 'total_tests': {'key': 'totalTests', 'type': 'int'} } def __init__(self, duration=None, not_reported_results_by_outcome=None, previous_context=None, results_by_outcome=None, results_difference=None, run_summary_by_outcome=None, run_summary_by_state=None, total_tests=None): super(AggregatedResultsAnalysis, self).__init__() self.duration = duration self.not_reported_results_by_outcome = not_reported_results_by_outcome self.previous_context = previous_context self.results_by_outcome = results_by_outcome self.results_difference = results_difference self.run_summary_by_outcome = run_summary_by_outcome self.run_summary_by_state = run_summary_by_state self.total_tests = total_tests class AggregatedResultsByOutcome(Model): """AggregatedResultsByOutcome. :param count: :type count: int :param duration: :type duration: object :param group_by_field: :type group_by_field: str :param group_by_value: :type group_by_value: object :param outcome: :type outcome: object :param rerun_result_count: :type rerun_result_count: int """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'duration': {'key': 'duration', 'type': 'object'}, 'group_by_field': {'key': 'groupByField', 'type': 'str'}, 'group_by_value': {'key': 'groupByValue', 'type': 'object'}, 'outcome': {'key': 'outcome', 'type': 'object'}, 'rerun_result_count': {'key': 'rerunResultCount', 'type': 'int'} } def __init__(self, count=None, duration=None, group_by_field=None, group_by_value=None, outcome=None, rerun_result_count=None): super(AggregatedResultsByOutcome, self).__init__() self.count = count self.duration = duration self.group_by_field = group_by_field self.group_by_value = group_by_value self.outcome = outcome self.rerun_result_count = rerun_result_count class AggregatedResultsDifference(Model): """AggregatedResultsDifference. :param increase_in_duration: :type increase_in_duration: object :param increase_in_failures: :type increase_in_failures: int :param increase_in_other_tests: :type increase_in_other_tests: int :param increase_in_passed_tests: :type increase_in_passed_tests: int :param increase_in_total_tests: :type increase_in_total_tests: int """ _attribute_map = { 'increase_in_duration': {'key': 'increaseInDuration', 'type': 'object'}, 'increase_in_failures': {'key': 'increaseInFailures', 'type': 'int'}, 'increase_in_other_tests': {'key': 'increaseInOtherTests', 'type': 'int'}, 'increase_in_passed_tests': {'key': 'increaseInPassedTests', 'type': 'int'}, 'increase_in_total_tests': {'key': 'increaseInTotalTests', 'type': 'int'} } def __init__(self, increase_in_duration=None, increase_in_failures=None, increase_in_other_tests=None, increase_in_passed_tests=None, increase_in_total_tests=None): super(AggregatedResultsDifference, self).__init__() self.increase_in_duration = increase_in_duration self.increase_in_failures = increase_in_failures self.increase_in_other_tests = increase_in_other_tests self.increase_in_passed_tests = increase_in_passed_tests self.increase_in_total_tests = increase_in_total_tests class AggregatedRunsByOutcome(Model): """AggregatedRunsByOutcome. :param outcome: :type outcome: object :param runs_count: :type runs_count: int """ _attribute_map = { 'outcome': {'key': 'outcome', 'type': 'object'}, 'runs_count': {'key': 'runsCount', 'type': 'int'} } def __init__(self, outcome=None, runs_count=None): super(AggregatedRunsByOutcome, self).__init__() self.outcome = outcome self.runs_count = runs_count class AggregatedRunsByState(Model): """AggregatedRunsByState. :param results_by_outcome: :type results_by_outcome: dict :param runs_count: :type runs_count: int :param state: :type state: object """ _attribute_map = { 'results_by_outcome': {'key': 'resultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'runs_count': {'key': 'runsCount', 'type': 'int'}, 'state': {'key': 'state', 'type': 'object'} } def __init__(self, results_by_outcome=None, runs_count=None, state=None): super(AggregatedRunsByState, self).__init__() self.results_by_outcome = results_by_outcome self.runs_count = runs_count self.state = state class ArtifactResource(Model): """ArtifactResource. :param _links: :type _links: :class:`ReferenceLinks ` :param data: Type-specific data about the artifact. :type data: str :param download_url: A link to download the resource. :type download_url: str :param properties: Type-specific properties of the artifact. :type properties: dict :param type: The type of the resource: File container, version control folder, UNC path, etc. :type type: str :param url: The full http link to the resource. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'data': {'key': 'data', 'type': 'str'}, 'download_url': {'key': 'downloadUrl', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, data=None, download_url=None, properties=None, type=None, url=None): super(ArtifactResource, self).__init__() self._links = _links self.data = data self.download_url = download_url self.properties = properties self.type = type self.url = url class AssociatedWorkItem(Model): """AssociatedWorkItem. :param assigned_to: :type assigned_to: str :param id: Id of associated the work item. :type id: int :param state: :type state: str :param title: :type title: str :param url: REST Url of the work item. :type url: str :param web_url: :type web_url: str :param work_item_type: :type work_item_type: str """ _attribute_map = { 'assigned_to': {'key': 'assignedTo', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'state': {'key': 'state', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'web_url': {'key': 'webUrl', 'type': 'str'}, 'work_item_type': {'key': 'workItemType', 'type': 'str'} } def __init__(self, assigned_to=None, id=None, state=None, title=None, url=None, web_url=None, work_item_type=None): super(AssociatedWorkItem, self).__init__() self.assigned_to = assigned_to self.id = id self.state = state self.title = title self.url = url self.web_url = web_url self.work_item_type = work_item_type class Attachment(Model): """Attachment. :param _links: :type _links: :class:`ReferenceLinks ` :param name: The name of the attachment. :type name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, _links=None, name=None): super(Attachment, self).__init__() self._links = _links self.name = name class AuthorizationHeader(Model): """AuthorizationHeader. :param name: :type name: str :param value: :type value: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, name=None, value=None): super(AuthorizationHeader, self).__init__() self.name = name self.value = value class Build(Model): """Build. :param _links: :type _links: :class:`ReferenceLinks ` :param build_number: The build number/name of the build. :type build_number: str :param build_number_revision: The build number revision. :type build_number_revision: int :param controller: The build controller. This is only set if the definition type is Xaml. :type controller: :class:`BuildController ` :param definition: The definition associated with the build. :type definition: :class:`DefinitionReference ` :param deleted: Indicates whether the build has been deleted. :type deleted: bool :param deleted_by: The identity of the process or person that deleted the build. :type deleted_by: :class:`IdentityRef ` :param deleted_date: The date the build was deleted. :type deleted_date: datetime :param deleted_reason: The description of how the build was deleted. :type deleted_reason: str :param demands: A list of demands that represents the agent capabilities required by this build. :type demands: list of :class:`object ` :param finish_time: The time that the build was completed. :type finish_time: datetime :param id: The ID of the build. :type id: int :param keep_forever: Indicates whether the build should be skipped by retention policies. :type keep_forever: bool :param last_changed_by: The identity representing the process or person that last changed the build. :type last_changed_by: :class:`IdentityRef ` :param last_changed_date: The date the build was last changed. :type last_changed_date: datetime :param logs: Information about the build logs. :type logs: :class:`BuildLogReference ` :param orchestration_plan: The orchestration plan for the build. :type orchestration_plan: :class:`TaskOrchestrationPlanReference ` :param parameters: The parameters for the build. :type parameters: str :param plans: Orchestration plans associated with the build (build, cleanup) :type plans: list of :class:`TaskOrchestrationPlanReference ` :param priority: The build's priority. :type priority: object :param project: The team project. :type project: :class:`TeamProjectReference ` :param properties: :type properties: :class:`object ` :param quality: The quality of the xaml build (good, bad, etc.) :type quality: str :param queue: The queue. This is only set if the definition type is Build. :type queue: :class:`AgentPoolQueue ` :param queue_options: Additional options for queueing the build. :type queue_options: object :param queue_position: The current position of the build in the queue. :type queue_position: int :param queue_time: The time that the build was queued. :type queue_time: datetime :param reason: The reason that the build was created. :type reason: object :param repository: The repository. :type repository: :class:`BuildRepository ` :param requested_by: The identity that queued the build. :type requested_by: :class:`IdentityRef ` :param requested_for: The identity on whose behalf the build was queued. :type requested_for: :class:`IdentityRef ` :param result: The build result. :type result: object :param retained_by_release: Indicates whether the build is retained by a release. :type retained_by_release: bool :param source_branch: The source branch. :type source_branch: str :param source_version: The source version. :type source_version: str :param start_time: The time that the build was started. :type start_time: datetime :param status: The status of the build. :type status: object :param tags: :type tags: list of str :param triggered_by_build: The build that triggered this build via a Build completion trigger. :type triggered_by_build: :class:`Build ` :param trigger_info: Sourceprovider-specific information about what triggered the build :type trigger_info: dict :param uri: The URI of the build. :type uri: str :param url: The REST URL of the build. :type url: str :param validation_results: :type validation_results: list of :class:`BuildRequestValidationResult ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'build_number': {'key': 'buildNumber', 'type': 'str'}, 'build_number_revision': {'key': 'buildNumberRevision', 'type': 'int'}, 'controller': {'key': 'controller', 'type': 'BuildController'}, 'definition': {'key': 'definition', 'type': 'DefinitionReference'}, 'deleted': {'key': 'deleted', 'type': 'bool'}, 'deleted_by': {'key': 'deletedBy', 'type': 'IdentityRef'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'deleted_reason': {'key': 'deletedReason', 'type': 'str'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'keep_forever': {'key': 'keepForever', 'type': 'bool'}, 'last_changed_by': {'key': 'lastChangedBy', 'type': 'IdentityRef'}, 'last_changed_date': {'key': 'lastChangedDate', 'type': 'iso-8601'}, 'logs': {'key': 'logs', 'type': 'BuildLogReference'}, 'orchestration_plan': {'key': 'orchestrationPlan', 'type': 'TaskOrchestrationPlanReference'}, 'parameters': {'key': 'parameters', 'type': 'str'}, 'plans': {'key': 'plans', 'type': '[TaskOrchestrationPlanReference]'}, 'priority': {'key': 'priority', 'type': 'object'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'properties': {'key': 'properties', 'type': 'object'}, 'quality': {'key': 'quality', 'type': 'str'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'}, 'queue_options': {'key': 'queueOptions', 'type': 'object'}, 'queue_position': {'key': 'queuePosition', 'type': 'int'}, 'queue_time': {'key': 'queueTime', 'type': 'iso-8601'}, 'reason': {'key': 'reason', 'type': 'object'}, 'repository': {'key': 'repository', 'type': 'BuildRepository'}, 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, 'requested_for': {'key': 'requestedFor', 'type': 'IdentityRef'}, 'result': {'key': 'result', 'type': 'object'}, 'retained_by_release': {'key': 'retainedByRelease', 'type': 'bool'}, 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, 'source_version': {'key': 'sourceVersion', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'triggered_by_build': {'key': 'triggeredByBuild', 'type': 'Build'}, 'trigger_info': {'key': 'triggerInfo', 'type': '{str}'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'validation_results': {'key': 'validationResults', 'type': '[BuildRequestValidationResult]'} } def __init__(self, _links=None, build_number=None, build_number_revision=None, controller=None, definition=None, deleted=None, deleted_by=None, deleted_date=None, deleted_reason=None, demands=None, finish_time=None, id=None, keep_forever=None, last_changed_by=None, last_changed_date=None, logs=None, orchestration_plan=None, parameters=None, plans=None, priority=None, project=None, properties=None, quality=None, queue=None, queue_options=None, queue_position=None, queue_time=None, reason=None, repository=None, requested_by=None, requested_for=None, result=None, retained_by_release=None, source_branch=None, source_version=None, start_time=None, status=None, tags=None, triggered_by_build=None, trigger_info=None, uri=None, url=None, validation_results=None): super(Build, self).__init__() self._links = _links self.build_number = build_number self.build_number_revision = build_number_revision self.controller = controller self.definition = definition self.deleted = deleted self.deleted_by = deleted_by self.deleted_date = deleted_date self.deleted_reason = deleted_reason self.demands = demands self.finish_time = finish_time self.id = id self.keep_forever = keep_forever self.last_changed_by = last_changed_by self.last_changed_date = last_changed_date self.logs = logs self.orchestration_plan = orchestration_plan self.parameters = parameters self.plans = plans self.priority = priority self.project = project self.properties = properties self.quality = quality self.queue = queue self.queue_options = queue_options self.queue_position = queue_position self.queue_time = queue_time self.reason = reason self.repository = repository self.requested_by = requested_by self.requested_for = requested_for self.result = result self.retained_by_release = retained_by_release self.source_branch = source_branch self.source_version = source_version self.start_time = start_time self.status = status self.tags = tags self.triggered_by_build = triggered_by_build self.trigger_info = trigger_info self.uri = uri self.url = url self.validation_results = validation_results class BuildArtifact(Model): """BuildArtifact. :param id: The artifact ID. :type id: int :param name: The name of the artifact. :type name: str :param resource: The actual resource. :type resource: :class:`ArtifactResource ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'ArtifactResource'} } def __init__(self, id=None, name=None, resource=None): super(BuildArtifact, self).__init__() self.id = id self.name = name self.resource = resource class BuildBadge(Model): """BuildBadge. :param build_id: The ID of the build represented by this badge. :type build_id: int :param image_url: A link to the SVG resource. :type image_url: str """ _attribute_map = { 'build_id': {'key': 'buildId', 'type': 'int'}, 'image_url': {'key': 'imageUrl', 'type': 'str'} } def __init__(self, build_id=None, image_url=None): super(BuildBadge, self).__init__() self.build_id = build_id self.image_url = image_url class BuildDefinitionRevision(Model): """BuildDefinitionRevision. :param changed_by: The identity of the person or process that changed the definition. :type changed_by: :class:`IdentityRef ` :param changed_date: The date and time that the definition was changed. :type changed_date: datetime :param change_type: The change type (add, edit, delete). :type change_type: object :param comment: The comment associated with the change. :type comment: str :param definition_url: A link to the definition at this revision. :type definition_url: str :param name: The name of the definition. :type name: str :param revision: The revision number. :type revision: int """ _attribute_map = { 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, 'change_type': {'key': 'changeType', 'type': 'object'}, 'comment': {'key': 'comment', 'type': 'str'}, 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'} } def __init__(self, changed_by=None, changed_date=None, change_type=None, comment=None, definition_url=None, name=None, revision=None): super(BuildDefinitionRevision, self).__init__() self.changed_by = changed_by self.changed_date = changed_date self.change_type = change_type self.comment = comment self.definition_url = definition_url self.name = name self.revision = revision class BuildDefinitionStep(Model): """BuildDefinitionStep. :param always_run: Indicates whether this step should run even if a previous step fails. :type always_run: bool :param condition: A condition that determines whether this step should run. :type condition: str :param continue_on_error: Indicates whether the phase should continue even if this step fails. :type continue_on_error: bool :param display_name: The display name for this step. :type display_name: str :param enabled: Indicates whether the step is enabled. :type enabled: bool :param environment: :type environment: dict :param inputs: :type inputs: dict :param ref_name: The reference name for this step. :type ref_name: str :param task: The task associated with this step. :type task: :class:`TaskDefinitionReference ` :param timeout_in_minutes: The time, in minutes, that this step is allowed to run. :type timeout_in_minutes: int """ _attribute_map = { 'always_run': {'key': 'alwaysRun', 'type': 'bool'}, 'condition': {'key': 'condition', 'type': 'str'}, 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'environment': {'key': 'environment', 'type': '{str}'}, 'inputs': {'key': 'inputs', 'type': '{str}'}, 'ref_name': {'key': 'refName', 'type': 'str'}, 'task': {'key': 'task', 'type': 'TaskDefinitionReference'}, 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} } def __init__(self, always_run=None, condition=None, continue_on_error=None, display_name=None, enabled=None, environment=None, inputs=None, ref_name=None, task=None, timeout_in_minutes=None): super(BuildDefinitionStep, self).__init__() self.always_run = always_run self.condition = condition self.continue_on_error = continue_on_error self.display_name = display_name self.enabled = enabled self.environment = environment self.inputs = inputs self.ref_name = ref_name self.task = task self.timeout_in_minutes = timeout_in_minutes class BuildDefinitionTemplate(Model): """BuildDefinitionTemplate. :param can_delete: Indicates whether the template can be deleted. :type can_delete: bool :param category: The template category. :type category: str :param default_hosted_queue: An optional hosted agent queue for the template to use by default. :type default_hosted_queue: str :param description: A description of the template. :type description: str :param icons: :type icons: dict :param icon_task_id: The ID of the task whose icon is used when showing this template in the UI. :type icon_task_id: str :param id: The ID of the template. :type id: str :param name: The name of the template. :type name: str :param template: The actual template. :type template: :class:`BuildDefinition ` """ _attribute_map = { 'can_delete': {'key': 'canDelete', 'type': 'bool'}, 'category': {'key': 'category', 'type': 'str'}, 'default_hosted_queue': {'key': 'defaultHostedQueue', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'icons': {'key': 'icons', 'type': '{str}'}, 'icon_task_id': {'key': 'iconTaskId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'template': {'key': 'template', 'type': 'BuildDefinition'} } def __init__(self, can_delete=None, category=None, default_hosted_queue=None, description=None, icons=None, icon_task_id=None, id=None, name=None, template=None): super(BuildDefinitionTemplate, self).__init__() self.can_delete = can_delete self.category = category self.default_hosted_queue = default_hosted_queue self.description = description self.icons = icons self.icon_task_id = icon_task_id self.id = id self.name = name self.template = template class BuildDefinitionTemplate3_2(Model): """BuildDefinitionTemplate3_2. :param can_delete: :type can_delete: bool :param category: :type category: str :param default_hosted_queue: :type default_hosted_queue: str :param description: :type description: str :param icons: :type icons: dict :param icon_task_id: :type icon_task_id: str :param id: :type id: str :param name: :type name: str :param template: :type template: :class:`BuildDefinition3_2 ` """ _attribute_map = { 'can_delete': {'key': 'canDelete', 'type': 'bool'}, 'category': {'key': 'category', 'type': 'str'}, 'default_hosted_queue': {'key': 'defaultHostedQueue', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'icons': {'key': 'icons', 'type': '{str}'}, 'icon_task_id': {'key': 'iconTaskId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'template': {'key': 'template', 'type': 'BuildDefinition3_2'} } def __init__(self, can_delete=None, category=None, default_hosted_queue=None, description=None, icons=None, icon_task_id=None, id=None, name=None, template=None): super(BuildDefinitionTemplate3_2, self).__init__() self.can_delete = can_delete self.category = category self.default_hosted_queue = default_hosted_queue self.description = description self.icons = icons self.icon_task_id = icon_task_id self.id = id self.name = name self.template = template class BuildDefinitionVariable(Model): """BuildDefinitionVariable. :param allow_override: Indicates whether the value can be set at queue time. :type allow_override: bool :param is_secret: Indicates whether the variable's value is a secret. :type is_secret: bool :param value: The value of the variable. :type value: str """ _attribute_map = { 'allow_override': {'key': 'allowOverride', 'type': 'bool'}, 'is_secret': {'key': 'isSecret', 'type': 'bool'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, allow_override=None, is_secret=None, value=None): super(BuildDefinitionVariable, self).__init__() self.allow_override = allow_override self.is_secret = is_secret self.value = value class BuildLogReference(Model): """BuildLogReference. :param id: The ID of the log. :type id: int :param type: The type of the log location. :type type: str :param url: A full link to the log resource. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, type=None, url=None): super(BuildLogReference, self).__init__() self.id = id self.type = type self.url = url class BuildMetric(Model): """BuildMetric. :param date: The date for the scope. :type date: datetime :param int_value: The value. :type int_value: int :param name: The name of the metric. :type name: str :param scope: The scope. :type scope: str """ _attribute_map = { 'date': {'key': 'date', 'type': 'iso-8601'}, 'int_value': {'key': 'intValue', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'scope': {'key': 'scope', 'type': 'str'} } def __init__(self, date=None, int_value=None, name=None, scope=None): super(BuildMetric, self).__init__() self.date = date self.int_value = int_value self.name = name self.scope = scope class BuildOption(Model): """BuildOption. :param definition: A reference to the build option. :type definition: :class:`BuildOptionDefinitionReference ` :param enabled: Indicates whether the behavior is enabled. :type enabled: bool :param inputs: :type inputs: dict """ _attribute_map = { 'definition': {'key': 'definition', 'type': 'BuildOptionDefinitionReference'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'inputs': {'key': 'inputs', 'type': '{str}'} } def __init__(self, definition=None, enabled=None, inputs=None): super(BuildOption, self).__init__() self.definition = definition self.enabled = enabled self.inputs = inputs class BuildOptionDefinitionReference(Model): """BuildOptionDefinitionReference. :param id: The ID of the referenced build option. :type id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'} } def __init__(self, id=None): super(BuildOptionDefinitionReference, self).__init__() self.id = id class BuildOptionGroupDefinition(Model): """BuildOptionGroupDefinition. :param display_name: The name of the group to display in the UI. :type display_name: str :param is_expanded: Indicates whether the group is initially displayed as expanded in the UI. :type is_expanded: bool :param name: The internal name of the group. :type name: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'is_expanded': {'key': 'isExpanded', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, display_name=None, is_expanded=None, name=None): super(BuildOptionGroupDefinition, self).__init__() self.display_name = display_name self.is_expanded = is_expanded self.name = name class BuildOptionInputDefinition(Model): """BuildOptionInputDefinition. :param default_value: The default value. :type default_value: str :param group_name: The name of the input group that this input belongs to. :type group_name: str :param help: :type help: dict :param label: The label for the input. :type label: str :param name: The name of the input. :type name: str :param options: :type options: dict :param required: Indicates whether the input is required to have a value. :type required: bool :param type: Indicates the type of the input value. :type type: object :param visible_rule: The rule that is applied to determine whether the input is visible in the UI. :type visible_rule: str """ _attribute_map = { 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'help': {'key': 'help', 'type': '{str}'}, 'label': {'key': 'label', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'options': {'key': 'options', 'type': '{str}'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'object'}, 'visible_rule': {'key': 'visibleRule', 'type': 'str'} } def __init__(self, default_value=None, group_name=None, help=None, label=None, name=None, options=None, required=None, type=None, visible_rule=None): super(BuildOptionInputDefinition, self).__init__() self.default_value = default_value self.group_name = group_name self.help = help self.label = label self.name = name self.options = options self.required = required self.type = type self.visible_rule = visible_rule class BuildReportMetadata(Model): """BuildReportMetadata. :param build_id: The Id of the build. :type build_id: int :param content: The content of the report. :type content: str :param type: The type of the report. :type type: str """ _attribute_map = { 'build_id': {'key': 'buildId', 'type': 'int'}, 'content': {'key': 'content', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, build_id=None, content=None, type=None): super(BuildReportMetadata, self).__init__() self.build_id = build_id self.content = content self.type = type class BuildRepository(Model): """BuildRepository. :param checkout_submodules: Indicates whether to checkout submodules. :type checkout_submodules: bool :param clean: Indicates whether to clean the target folder when getting code from the repository. :type clean: str :param default_branch: The name of the default branch. :type default_branch: str :param id: The ID of the repository. :type id: str :param name: The friendly name of the repository. :type name: str :param properties: :type properties: dict :param root_folder: The root folder. :type root_folder: str :param type: The type of the repository. :type type: str :param url: The URL of the repository. :type url: str """ _attribute_map = { 'checkout_submodules': {'key': 'checkoutSubmodules', 'type': 'bool'}, 'clean': {'key': 'clean', 'type': 'str'}, 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'root_folder': {'key': 'rootFolder', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, checkout_submodules=None, clean=None, default_branch=None, id=None, name=None, properties=None, root_folder=None, type=None, url=None): super(BuildRepository, self).__init__() self.checkout_submodules = checkout_submodules self.clean = clean self.default_branch = default_branch self.id = id self.name = name self.properties = properties self.root_folder = root_folder self.type = type self.url = url class BuildRequestValidationResult(Model): """BuildRequestValidationResult. :param message: The message associated with the result. :type message: str :param result: The result. :type result: object """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'result': {'key': 'result', 'type': 'object'} } def __init__(self, message=None, result=None): super(BuildRequestValidationResult, self).__init__() self.message = message self.result = result class BuildResourceUsage(Model): """BuildResourceUsage. :param distributed_task_agents: The number of build agents. :type distributed_task_agents: int :param paid_private_agent_slots: The number of paid private agent slots. :type paid_private_agent_slots: int :param total_usage: The total usage. :type total_usage: int :param xaml_controllers: The number of XAML controllers. :type xaml_controllers: int """ _attribute_map = { 'distributed_task_agents': {'key': 'distributedTaskAgents', 'type': 'int'}, 'paid_private_agent_slots': {'key': 'paidPrivateAgentSlots', 'type': 'int'}, 'total_usage': {'key': 'totalUsage', 'type': 'int'}, 'xaml_controllers': {'key': 'xamlControllers', 'type': 'int'} } def __init__(self, distributed_task_agents=None, paid_private_agent_slots=None, total_usage=None, xaml_controllers=None): super(BuildResourceUsage, self).__init__() self.distributed_task_agents = distributed_task_agents self.paid_private_agent_slots = paid_private_agent_slots self.total_usage = total_usage self.xaml_controllers = xaml_controllers class BuildSettings(Model): """BuildSettings. :param days_to_keep_deleted_builds_before_destroy: The number of days to keep records of deleted builds. :type days_to_keep_deleted_builds_before_destroy: int :param default_retention_policy: The default retention policy. :type default_retention_policy: :class:`RetentionPolicy ` :param maximum_retention_policy: The maximum retention policy. :type maximum_retention_policy: :class:`RetentionPolicy ` """ _attribute_map = { 'days_to_keep_deleted_builds_before_destroy': {'key': 'daysToKeepDeletedBuildsBeforeDestroy', 'type': 'int'}, 'default_retention_policy': {'key': 'defaultRetentionPolicy', 'type': 'RetentionPolicy'}, 'maximum_retention_policy': {'key': 'maximumRetentionPolicy', 'type': 'RetentionPolicy'} } def __init__(self, days_to_keep_deleted_builds_before_destroy=None, default_retention_policy=None, maximum_retention_policy=None): super(BuildSettings, self).__init__() self.days_to_keep_deleted_builds_before_destroy = days_to_keep_deleted_builds_before_destroy self.default_retention_policy = default_retention_policy self.maximum_retention_policy = maximum_retention_policy class Change(Model): """Change. :param author: The author of the change. :type author: :class:`IdentityRef ` :param display_uri: The location of a user-friendly representation of the resource. :type display_uri: str :param id: The identifier for the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset ID. :type id: str :param location: The location of the full representation of the resource. :type location: str :param message: The description of the change. This might be a commit message or changeset description. :type message: str :param message_truncated: Indicates whether the message was truncated. :type message_truncated: bool :param pusher: The person or process that pushed the change. :type pusher: str :param timestamp: The timestamp for the change. :type timestamp: datetime :param type: The type of change. "commit", "changeset", etc. :type type: str """ _attribute_map = { 'author': {'key': 'author', 'type': 'IdentityRef'}, 'display_uri': {'key': 'displayUri', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'message_truncated': {'key': 'messageTruncated', 'type': 'bool'}, 'pusher': {'key': 'pusher', 'type': 'str'}, 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, author=None, display_uri=None, id=None, location=None, message=None, message_truncated=None, pusher=None, timestamp=None, type=None): super(Change, self).__init__() self.author = author self.display_uri = display_uri self.id = id self.location = location self.message = message self.message_truncated = message_truncated self.pusher = pusher self.timestamp = timestamp self.type = type class DataSourceBindingBase(Model): """DataSourceBindingBase. :param callback_context_template: Pagination format supported by this data source(ContinuationToken/SkipTop). :type callback_context_template: str :param callback_required_template: Subsequent calls needed? :type callback_required_template: str :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: Defines the initial value of the query params :type initial_context_template: str :param parameters: Gets or sets the parameters for the data source. :type parameters: dict :param result_selector: Gets or sets the result selector. :type result_selector: str :param result_template: Gets or sets the result template. :type result_template: str :param target: Gets or sets the target of the data source. :type target: str """ _attribute_map = { 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'}, 'result_template': {'key': 'resultTemplate', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, callback_context_template=None, callback_required_template=None, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, initial_context_template=None, parameters=None, result_selector=None, result_template=None, target=None): super(DataSourceBindingBase, self).__init__() self.callback_context_template = callback_context_template self.callback_required_template = callback_required_template self.data_source_name = data_source_name self.endpoint_id = endpoint_id self.endpoint_url = endpoint_url self.headers = headers self.initial_context_template = initial_context_template self.parameters = parameters self.result_selector = result_selector self.result_template = result_template self.target = target class DefinitionReference(Model): """DefinitionReference. :param created_date: The date the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None): super(DefinitionReference, self).__init__() self.created_date = created_date self.id = id self.name = name self.path = path self.project = project self.queue_status = queue_status self.revision = revision self.type = type self.uri = uri self.url = url class DefinitionResourceReference(Model): """DefinitionResourceReference. :param authorized: Indicates whether the resource is authorized for use. :type authorized: bool :param id: The id of the resource. :type id: str :param name: A friendly name for the resource. :type name: str :param type: The type of the resource. :type type: str """ _attribute_map = { 'authorized': {'key': 'authorized', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, authorized=None, id=None, name=None, type=None): super(DefinitionResourceReference, self).__init__() self.authorized = authorized self.id = id self.name = name self.type = type class Deployment(Model): """Deployment. :param type: :type type: str """ _attribute_map = { 'type': {'key': 'type', 'type': 'str'} } def __init__(self, type=None): super(Deployment, self).__init__() self.type = type class Folder(Model): """Folder. :param created_by: The process or person who created the folder. :type created_by: :class:`IdentityRef ` :param created_on: The date the folder was created. :type created_on: datetime :param description: The description. :type description: str :param last_changed_by: The process or person that last changed the folder. :type last_changed_by: :class:`IdentityRef ` :param last_changed_date: The date the folder was last changed. :type last_changed_date: datetime :param path: The full path. :type path: str :param project: The project. :type project: :class:`TeamProjectReference ` """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'last_changed_by': {'key': 'lastChangedBy', 'type': 'IdentityRef'}, 'last_changed_date': {'key': 'lastChangedDate', 'type': 'iso-8601'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'} } def __init__(self, created_by=None, created_on=None, description=None, last_changed_by=None, last_changed_date=None, path=None, project=None): super(Folder, self).__init__() self.created_by = created_by self.created_on = created_on self.description = description self.last_changed_by = last_changed_by self.last_changed_date = last_changed_date self.path = path self.project = project class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class Issue(Model): """Issue. :param category: The category. :type category: str :param data: :type data: dict :param message: A description of the issue. :type message: str :param type: The type (error, warning) of the issue. :type type: object """ _attribute_map = { 'category': {'key': 'category', 'type': 'str'}, 'data': {'key': 'data', 'type': '{str}'}, 'message': {'key': 'message', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, category=None, data=None, message=None, type=None): super(Issue, self).__init__() self.category = category self.data = data self.message = message self.type = type class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class ProcessParameters(Model): """ProcessParameters. :param data_source_bindings: :type data_source_bindings: list of :class:`DataSourceBindingBase ` :param inputs: :type inputs: list of :class:`TaskInputDefinitionBase ` :param source_definitions: :type source_definitions: list of :class:`TaskSourceDefinitionBase ` """ _attribute_map = { 'data_source_bindings': {'key': 'dataSourceBindings', 'type': '[DataSourceBindingBase]'}, 'inputs': {'key': 'inputs', 'type': '[TaskInputDefinitionBase]'}, 'source_definitions': {'key': 'sourceDefinitions', 'type': '[TaskSourceDefinitionBase]'} } def __init__(self, data_source_bindings=None, inputs=None, source_definitions=None): super(ProcessParameters, self).__init__() self.data_source_bindings = data_source_bindings self.inputs = inputs self.source_definitions = source_definitions class PullRequest(Model): """PullRequest. :param _links: The links to other objects related to this object. :type _links: :class:`ReferenceLinks ` :param author: Author of the pull request. :type author: :class:`IdentityRef ` :param current_state: Current state of the pull request, e.g. open, merged, closed, conflicts, etc. :type current_state: str :param description: Description for the pull request. :type description: str :param id: Unique identifier for the pull request :type id: str :param provider_name: The name of the provider this pull request is associated with. :type provider_name: str :param source_branch_ref: Source branch ref of this pull request :type source_branch_ref: str :param source_repository_owner: Owner of the source repository of this pull request :type source_repository_owner: str :param target_branch_ref: Target branch ref of this pull request :type target_branch_ref: str :param target_repository_owner: Owner of the target repository of this pull request :type target_repository_owner: str :param title: Title of the pull request. :type title: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'IdentityRef'}, 'current_state': {'key': 'currentState', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'provider_name': {'key': 'providerName', 'type': 'str'}, 'source_branch_ref': {'key': 'sourceBranchRef', 'type': 'str'}, 'source_repository_owner': {'key': 'sourceRepositoryOwner', 'type': 'str'}, 'target_branch_ref': {'key': 'targetBranchRef', 'type': 'str'}, 'target_repository_owner': {'key': 'targetRepositoryOwner', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'} } def __init__(self, _links=None, author=None, current_state=None, description=None, id=None, provider_name=None, source_branch_ref=None, source_repository_owner=None, target_branch_ref=None, target_repository_owner=None, title=None): super(PullRequest, self).__init__() self._links = _links self.author = author self.current_state = current_state self.description = description self.id = id self.provider_name = provider_name self.source_branch_ref = source_branch_ref self.source_repository_owner = source_repository_owner self.target_branch_ref = target_branch_ref self.target_repository_owner = target_repository_owner self.title = title class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class ReleaseReference(Model): """ReleaseReference. :param attempt: :type attempt: int :param creation_date: :type creation_date: datetime :param definition_id: Release definition ID. :type definition_id: int :param environment_creation_date: :type environment_creation_date: datetime :param environment_definition_id: Release environment definition ID. :type environment_definition_id: int :param environment_definition_name: Release environment definition name. :type environment_definition_name: str :param environment_id: Release environment ID. :type environment_id: int :param environment_name: Release environment name. :type environment_name: str :param id: Release ID. :type id: int :param name: Release name. :type name: str """ _attribute_map = { 'attempt': {'key': 'attempt', 'type': 'int'}, 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, 'definition_id': {'key': 'definitionId', 'type': 'int'}, 'environment_creation_date': {'key': 'environmentCreationDate', 'type': 'iso-8601'}, 'environment_definition_id': {'key': 'environmentDefinitionId', 'type': 'int'}, 'environment_definition_name': {'key': 'environmentDefinitionName', 'type': 'str'}, 'environment_id': {'key': 'environmentId', 'type': 'int'}, 'environment_name': {'key': 'environmentName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, attempt=None, creation_date=None, definition_id=None, environment_creation_date=None, environment_definition_id=None, environment_definition_name=None, environment_id=None, environment_name=None, id=None, name=None): super(ReleaseReference, self).__init__() self.attempt = attempt self.creation_date = creation_date self.definition_id = definition_id self.environment_creation_date = environment_creation_date self.environment_definition_id = environment_definition_id self.environment_definition_name = environment_definition_name self.environment_id = environment_id self.environment_name = environment_name self.id = id self.name = name class RepositoryWebhook(Model): """RepositoryWebhook. :param name: The friendly name of the repository. :type name: str :param types: :type types: list of DefinitionTriggerType :param url: The URL of the repository. :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'types': {'key': 'types', 'type': '[object]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, types=None, url=None): super(RepositoryWebhook, self).__init__() self.name = name self.types = types self.url = url class ResourceRef(Model): """ResourceRef. :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(ResourceRef, self).__init__() self.id = id self.url = url class RetentionPolicy(Model): """RetentionPolicy. :param artifacts: :type artifacts: list of str :param artifact_types_to_delete: :type artifact_types_to_delete: list of str :param branches: :type branches: list of str :param days_to_keep: The number of days to keep builds. :type days_to_keep: int :param delete_build_record: Indicates whether the build record itself should be deleted. :type delete_build_record: bool :param delete_test_results: Indicates whether to delete test results associated with the build. :type delete_test_results: bool :param minimum_to_keep: The minimum number of builds to keep. :type minimum_to_keep: int """ _attribute_map = { 'artifacts': {'key': 'artifacts', 'type': '[str]'}, 'artifact_types_to_delete': {'key': 'artifactTypesToDelete', 'type': '[str]'}, 'branches': {'key': 'branches', 'type': '[str]'}, 'days_to_keep': {'key': 'daysToKeep', 'type': 'int'}, 'delete_build_record': {'key': 'deleteBuildRecord', 'type': 'bool'}, 'delete_test_results': {'key': 'deleteTestResults', 'type': 'bool'}, 'minimum_to_keep': {'key': 'minimumToKeep', 'type': 'int'} } def __init__(self, artifacts=None, artifact_types_to_delete=None, branches=None, days_to_keep=None, delete_build_record=None, delete_test_results=None, minimum_to_keep=None): super(RetentionPolicy, self).__init__() self.artifacts = artifacts self.artifact_types_to_delete = artifact_types_to_delete self.branches = branches self.days_to_keep = days_to_keep self.delete_build_record = delete_build_record self.delete_test_results = delete_test_results self.minimum_to_keep = minimum_to_keep class SourceProviderAttributes(Model): """SourceProviderAttributes. :param name: The name of the source provider. :type name: str :param supported_capabilities: The capabilities supported by this source provider. :type supported_capabilities: dict :param supported_triggers: The types of triggers supported by this source provider. :type supported_triggers: list of :class:`SupportedTrigger ` """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'supported_capabilities': {'key': 'supportedCapabilities', 'type': '{bool}'}, 'supported_triggers': {'key': 'supportedTriggers', 'type': '[SupportedTrigger]'} } def __init__(self, name=None, supported_capabilities=None, supported_triggers=None): super(SourceProviderAttributes, self).__init__() self.name = name self.supported_capabilities = supported_capabilities self.supported_triggers = supported_triggers class SourceRepositories(Model): """SourceRepositories. :param continuation_token: A token used to continue this paged request; 'null' if the request is complete :type continuation_token: str :param page_length: The number of repositories requested for each page :type page_length: int :param repositories: A list of repositories :type repositories: list of :class:`SourceRepository ` :param total_page_count: The total number of pages, or '-1' if unknown :type total_page_count: int """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, 'page_length': {'key': 'pageLength', 'type': 'int'}, 'repositories': {'key': 'repositories', 'type': '[SourceRepository]'}, 'total_page_count': {'key': 'totalPageCount', 'type': 'int'} } def __init__(self, continuation_token=None, page_length=None, repositories=None, total_page_count=None): super(SourceRepositories, self).__init__() self.continuation_token = continuation_token self.page_length = page_length self.repositories = repositories self.total_page_count = total_page_count class SourceRepository(Model): """SourceRepository. :param default_branch: The name of the default branch. :type default_branch: str :param full_name: The full name of the repository. :type full_name: str :param id: The ID of the repository. :type id: str :param name: The friendly name of the repository. :type name: str :param properties: :type properties: dict :param source_provider_name: The name of the source provider the repository is from. :type source_provider_name: str :param url: The URL of the repository. :type url: str """ _attribute_map = { 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, 'full_name': {'key': 'fullName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'source_provider_name': {'key': 'sourceProviderName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, default_branch=None, full_name=None, id=None, name=None, properties=None, source_provider_name=None, url=None): super(SourceRepository, self).__init__() self.default_branch = default_branch self.full_name = full_name self.id = id self.name = name self.properties = properties self.source_provider_name = source_provider_name self.url = url class SourceRepositoryItem(Model): """SourceRepositoryItem. :param is_container: Whether the item is able to have sub-items (e.g., is a folder). :type is_container: bool :param path: The full path of the item, relative to the root of the repository. :type path: str :param type: The type of the item (folder, file, etc). :type type: str :param url: The URL of the item. :type url: str """ _attribute_map = { 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'path': {'key': 'path', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, is_container=None, path=None, type=None, url=None): super(SourceRepositoryItem, self).__init__() self.is_container = is_container self.path = path self.type = type self.url = url class SupportedTrigger(Model): """SupportedTrigger. :param default_polling_interval: The default interval to wait between polls (only relevant when NotificationType is Polling). :type default_polling_interval: int :param notification_type: How the trigger is notified of changes. :type notification_type: str :param supported_capabilities: The capabilities supported by this trigger. :type supported_capabilities: dict :param type: The type of trigger. :type type: object """ _attribute_map = { 'default_polling_interval': {'key': 'defaultPollingInterval', 'type': 'int'}, 'notification_type': {'key': 'notificationType', 'type': 'str'}, 'supported_capabilities': {'key': 'supportedCapabilities', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, default_polling_interval=None, notification_type=None, supported_capabilities=None, type=None): super(SupportedTrigger, self).__init__() self.default_polling_interval = default_polling_interval self.notification_type = notification_type self.supported_capabilities = supported_capabilities self.type = type class TaskAgentPoolReference(Model): """TaskAgentPoolReference. :param id: The pool ID. :type id: int :param is_hosted: A value indicating whether or not this pool is managed by the service. :type is_hosted: bool :param name: The pool name. :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'is_hosted': {'key': 'isHosted', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, is_hosted=None, name=None): super(TaskAgentPoolReference, self).__init__() self.id = id self.is_hosted = is_hosted self.name = name class TaskDefinitionReference(Model): """TaskDefinitionReference. :param definition_type: The type of task (task or task group). :type definition_type: str :param id: The ID of the task. :type id: str :param version_spec: The version of the task. :type version_spec: str """ _attribute_map = { 'definition_type': {'key': 'definitionType', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'version_spec': {'key': 'versionSpec', 'type': 'str'} } def __init__(self, definition_type=None, id=None, version_spec=None): super(TaskDefinitionReference, self).__init__() self.definition_type = definition_type self.id = id self.version_spec = version_spec class TaskInputDefinitionBase(Model): """TaskInputDefinitionBase. :param aliases: :type aliases: list of str :param default_value: :type default_value: str :param group_name: :type group_name: str :param help_mark_down: :type help_mark_down: str :param label: :type label: str :param name: :type name: str :param options: :type options: dict :param properties: :type properties: dict :param required: :type required: bool :param type: :type type: str :param validation: :type validation: :class:`TaskInputValidation ` :param visible_rule: :type visible_rule: str """ _attribute_map = { 'aliases': {'key': 'aliases', 'type': '[str]'}, 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'options': {'key': 'options', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'str'}, 'validation': {'key': 'validation', 'type': 'TaskInputValidation'}, 'visible_rule': {'key': 'visibleRule', 'type': 'str'} } def __init__(self, aliases=None, default_value=None, group_name=None, help_mark_down=None, label=None, name=None, options=None, properties=None, required=None, type=None, validation=None, visible_rule=None): super(TaskInputDefinitionBase, self).__init__() self.aliases = aliases self.default_value = default_value self.group_name = group_name self.help_mark_down = help_mark_down self.label = label self.name = name self.options = options self.properties = properties self.required = required self.type = type self.validation = validation self.visible_rule = visible_rule class TaskInputValidation(Model): """TaskInputValidation. :param expression: Conditional expression :type expression: str :param message: Message explaining how user can correct if validation fails :type message: str """ _attribute_map = { 'expression': {'key': 'expression', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'} } def __init__(self, expression=None, message=None): super(TaskInputValidation, self).__init__() self.expression = expression self.message = message class TaskOrchestrationPlanReference(Model): """TaskOrchestrationPlanReference. :param orchestration_type: The type of the plan. :type orchestration_type: int :param plan_id: The ID of the plan. :type plan_id: str """ _attribute_map = { 'orchestration_type': {'key': 'orchestrationType', 'type': 'int'}, 'plan_id': {'key': 'planId', 'type': 'str'} } def __init__(self, orchestration_type=None, plan_id=None): super(TaskOrchestrationPlanReference, self).__init__() self.orchestration_type = orchestration_type self.plan_id = plan_id class TaskReference(Model): """TaskReference. :param id: The ID of the task definition. :type id: str :param name: The name of the task definition. :type name: str :param version: The version of the task definition. :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, name=None, version=None): super(TaskReference, self).__init__() self.id = id self.name = name self.version = version class TaskSourceDefinitionBase(Model): """TaskSourceDefinitionBase. :param auth_key: :type auth_key: str :param endpoint: :type endpoint: str :param key_selector: :type key_selector: str :param selector: :type selector: str :param target: :type target: str """ _attribute_map = { 'auth_key': {'key': 'authKey', 'type': 'str'}, 'endpoint': {'key': 'endpoint', 'type': 'str'}, 'key_selector': {'key': 'keySelector', 'type': 'str'}, 'selector': {'key': 'selector', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, auth_key=None, endpoint=None, key_selector=None, selector=None, target=None): super(TaskSourceDefinitionBase, self).__init__() self.auth_key = auth_key self.endpoint = endpoint self.key_selector = key_selector self.selector = selector self.target = target class TeamProjectReference(Model): """TeamProjectReference. :param abbreviation: Project abbreviation. :type abbreviation: str :param default_team_image_url: Url to default team identity image. :type default_team_image_url: str :param description: The project's description (if any). :type description: str :param id: Project identifier. :type id: str :param name: Project name. :type name: str :param revision: Project revision. :type revision: long :param state: Project state. :type state: object :param url: Url to the full version of the object. :type url: str :param visibility: Project visibility. :type visibility: object """ _attribute_map = { 'abbreviation': {'key': 'abbreviation', 'type': 'str'}, 'default_team_image_url': {'key': 'defaultTeamImageUrl', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'long'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'visibility': {'key': 'visibility', 'type': 'object'} } def __init__(self, abbreviation=None, default_team_image_url=None, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): super(TeamProjectReference, self).__init__() self.abbreviation = abbreviation self.default_team_image_url = default_team_image_url self.description = description self.id = id self.name = name self.revision = revision self.state = state self.url = url self.visibility = visibility class TestResultsContext(Model): """TestResultsContext. :param build: :type build: :class:`BuildReference ` :param context_type: :type context_type: object :param release: :type release: :class:`ReleaseReference ` """ _attribute_map = { 'build': {'key': 'build', 'type': 'BuildReference'}, 'context_type': {'key': 'contextType', 'type': 'object'}, 'release': {'key': 'release', 'type': 'ReleaseReference'} } def __init__(self, build=None, context_type=None, release=None): super(TestResultsContext, self).__init__() self.build = build self.context_type = context_type self.release = release class TimelineAttempt(Model): """TimelineAttempt. :param attempt: Gets or sets the attempt of the record. :type attempt: int :param record_id: Gets or sets the record identifier located within the specified timeline. :type record_id: str :param timeline_id: Gets or sets the timeline identifier which owns the record representing this attempt. :type timeline_id: str """ _attribute_map = { 'attempt': {'key': 'attempt', 'type': 'int'}, 'record_id': {'key': 'recordId', 'type': 'str'}, 'timeline_id': {'key': 'timelineId', 'type': 'str'} } def __init__(self, attempt=None, record_id=None, timeline_id=None): super(TimelineAttempt, self).__init__() self.attempt = attempt self.record_id = record_id self.timeline_id = timeline_id class TimelineRecord(Model): """TimelineRecord. :param _links: :type _links: :class:`ReferenceLinks ` :param attempt: :type attempt: int :param change_id: The change ID. :type change_id: int :param current_operation: A string that indicates the current operation. :type current_operation: str :param details: A reference to a sub-timeline. :type details: :class:`TimelineReference ` :param error_count: The number of errors produced by this operation. :type error_count: int :param finish_time: The finish time. :type finish_time: datetime :param id: The ID of the record. :type id: str :param issues: :type issues: list of :class:`Issue ` :param last_modified: The time the record was last modified. :type last_modified: datetime :param log: A reference to the log produced by this operation. :type log: :class:`BuildLogReference ` :param name: The name. :type name: str :param order: An ordinal value relative to other records. :type order: int :param parent_id: The ID of the record's parent. :type parent_id: str :param percent_complete: The current completion percentage. :type percent_complete: int :param previous_attempts: :type previous_attempts: list of :class:`TimelineAttempt ` :param result: The result. :type result: object :param result_code: The result code. :type result_code: str :param start_time: The start time. :type start_time: datetime :param state: The state of the record. :type state: object :param task: A reference to the task represented by this timeline record. :type task: :class:`TaskReference ` :param type: The type of the record. :type type: str :param url: The REST URL of the timeline record. :type url: str :param warning_count: The number of warnings produced by this operation. :type warning_count: int :param worker_name: The name of the agent running the operation. :type worker_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'attempt': {'key': 'attempt', 'type': 'int'}, 'change_id': {'key': 'changeId', 'type': 'int'}, 'current_operation': {'key': 'currentOperation', 'type': 'str'}, 'details': {'key': 'details', 'type': 'TimelineReference'}, 'error_count': {'key': 'errorCount', 'type': 'int'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'issues': {'key': 'issues', 'type': '[Issue]'}, 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, 'log': {'key': 'log', 'type': 'BuildLogReference'}, 'name': {'key': 'name', 'type': 'str'}, 'order': {'key': 'order', 'type': 'int'}, 'parent_id': {'key': 'parentId', 'type': 'str'}, 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, 'previous_attempts': {'key': 'previousAttempts', 'type': '[TimelineAttempt]'}, 'result': {'key': 'result', 'type': 'object'}, 'result_code': {'key': 'resultCode', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'state': {'key': 'state', 'type': 'object'}, 'task': {'key': 'task', 'type': 'TaskReference'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'warning_count': {'key': 'warningCount', 'type': 'int'}, 'worker_name': {'key': 'workerName', 'type': 'str'} } def __init__(self, _links=None, attempt=None, change_id=None, current_operation=None, details=None, error_count=None, finish_time=None, id=None, issues=None, last_modified=None, log=None, name=None, order=None, parent_id=None, percent_complete=None, previous_attempts=None, result=None, result_code=None, start_time=None, state=None, task=None, type=None, url=None, warning_count=None, worker_name=None): super(TimelineRecord, self).__init__() self._links = _links self.attempt = attempt self.change_id = change_id self.current_operation = current_operation self.details = details self.error_count = error_count self.finish_time = finish_time self.id = id self.issues = issues self.last_modified = last_modified self.log = log self.name = name self.order = order self.parent_id = parent_id self.percent_complete = percent_complete self.previous_attempts = previous_attempts self.result = result self.result_code = result_code self.start_time = start_time self.state = state self.task = task self.type = type self.url = url self.warning_count = warning_count self.worker_name = worker_name class TimelineReference(Model): """TimelineReference. :param change_id: The change ID. :type change_id: int :param id: The ID of the timeline. :type id: str :param url: The REST URL of the timeline. :type url: str """ _attribute_map = { 'change_id': {'key': 'changeId', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, change_id=None, id=None, url=None): super(TimelineReference, self).__init__() self.change_id = change_id self.id = id self.url = url class VariableGroupReference(Model): """VariableGroupReference. :param alias: The Name of the variable group. :type alias: str :param id: The ID of the variable group. :type id: int """ _attribute_map = { 'alias': {'key': 'alias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'} } def __init__(self, alias=None, id=None): super(VariableGroupReference, self).__init__() self.alias = alias self.id = id class WebApiConnectedServiceRef(Model): """WebApiConnectedServiceRef. :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(WebApiConnectedServiceRef, self).__init__() self.id = id self.url = url class XamlBuildControllerReference(Model): """XamlBuildControllerReference. :param id: Id of the resource :type id: int :param name: Name of the linked resource (definition name, controller name, etc.) :type name: str :param url: Full http link to the resource :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, name=None, url=None): super(XamlBuildControllerReference, self).__init__() self.id = id self.name = name self.url = url class BuildController(XamlBuildControllerReference): """BuildController. :param id: Id of the resource :type id: int :param name: Name of the linked resource (definition name, controller name, etc.) :type name: str :param url: Full http link to the resource :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param created_date: The date the controller was created. :type created_date: datetime :param description: The description of the controller. :type description: str :param enabled: Indicates whether the controller is enabled. :type enabled: bool :param status: The status of the controller. :type status: object :param updated_date: The date the controller was last updated. :type updated_date: datetime :param uri: The controller's URI. :type uri: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'status': {'key': 'status', 'type': 'object'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'uri': {'key': 'uri', 'type': 'str'} } def __init__(self, id=None, name=None, url=None, _links=None, created_date=None, description=None, enabled=None, status=None, updated_date=None, uri=None): super(BuildController, self).__init__(id=id, name=name, url=url) self._links = _links self.created_date = created_date self.description = description self.enabled = enabled self.status = status self.updated_date = updated_date self.uri = uri class BuildDefinitionReference(DefinitionReference): """BuildDefinitionReference. :param created_date: The date the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. :type drafts: list of :class:`DefinitionReference ` :param latest_build: :type latest_build: :class:`Build ` :param latest_completed_build: :type latest_completed_build: :class:`Build ` :param metrics: :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. :type queue: :class:`AgentPoolQueue ` """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'authored_by': {'key': 'authoredBy', 'type': 'IdentityRef'}, 'draft_of': {'key': 'draftOf', 'type': 'DefinitionReference'}, 'drafts': {'key': 'drafts', 'type': '[DefinitionReference]'}, 'latest_build': {'key': 'latestBuild', 'type': 'Build'}, 'latest_completed_build': {'key': 'latestCompletedBuild', 'type': 'Build'}, 'metrics': {'key': 'metrics', 'type': '[BuildMetric]'}, 'quality': {'key': 'quality', 'type': 'object'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, latest_build=None, latest_completed_build=None, metrics=None, quality=None, queue=None): super(BuildDefinitionReference, self).__init__(created_date=created_date, id=id, name=name, path=path, project=project, queue_status=queue_status, revision=revision, type=type, uri=uri, url=url) self._links = _links self.authored_by = authored_by self.draft_of = draft_of self.drafts = drafts self.latest_build = latest_build self.latest_completed_build = latest_completed_build self.metrics = metrics self.quality = quality self.queue = queue class BuildDefinitionReference3_2(DefinitionReference): """BuildDefinitionReference3_2. :param created_date: The date the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. :type drafts: list of :class:`DefinitionReference ` :param metrics: :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. :type queue: :class:`AgentPoolQueue ` """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'authored_by': {'key': 'authoredBy', 'type': 'IdentityRef'}, 'draft_of': {'key': 'draftOf', 'type': 'DefinitionReference'}, 'drafts': {'key': 'drafts', 'type': '[DefinitionReference]'}, 'metrics': {'key': 'metrics', 'type': '[BuildMetric]'}, 'quality': {'key': 'quality', 'type': 'object'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, metrics=None, quality=None, queue=None): super(BuildDefinitionReference3_2, self).__init__(created_date=created_date, id=id, name=name, path=path, project=project, queue_status=queue_status, revision=revision, type=type, uri=uri, url=url) self._links = _links self.authored_by = authored_by self.draft_of = draft_of self.drafts = drafts self.metrics = metrics self.quality = quality self.queue = queue class BuildLog(BuildLogReference): """BuildLog. :param id: The ID of the log. :type id: int :param type: The type of the log location. :type type: str :param url: A full link to the log resource. :type url: str :param created_on: The date and time the log was created. :type created_on: datetime :param last_changed_on: The date and time the log was last changed. :type last_changed_on: datetime :param line_count: The number of lines in the log. :type line_count: long """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'last_changed_on': {'key': 'lastChangedOn', 'type': 'iso-8601'}, 'line_count': {'key': 'lineCount', 'type': 'long'} } def __init__(self, id=None, type=None, url=None, created_on=None, last_changed_on=None, line_count=None): super(BuildLog, self).__init__(id=id, type=type, url=url) self.created_on = created_on self.last_changed_on = last_changed_on self.line_count = line_count class BuildOptionDefinition(BuildOptionDefinitionReference): """BuildOptionDefinition. :param id: The ID of the referenced build option. :type id: str :param description: The description. :type description: str :param groups: The list of input groups defined for the build option. :type groups: list of :class:`BuildOptionGroupDefinition ` :param inputs: The list of inputs defined for the build option. :type inputs: list of :class:`BuildOptionInputDefinition ` :param name: The name of the build option. :type name: str :param ordinal: A value that indicates the relative order in which the behavior should be applied. :type ordinal: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'groups': {'key': 'groups', 'type': '[BuildOptionGroupDefinition]'}, 'inputs': {'key': 'inputs', 'type': '[BuildOptionInputDefinition]'}, 'name': {'key': 'name', 'type': 'str'}, 'ordinal': {'key': 'ordinal', 'type': 'int'} } def __init__(self, id=None, description=None, groups=None, inputs=None, name=None, ordinal=None): super(BuildOptionDefinition, self).__init__(id=id) self.description = description self.groups = groups self.inputs = inputs self.name = name self.ordinal = ordinal class Timeline(TimelineReference): """Timeline. :param change_id: The change ID. :type change_id: int :param id: The ID of the timeline. :type id: str :param url: The REST URL of the timeline. :type url: str :param last_changed_by: The process or person that last changed the timeline. :type last_changed_by: str :param last_changed_on: The time the timeline was last changed. :type last_changed_on: datetime :param records: :type records: list of :class:`TimelineRecord ` """ _attribute_map = { 'change_id': {'key': 'changeId', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'last_changed_by': {'key': 'lastChangedBy', 'type': 'str'}, 'last_changed_on': {'key': 'lastChangedOn', 'type': 'iso-8601'}, 'records': {'key': 'records', 'type': '[TimelineRecord]'} } def __init__(self, change_id=None, id=None, url=None, last_changed_by=None, last_changed_on=None, records=None): super(Timeline, self).__init__(change_id=change_id, id=id, url=url) self.last_changed_by = last_changed_by self.last_changed_on = last_changed_on self.records = records class VariableGroup(VariableGroupReference): """VariableGroup. :param alias: The Name of the variable group. :type alias: str :param id: The ID of the variable group. :type id: int :param description: The description. :type description: str :param name: The name of the variable group. :type name: str :param type: The type of the variable group. :type type: str :param variables: :type variables: dict """ _attribute_map = { 'alias': {'key': 'alias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'variables': {'key': 'variables', 'type': '{BuildDefinitionVariable}'} } def __init__(self, alias=None, id=None, description=None, name=None, type=None, variables=None): super(VariableGroup, self).__init__(alias=alias, id=id) self.description = description self.name = name self.type = type self.variables = variables class BuildDefinition(BuildDefinitionReference): """BuildDefinition. :param created_date: The date the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. :type drafts: list of :class:`DefinitionReference ` :param latest_build: :type latest_build: :class:`Build ` :param latest_completed_build: :type latest_completed_build: :class:`Build ` :param metrics: :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. :type queue: :class:`AgentPoolQueue ` :param badge_enabled: Indicates whether badges are enabled for this definition. :type badge_enabled: bool :param build_number_format: The build number format. :type build_number_format: str :param comment: A save-time comment for the definition. :type comment: str :param demands: :type demands: list of :class:`object ` :param description: The description. :type description: str :param drop_location: The drop location for the definition. :type drop_location: str :param job_authorization_scope: The job authorization scope for builds queued against this definition. :type job_authorization_scope: object :param job_cancel_timeout_in_minutes: The job cancel timeout (in minutes) for builds cancelled by user for this definition. :type job_cancel_timeout_in_minutes: int :param job_timeout_in_minutes: The job execution timeout (in minutes) for builds queued against this definition. :type job_timeout_in_minutes: int :param options: :type options: list of :class:`BuildOption ` :param process: The build process. :type process: :class:`object ` :param process_parameters: The process parameters for this definition. :type process_parameters: :class:`ProcessParameters ` :param properties: :type properties: :class:`object ` :param repository: The repository. :type repository: :class:`BuildRepository ` :param retention_rules: :type retention_rules: list of :class:`RetentionPolicy ` :param tags: :type tags: list of str :param triggers: :type triggers: list of :class:`object ` :param variable_groups: :type variable_groups: list of :class:`VariableGroup ` :param variables: :type variables: dict """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'authored_by': {'key': 'authoredBy', 'type': 'IdentityRef'}, 'draft_of': {'key': 'draftOf', 'type': 'DefinitionReference'}, 'drafts': {'key': 'drafts', 'type': '[DefinitionReference]'}, 'latest_build': {'key': 'latestBuild', 'type': 'Build'}, 'latest_completed_build': {'key': 'latestCompletedBuild', 'type': 'Build'}, 'metrics': {'key': 'metrics', 'type': '[BuildMetric]'}, 'quality': {'key': 'quality', 'type': 'object'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'}, 'badge_enabled': {'key': 'badgeEnabled', 'type': 'bool'}, 'build_number_format': {'key': 'buildNumberFormat', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'description': {'key': 'description', 'type': 'str'}, 'drop_location': {'key': 'dropLocation', 'type': 'str'}, 'job_authorization_scope': {'key': 'jobAuthorizationScope', 'type': 'object'}, 'job_cancel_timeout_in_minutes': {'key': 'jobCancelTimeoutInMinutes', 'type': 'int'}, 'job_timeout_in_minutes': {'key': 'jobTimeoutInMinutes', 'type': 'int'}, 'options': {'key': 'options', 'type': '[BuildOption]'}, 'process': {'key': 'process', 'type': 'object'}, 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, 'properties': {'key': 'properties', 'type': 'object'}, 'repository': {'key': 'repository', 'type': 'BuildRepository'}, 'retention_rules': {'key': 'retentionRules', 'type': '[RetentionPolicy]'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'triggers': {'key': 'triggers', 'type': '[object]'}, 'variable_groups': {'key': 'variableGroups', 'type': '[VariableGroup]'}, 'variables': {'key': 'variables', 'type': '{BuildDefinitionVariable}'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, latest_build=None, latest_completed_build=None, metrics=None, quality=None, queue=None, badge_enabled=None, build_number_format=None, comment=None, demands=None, description=None, drop_location=None, job_authorization_scope=None, job_cancel_timeout_in_minutes=None, job_timeout_in_minutes=None, options=None, process=None, process_parameters=None, properties=None, repository=None, retention_rules=None, tags=None, triggers=None, variable_groups=None, variables=None): super(BuildDefinition, self).__init__(created_date=created_date, id=id, name=name, path=path, project=project, queue_status=queue_status, revision=revision, type=type, uri=uri, url=url, _links=_links, authored_by=authored_by, draft_of=draft_of, drafts=drafts, latest_build=latest_build, latest_completed_build=latest_completed_build, metrics=metrics, quality=quality, queue=queue) self.badge_enabled = badge_enabled self.build_number_format = build_number_format self.comment = comment self.demands = demands self.description = description self.drop_location = drop_location self.job_authorization_scope = job_authorization_scope self.job_cancel_timeout_in_minutes = job_cancel_timeout_in_minutes self.job_timeout_in_minutes = job_timeout_in_minutes self.options = options self.process = process self.process_parameters = process_parameters self.properties = properties self.repository = repository self.retention_rules = retention_rules self.tags = tags self.triggers = triggers self.variable_groups = variable_groups self.variables = variables class BuildDefinition3_2(BuildDefinitionReference3_2): """BuildDefinition3_2. :param created_date: The date the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. :type drafts: list of :class:`DefinitionReference ` :param metrics: :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. :type queue: :class:`AgentPoolQueue ` :param badge_enabled: Indicates whether badges are enabled for this definition :type badge_enabled: bool :param build: :type build: list of :class:`BuildDefinitionStep ` :param build_number_format: The build number format :type build_number_format: str :param comment: The comment entered when saving the definition :type comment: str :param demands: :type demands: list of :class:`object ` :param description: The description :type description: str :param drop_location: The drop location for the definition :type drop_location: str :param job_authorization_scope: The job authorization scope for builds which are queued against this definition :type job_authorization_scope: object :param job_cancel_timeout_in_minutes: The job cancel timeout in minutes for builds which are cancelled by user for this definition :type job_cancel_timeout_in_minutes: int :param job_timeout_in_minutes: The job execution timeout in minutes for builds which are queued against this definition :type job_timeout_in_minutes: int :param latest_build: :type latest_build: :class:`Build ` :param latest_completed_build: :type latest_completed_build: :class:`Build ` :param options: :type options: list of :class:`BuildOption ` :param process_parameters: Process Parameters :type process_parameters: :class:`ProcessParameters ` :param properties: :type properties: :class:`object ` :param repository: The repository :type repository: :class:`BuildRepository ` :param retention_rules: :type retention_rules: list of :class:`RetentionPolicy ` :param tags: :type tags: list of str :param triggers: :type triggers: list of :class:`object ` :param variables: :type variables: dict """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'authored_by': {'key': 'authoredBy', 'type': 'IdentityRef'}, 'draft_of': {'key': 'draftOf', 'type': 'DefinitionReference'}, 'drafts': {'key': 'drafts', 'type': '[DefinitionReference]'}, 'metrics': {'key': 'metrics', 'type': '[BuildMetric]'}, 'quality': {'key': 'quality', 'type': 'object'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'}, 'badge_enabled': {'key': 'badgeEnabled', 'type': 'bool'}, 'build': {'key': 'build', 'type': '[BuildDefinitionStep]'}, 'build_number_format': {'key': 'buildNumberFormat', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'description': {'key': 'description', 'type': 'str'}, 'drop_location': {'key': 'dropLocation', 'type': 'str'}, 'job_authorization_scope': {'key': 'jobAuthorizationScope', 'type': 'object'}, 'job_cancel_timeout_in_minutes': {'key': 'jobCancelTimeoutInMinutes', 'type': 'int'}, 'job_timeout_in_minutes': {'key': 'jobTimeoutInMinutes', 'type': 'int'}, 'latest_build': {'key': 'latestBuild', 'type': 'Build'}, 'latest_completed_build': {'key': 'latestCompletedBuild', 'type': 'Build'}, 'options': {'key': 'options', 'type': '[BuildOption]'}, 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, 'properties': {'key': 'properties', 'type': 'object'}, 'repository': {'key': 'repository', 'type': 'BuildRepository'}, 'retention_rules': {'key': 'retentionRules', 'type': '[RetentionPolicy]'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'triggers': {'key': 'triggers', 'type': '[object]'}, 'variables': {'key': 'variables', 'type': '{BuildDefinitionVariable}'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, metrics=None, quality=None, queue=None, badge_enabled=None, build=None, build_number_format=None, comment=None, demands=None, description=None, drop_location=None, job_authorization_scope=None, job_cancel_timeout_in_minutes=None, job_timeout_in_minutes=None, latest_build=None, latest_completed_build=None, options=None, process_parameters=None, properties=None, repository=None, retention_rules=None, tags=None, triggers=None, variables=None): super(BuildDefinition3_2, self).__init__(created_date=created_date, id=id, name=name, path=path, project=project, queue_status=queue_status, revision=revision, type=type, uri=uri, url=url, _links=_links, authored_by=authored_by, draft_of=draft_of, drafts=drafts, metrics=metrics, quality=quality, queue=queue) self.badge_enabled = badge_enabled self.build = build self.build_number_format = build_number_format self.comment = comment self.demands = demands self.description = description self.drop_location = drop_location self.job_authorization_scope = job_authorization_scope self.job_cancel_timeout_in_minutes = job_cancel_timeout_in_minutes self.job_timeout_in_minutes = job_timeout_in_minutes self.latest_build = latest_build self.latest_completed_build = latest_completed_build self.options = options self.process_parameters = process_parameters self.properties = properties self.repository = repository self.retention_rules = retention_rules self.tags = tags self.triggers = triggers self.variables = variables __all__ = [ 'AgentPoolQueue', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', 'AggregatedRunsByOutcome', 'AggregatedRunsByState', 'ArtifactResource', 'AssociatedWorkItem', 'Attachment', 'AuthorizationHeader', 'Build', 'BuildArtifact', 'BuildBadge', 'BuildDefinitionRevision', 'BuildDefinitionStep', 'BuildDefinitionTemplate', 'BuildDefinitionTemplate3_2', 'BuildDefinitionVariable', 'BuildLogReference', 'BuildMetric', 'BuildOption', 'BuildOptionDefinitionReference', 'BuildOptionGroupDefinition', 'BuildOptionInputDefinition', 'BuildReportMetadata', 'BuildRepository', 'BuildRequestValidationResult', 'BuildResourceUsage', 'BuildSettings', 'Change', 'DataSourceBindingBase', 'DefinitionReference', 'DefinitionResourceReference', 'Deployment', 'Folder', 'GraphSubjectBase', 'IdentityRef', 'Issue', 'JsonPatchOperation', 'ProcessParameters', 'PullRequest', 'ReferenceLinks', 'ReleaseReference', 'RepositoryWebhook', 'ResourceRef', 'RetentionPolicy', 'SourceProviderAttributes', 'SourceRepositories', 'SourceRepository', 'SourceRepositoryItem', 'SupportedTrigger', 'TaskAgentPoolReference', 'TaskDefinitionReference', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskOrchestrationPlanReference', 'TaskReference', 'TaskSourceDefinitionBase', 'TeamProjectReference', 'TestResultsContext', 'TimelineAttempt', 'TimelineRecord', 'TimelineReference', 'VariableGroupReference', 'WebApiConnectedServiceRef', 'XamlBuildControllerReference', 'BuildController', 'BuildDefinitionReference', 'BuildDefinitionReference3_2', 'BuildLog', 'BuildOptionDefinition', 'Timeline', 'VariableGroup', 'BuildDefinition', 'BuildDefinition3_2', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/client_factory.py000066400000000000000000000461741360605530400324500ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- class ClientFactoryV5_0(object): """ClientFactoryV5_0. A factory class to get the 5.0 clients. """ def __init__(self, connection): self._connection = connection def get_accounts_client(self): """get_accounts_client. Gets the 5.0 version of the AccountsClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.accounts.accounts_client.AccountsClient') def get_boards_client(self): """get_boards_client. Gets the 5.0 version of the BoardsClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.boards.boards_client.BoardsClient') def get_build_client(self): """get_build_client. Gets the 5.0 version of the BuildClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.build.build_client.BuildClient') def get_client_trace_client(self): """get_client_trace_client. Gets the 5.0 version of the ClientTraceClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.client_trace.client_trace_client.ClientTraceClient') def get_cloud_load_test_client(self): """get_cloud_load_test_client. Gets the 5.0 version of the CloudLoadTestClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.cloud_load_test.cloud_load_test_client.CloudLoadTestClient') def get_contributions_client(self): """get_contributions_client. Gets the 5.0 version of the ContributionsClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.contributions.contributions_client.ContributionsClient') def get_core_client(self): """get_core_client. Gets the 5.0 version of the CoreClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.core.core_client.CoreClient') def get_customer_intelligence_client(self): """get_customer_intelligence_client. Gets the 5.0 version of the CustomerIntelligenceClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.customer_intelligence.customer_intelligence_client.CustomerIntelligenceClient') def get_dashboard_client(self): """get_dashboard_client. Gets the 5.0 version of the DashboardClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.dashboard.dashboard_client.DashboardClient') def get_extension_management_client(self): """get_extension_management_client. Gets the 5.0 version of the ExtensionManagementClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.extension_management.extension_management_client.ExtensionManagementClient') def get_feature_availability_client(self): """get_feature_availability_client. Gets the 5.0 version of the FeatureAvailabilityClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.feature_availability.feature_availability_client.FeatureAvailabilityClient') def get_feature_management_client(self): """get_feature_management_client. Gets the 5.0 version of the FeatureManagementClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.feature_management.feature_management_client.FeatureManagementClient') def get_feed_client(self): """get_feed_client. Gets the 5.0 version of the FeedClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.feed.feed_client.FeedClient') def get_feed_token_client(self): """get_feed_token_client. Gets the 5.0 version of the FeedTokenClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.feed_token.feed_token_client.FeedTokenClient') def get_file_container_client(self): """get_file_container_client. Gets the 5.0 version of the FileContainerClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.file_container.file_container_client.FileContainerClient') def get_gallery_client(self): """get_gallery_client. Gets the 5.0 version of the GalleryClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.gallery.gallery_client.GalleryClient') def get_git_client(self): """get_git_client. Gets the 5.0 version of the GitClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.git.git_client.GitClient') def get_graph_client(self): """get_graph_client. Gets the 5.0 version of the GraphClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.graph.graph_client.GraphClient') def get_identity_client(self): """get_identity_client. Gets the 5.0 version of the IdentityClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.identity.identity_client.IdentityClient') def get_licensing_client(self): """get_licensing_client. Gets the 5.0 version of the LicensingClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.licensing.licensing_client.LicensingClient') def get_location_client(self): """get_location_client. Gets the 5.0 version of the LocationClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.location.location_client.LocationClient') def get_maven_client(self): """get_maven_client. Gets the 5.0 version of the MavenClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.maven.maven_client.MavenClient') def get_member_entitlement_management_client(self): """get_member_entitlement_management_client. Gets the 5.0 version of the MemberEntitlementManagementClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.member_entitlement_management.member_entitlement_management_client.MemberEntitlementManagementClient') def get_notification_client(self): """get_notification_client. Gets the 5.0 version of the NotificationClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.notification.notification_client.NotificationClient') def get_npm_client(self): """get_npm_client. Gets the 5.0 version of the NpmClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.npm.npm_client.NpmClient') def get_nuget_client(self): """get_nuget_client. Gets the 5.0 version of the NuGetClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.nuget.nuget_client.NuGetClient') def get_operations_client(self): """get_operations_client. Gets the 5.0 version of the OperationsClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.operations.operations_client.OperationsClient') def get_policy_client(self): """get_policy_client. Gets the 5.0 version of the PolicyClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.policy.policy_client.PolicyClient') def get_profile_client(self): """get_profile_client. Gets the 5.0 version of the ProfileClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.profile.profile_client.ProfileClient') def get_project_analysis_client(self): """get_project_analysis_client. Gets the 5.0 version of the ProjectAnalysisClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.project_analysis.project_analysis_client.ProjectAnalysisClient') def get_provenance_client(self): """get_provenance_client. Gets the 5.0 version of the ProvenanceClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.provenance.provenance_client.ProvenanceClient') def get_py_pi_api_client(self): """get_py_pi_api_client. Gets the 5.0 version of the PyPiApiClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.py_pi_api.py_pi_api_client.PyPiApiClient') def get_release_client(self): """get_release_client. Gets the 5.0 version of the ReleaseClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.release.release_client.ReleaseClient') def get_search_client(self): """get_search_client. Gets the 5.0 version of the SearchClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.search.search_client.SearchClient') def get_security_client(self): """get_security_client. Gets the 5.0 version of the SecurityClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.security.security_client.SecurityClient') def get_service_endpoint_client(self): """get_service_endpoint_client. Gets the 5.0 version of the ServiceEndpointClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.service_endpoint.service_endpoint_client.ServiceEndpointClient') def get_service_hooks_client(self): """get_service_hooks_client. Gets the 5.0 version of the ServiceHooksClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.service_hooks.service_hooks_client.ServiceHooksClient') def get_settings_client(self): """get_settings_client. Gets the 5.0 version of the SettingsClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.settings.settings_client.SettingsClient') def get_symbol_client(self): """get_symbol_client. Gets the 5.0 version of the SymbolClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.symbol.symbol_client.SymbolClient') def get_task_client(self): """get_task_client. Gets the 5.0 version of the TaskClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.task.task_client.TaskClient') def get_task_agent_client(self): """get_task_agent_client. Gets the 5.0 version of the TaskAgentClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.task_agent.task_agent_client.TaskAgentClient') def get_test_client(self): """get_test_client. Gets the 5.0 version of the TestClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.test.test_client.TestClient') def get_tfvc_client(self): """get_tfvc_client. Gets the 5.0 version of the TfvcClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.tfvc.tfvc_client.TfvcClient') def get_token_admin_client(self): """get_token_admin_client. Gets the 5.0 version of the TokenAdminClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.token_admin.token_admin_client.TokenAdminClient') def get_token_administration_client(self): """get_token_administration_client. Gets the 5.0 version of the TokenAdministrationClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.token_administration.token_administration_client.TokenAdministrationClient') def get_upack_api_client(self): """get_upack_api_client. Gets the 5.0 version of the UPackApiClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.upack_api.upack_api_client.UPackApiClient') def get_upack_packaging_client(self): """get_upack_packaging_client. Gets the 5.0 version of the UPackPackagingClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.upack_packaging.upack_packaging_client.UPackPackagingClient') def get_wiki_client(self): """get_wiki_client. Gets the 5.0 version of the WikiClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.wiki.wiki_client.WikiClient') def get_work_client(self): """get_work_client. Gets the 5.0 version of the WorkClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.work.work_client.WorkClient') def get_work_item_tracking_client(self): """get_work_item_tracking_client. Gets the 5.0 version of the WorkItemTrackingClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.work_item_tracking.work_item_tracking_client.WorkItemTrackingClient') def get_work_item_tracking_process_client(self): """get_work_item_tracking_process_client. Gets the 5.0 version of the WorkItemTrackingProcessClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.work_item_tracking_process.work_item_tracking_process_client.WorkItemTrackingProcessClient') def get_work_item_tracking_process_template_client(self): """get_work_item_tracking_process_template_client. Gets the 5.0 version of the WorkItemTrackingProcessTemplateClient :rtype: :class:` ` """ return self._connection.get_client('azure.devops.v5_0.work_item_tracking_process_template.work_item_tracking_process_template_client.WorkItemTrackingProcessTemplateClient') azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/client_trace/000077500000000000000000000000001360605530400315115ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/client_trace/__init__.py000066400000000000000000000012661360605530400336270ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .client_trace_client import ClientTraceClient __all__ = [ 'ClientTraceEvent', 'ClientTraceClient' ] client_trace_client.py000066400000000000000000000030341360605530400357760ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/client_trace# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class ClientTraceClient(Client): """ClientTrace :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ClientTraceClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def publish_events(self, events): """PublishEvents. [Preview API] :param [ClientTraceEvent] events: """ content = self._serialize.body(events, '[ClientTraceEvent]') self._send(http_method='POST', location_id='06bcc74a-1491-4eb8-a0eb-704778f9d041', version='5.0-preview.1', content=content) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/client_trace/models.py000066400000000000000000000037141360605530400333530ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class ClientTraceEvent(Model): """ClientTraceEvent. :param area: :type area: str :param component: :type component: str :param exception_type: :type exception_type: str :param feature: :type feature: str :param level: :type level: object :param message: :type message: str :param method: :type method: str :param properties: :type properties: dict """ _attribute_map = { 'area': {'key': 'area', 'type': 'str'}, 'component': {'key': 'component', 'type': 'str'}, 'exception_type': {'key': 'exceptionType', 'type': 'str'}, 'feature': {'key': 'feature', 'type': 'str'}, 'level': {'key': 'level', 'type': 'object'}, 'message': {'key': 'message', 'type': 'str'}, 'method': {'key': 'method', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'} } def __init__(self, area=None, component=None, exception_type=None, feature=None, level=None, message=None, method=None, properties=None): super(ClientTraceEvent, self).__init__() self.area = area self.component = component self.exception_type = exception_type self.feature = feature self.level = level self.message = message self.method = method self.properties = properties __all__ = [ 'ClientTraceEvent', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/cloud_load_test/000077500000000000000000000000001360605530400322215ustar00rootroot00000000000000__init__.py000066400000000000000000000034601360605530400342560ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/cloud_load_test# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .cloud_load_test_client import CloudLoadTestClient __all__ = [ 'AgentGroup', 'AgentGroupAccessData', 'Application', 'ApplicationCounters', 'ApplicationType', 'BrowserMix', 'CltCustomerIntelligenceData', 'CounterGroup', 'CounterInstanceSamples', 'CounterSample', 'CounterSampleQueryDetails', 'CounterSamplesResult', 'Diagnostics', 'DropAccessData', 'ErrorDetails', 'LoadGenerationGeoLocation', 'LoadTest', 'LoadTestDefinition', 'LoadTestErrors', 'LoadTestRunDetails', 'LoadTestRunSettings', 'OverridableRunSettings', 'PageSummary', 'RequestSummary', 'ScenarioSummary', 'StaticAgentRunSetting', 'SubType', 'SummaryPercentileData', 'TenantDetails', 'TestDefinition', 'TestDefinitionBasic', 'TestDrop', 'TestDropRef', 'TestResults', 'TestResultsSummary', 'TestRun', 'TestRunAbortMessage', 'TestRunBasic', 'TestRunCounterInstance', 'TestRunMessage', 'TestSettings', 'TestSummary', 'TransactionSummary', 'WebApiLoadTestMachineInput', 'WebApiSetupParamaters', 'WebApiTestMachine', 'WebApiUserLoadTestMachineInput', 'WebInstanceSummaryData', 'CloudLoadTestClient' ] cloud_load_test_client.py000066400000000000000000000553631360605530400372320ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/cloud_load_test# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class CloudLoadTestClient(Client): """CloudLoadTest :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(CloudLoadTestClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '7ae6d0a6-cda5-44cf-a261-28c392bed25c' def create_agent_group(self, group): """CreateAgentGroup. :param :class:` ` group: Agent group to be created :rtype: :class:` ` """ content = self._serialize.body(group, 'AgentGroup') response = self._send(http_method='POST', location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', version='5.0', content=content) return self._deserialize('AgentGroup', response) def get_agent_groups(self, agent_group_id=None, machine_setup_input=None, machine_access_data=None, outgoing_request_urls=None, agent_group_name=None): """GetAgentGroups. :param str agent_group_id: The agent group indentifier :param bool machine_setup_input: :param bool machine_access_data: :param bool outgoing_request_urls: :param str agent_group_name: Name of the agent group :rtype: object """ route_values = {} if agent_group_id is not None: route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') query_parameters = {} if machine_setup_input is not None: query_parameters['machineSetupInput'] = self._serialize.query('machine_setup_input', machine_setup_input, 'bool') if machine_access_data is not None: query_parameters['machineAccessData'] = self._serialize.query('machine_access_data', machine_access_data, 'bool') if outgoing_request_urls is not None: query_parameters['outgoingRequestUrls'] = self._serialize.query('outgoing_request_urls', outgoing_request_urls, 'bool') if agent_group_name is not None: query_parameters['agentGroupName'] = self._serialize.query('agent_group_name', agent_group_name, 'str') response = self._send(http_method='GET', location_id='ab8d91c1-12d9-4ec5-874d-1ddb23e17720', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def delete_static_agent(self, agent_group_id, agent_name): """DeleteStaticAgent. :param str agent_group_id: The agent group identifier :param str agent_name: Name of the static agent :rtype: str """ route_values = {} if agent_group_id is not None: route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') query_parameters = {} if agent_name is not None: query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') response = self._send(http_method='DELETE', location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def get_static_agents(self, agent_group_id, agent_name=None): """GetStaticAgents. :param str agent_group_id: The agent group identifier :param str agent_name: Name of the static agent :rtype: object """ route_values = {} if agent_group_id is not None: route_values['agentGroupId'] = self._serialize.url('agent_group_id', agent_group_id, 'str') query_parameters = {} if agent_name is not None: query_parameters['agentName'] = self._serialize.query('agent_name', agent_name, 'str') response = self._send(http_method='GET', location_id='87e4b63d-7142-4b50-801e-72ba9ff8ee9b', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def get_application(self, application_id): """GetApplication. :param str application_id: Filter by APM application identifier. :rtype: :class:` ` """ route_values = {} if application_id is not None: route_values['applicationId'] = self._serialize.url('application_id', application_id, 'str') response = self._send(http_method='GET', location_id='2c986dce-8e8d-4142-b541-d016d5aff764', version='5.0', route_values=route_values) return self._deserialize('Application', response) def get_applications(self, type=None): """GetApplications. :param str type: Filters the results based on the plugin type. :rtype: [Application] """ query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='2c986dce-8e8d-4142-b541-d016d5aff764', version='5.0', query_parameters=query_parameters) return self._deserialize('[Application]', self._unwrap_collection(response)) def get_counters(self, test_run_id, group_names, include_summary=None): """GetCounters. :param str test_run_id: The test run identifier :param str group_names: Comma separated names of counter groups, such as 'Application', 'Performance' and 'Throughput' :param bool include_summary: :rtype: [TestRunCounterInstance] """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') query_parameters = {} if group_names is not None: query_parameters['groupNames'] = self._serialize.query('group_names', group_names, 'str') if include_summary is not None: query_parameters['includeSummary'] = self._serialize.query('include_summary', include_summary, 'bool') response = self._send(http_method='GET', location_id='29265ea4-b5a5-4b2e-b054-47f5f6f00183', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestRunCounterInstance]', self._unwrap_collection(response)) def get_application_counters(self, application_id=None, plugintype=None): """GetApplicationCounters. :param str application_id: Filter by APM application identifier. :param str plugintype: Currently ApplicationInsights is the only available plugin type. :rtype: [ApplicationCounters] """ query_parameters = {} if application_id is not None: query_parameters['applicationId'] = self._serialize.query('application_id', application_id, 'str') if plugintype is not None: query_parameters['plugintype'] = self._serialize.query('plugintype', plugintype, 'str') response = self._send(http_method='GET', location_id='c1275ce9-6d26-4bc6-926b-b846502e812d', version='5.0', query_parameters=query_parameters) return self._deserialize('[ApplicationCounters]', self._unwrap_collection(response)) def get_counter_samples(self, counter_sample_query_details, test_run_id): """GetCounterSamples. :param :class:` ` counter_sample_query_details: :param str test_run_id: The test run identifier :rtype: :class:` ` """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') content = self._serialize.body(counter_sample_query_details, 'VssJsonCollectionWrapper') response = self._send(http_method='POST', location_id='bad18480-7193-4518-992a-37289c5bb92d', version='5.0', route_values=route_values, content=content) return self._deserialize('CounterSamplesResult', response) def get_load_test_run_errors(self, test_run_id, type=None, sub_type=None, detailed=None): """GetLoadTestRunErrors. :param str test_run_id: The test run identifier :param str type: Filter for the particular type of errors. :param str sub_type: Filter for a particular subtype of errors. You should not provide error subtype without error type. :param bool detailed: To include the details of test errors such as messagetext, request, stacktrace, testcasename, scenarioname, and lasterrordate. :rtype: :class:` ` """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') if sub_type is not None: query_parameters['subType'] = self._serialize.query('sub_type', sub_type, 'str') if detailed is not None: query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') response = self._send(http_method='GET', location_id='b52025a7-3fb4-4283-8825-7079e75bd402', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('LoadTestErrors', response) def get_test_run_messages(self, test_run_id): """GetTestRunMessages. :param str test_run_id: Id of the test run :rtype: [TestRunMessage] """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') response = self._send(http_method='GET', location_id='2e7ba122-f522-4205-845b-2d270e59850a', version='5.0', route_values=route_values) return self._deserialize('[TestRunMessage]', self._unwrap_collection(response)) def get_plugin(self, type): """GetPlugin. :param str type: Currently ApplicationInsights is the only available plugin type. :rtype: :class:` ` """ route_values = {} if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', version='5.0', route_values=route_values) return self._deserialize('ApplicationType', response) def get_plugins(self): """GetPlugins. :rtype: [ApplicationType] """ response = self._send(http_method='GET', location_id='7dcb0bb2-42d5-4729-9958-c0401d5e7693', version='5.0') return self._deserialize('[ApplicationType]', self._unwrap_collection(response)) def get_load_test_result(self, test_run_id): """GetLoadTestResult. :param str test_run_id: The test run identifier :rtype: :class:` ` """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') response = self._send(http_method='GET', location_id='5ed69bd8-4557-4cec-9b75-1ad67d0c257b', version='5.0', route_values=route_values) return self._deserialize('TestResults', response) def create_test_definition(self, test_definition): """CreateTestDefinition. :param :class:` ` test_definition: Test definition to be created :rtype: :class:` ` """ content = self._serialize.body(test_definition, 'TestDefinition') response = self._send(http_method='POST', location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', version='5.0', content=content) return self._deserialize('TestDefinition', response) def get_test_definition(self, test_definition_id): """GetTestDefinition. :param str test_definition_id: The test definition identifier :rtype: :class:` ` """ route_values = {} if test_definition_id is not None: route_values['testDefinitionId'] = self._serialize.url('test_definition_id', test_definition_id, 'str') response = self._send(http_method='GET', location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', version='5.0', route_values=route_values) return self._deserialize('TestDefinition', response) def get_test_definitions(self, from_date=None, to_date=None, top=None): """GetTestDefinitions. :param str from_date: Date after which test definitions were created :param str to_date: Date before which test definitions were crated :param int top: :rtype: [TestDefinitionBasic] """ query_parameters = {} if from_date is not None: query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') if to_date is not None: query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', version='5.0', query_parameters=query_parameters) return self._deserialize('[TestDefinitionBasic]', self._unwrap_collection(response)) def update_test_definition(self, test_definition): """UpdateTestDefinition. :param :class:` ` test_definition: :rtype: :class:` ` """ content = self._serialize.body(test_definition, 'TestDefinition') response = self._send(http_method='PUT', location_id='a8f9b135-f604-41ea-9d74-d9a5fd32fcd8', version='5.0', content=content) return self._deserialize('TestDefinition', response) def create_test_drop(self, web_test_drop): """CreateTestDrop. :param :class:` ` web_test_drop: Test drop to be created :rtype: :class:` ` """ content = self._serialize.body(web_test_drop, 'TestDrop') response = self._send(http_method='POST', location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', version='5.0', content=content) return self._deserialize('TestDrop', response) def get_test_drop(self, test_drop_id): """GetTestDrop. :param str test_drop_id: The test drop identifier :rtype: :class:` ` """ route_values = {} if test_drop_id is not None: route_values['testDropId'] = self._serialize.url('test_drop_id', test_drop_id, 'str') response = self._send(http_method='GET', location_id='d89d0e08-505c-4357-96f6-9729311ce8ad', version='5.0', route_values=route_values) return self._deserialize('TestDrop', response) def create_test_run(self, web_test_run): """CreateTestRun. :param :class:` ` web_test_run: :rtype: :class:` ` """ content = self._serialize.body(web_test_run, 'TestRun') response = self._send(http_method='POST', location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', version='5.0', content=content) return self._deserialize('TestRun', response) def get_test_run(self, test_run_id): """GetTestRun. :param str test_run_id: Unique ID of the test run :rtype: :class:` ` """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') response = self._send(http_method='GET', location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', version='5.0', route_values=route_values) return self._deserialize('TestRun', response) def get_test_runs(self, name=None, requested_by=None, status=None, run_type=None, from_date=None, to_date=None, detailed=None, top=None, runsourceidentifier=None, retention_state=None): """GetTestRuns. Returns test runs based on the filter specified. Returns all runs of the tenant if there is no filter. :param str name: Name for the test run. Names are not unique. Test runs with same name are assigned sequential rolling numbers. :param str requested_by: Filter by the user who requested the test run. Here requestedBy should be the display name of the user. :param str status: Filter by the test run status. :param str run_type: Valid values include: null, one of TestRunType, or "*" :param str from_date: Filter by the test runs that have been modified after the fromDate timestamp. :param str to_date: Filter by the test runs that have been modified before the toDate timestamp. :param bool detailed: Include the detailed test run attributes. :param int top: The maximum number of test runs to return. :param str runsourceidentifier: :param str retention_state: :rtype: object """ query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if requested_by is not None: query_parameters['requestedBy'] = self._serialize.query('requested_by', requested_by, 'str') if status is not None: query_parameters['status'] = self._serialize.query('status', status, 'str') if run_type is not None: query_parameters['runType'] = self._serialize.query('run_type', run_type, 'str') if from_date is not None: query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'str') if to_date is not None: query_parameters['toDate'] = self._serialize.query('to_date', to_date, 'str') if detailed is not None: query_parameters['detailed'] = self._serialize.query('detailed', detailed, 'bool') if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if runsourceidentifier is not None: query_parameters['runsourceidentifier'] = self._serialize.query('runsourceidentifier', runsourceidentifier, 'str') if retention_state is not None: query_parameters['retentionState'] = self._serialize.query('retention_state', retention_state, 'str') response = self._send(http_method='GET', location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', version='5.0', query_parameters=query_parameters) return self._deserialize('object', response) def update_test_run(self, web_test_run, test_run_id): """UpdateTestRun. :param :class:` ` web_test_run: :param str test_run_id: """ route_values = {} if test_run_id is not None: route_values['testRunId'] = self._serialize.url('test_run_id', test_run_id, 'str') content = self._serialize.body(web_test_run, 'TestRun') self._send(http_method='PATCH', location_id='b41a84ff-ff03-4ac1-b76e-e7ea25c92aba', version='5.0', route_values=route_values, content=content) models.py000066400000000000000000002124341360605530400340050ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/cloud_load_test# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AgentGroup(Model): """AgentGroup. :param created_by: :type created_by: IdentityRef :param creation_time: :type creation_time: datetime :param group_id: :type group_id: str :param group_name: :type group_name: str :param machine_access_data: :type machine_access_data: list of :class:`AgentGroupAccessData ` :param machine_configuration: :type machine_configuration: :class:`WebApiUserLoadTestMachineInput ` :param tenant_id: :type tenant_id: str """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'creation_time': {'key': 'creationTime', 'type': 'iso-8601'}, 'group_id': {'key': 'groupId', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'machine_access_data': {'key': 'machineAccessData', 'type': '[AgentGroupAccessData]'}, 'machine_configuration': {'key': 'machineConfiguration', 'type': 'WebApiUserLoadTestMachineInput'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'} } def __init__(self, created_by=None, creation_time=None, group_id=None, group_name=None, machine_access_data=None, machine_configuration=None, tenant_id=None): super(AgentGroup, self).__init__() self.created_by = created_by self.creation_time = creation_time self.group_id = group_id self.group_name = group_name self.machine_access_data = machine_access_data self.machine_configuration = machine_configuration self.tenant_id = tenant_id class AgentGroupAccessData(Model): """AgentGroupAccessData. :param details: :type details: str :param storage_connection_string: :type storage_connection_string: str :param storage_end_point: :type storage_end_point: str :param storage_name: :type storage_name: str :param storage_type: :type storage_type: str """ _attribute_map = { 'details': {'key': 'details', 'type': 'str'}, 'storage_connection_string': {'key': 'storageConnectionString', 'type': 'str'}, 'storage_end_point': {'key': 'storageEndPoint', 'type': 'str'}, 'storage_name': {'key': 'storageName', 'type': 'str'}, 'storage_type': {'key': 'storageType', 'type': 'str'} } def __init__(self, details=None, storage_connection_string=None, storage_end_point=None, storage_name=None, storage_type=None): super(AgentGroupAccessData, self).__init__() self.details = details self.storage_connection_string = storage_connection_string self.storage_end_point = storage_end_point self.storage_name = storage_name self.storage_type = storage_type class Application(Model): """Application. :param application_id: :type application_id: str :param description: :type description: str :param name: :type name: str :param path: :type path: str :param path_seperator: :type path_seperator: str :param type: :type type: str :param version: :type version: str """ _attribute_map = { 'application_id': {'key': 'applicationId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'path_seperator': {'key': 'pathSeperator', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, application_id=None, description=None, name=None, path=None, path_seperator=None, type=None, version=None): super(Application, self).__init__() self.application_id = application_id self.description = description self.name = name self.path = path self.path_seperator = path_seperator self.type = type self.version = version class ApplicationCounters(Model): """ApplicationCounters. :param application_id: :type application_id: str :param description: :type description: str :param id: :type id: str :param is_default: :type is_default: bool :param name: :type name: str :param path: :type path: str """ _attribute_map = { 'application_id': {'key': 'applicationId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, application_id=None, description=None, id=None, is_default=None, name=None, path=None): super(ApplicationCounters, self).__init__() self.application_id = application_id self.description = description self.id = id self.is_default = is_default self.name = name self.path = path class ApplicationType(Model): """ApplicationType. :param action_uri_link: :type action_uri_link: str :param aut_portal_link: :type aut_portal_link: str :param is_enabled: :type is_enabled: bool :param max_components_allowed_for_collection: :type max_components_allowed_for_collection: int :param max_counters_allowed: :type max_counters_allowed: int :param type: :type type: str """ _attribute_map = { 'action_uri_link': {'key': 'actionUriLink', 'type': 'str'}, 'aut_portal_link': {'key': 'autPortalLink', 'type': 'str'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'max_components_allowed_for_collection': {'key': 'maxComponentsAllowedForCollection', 'type': 'int'}, 'max_counters_allowed': {'key': 'maxCountersAllowed', 'type': 'int'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, action_uri_link=None, aut_portal_link=None, is_enabled=None, max_components_allowed_for_collection=None, max_counters_allowed=None, type=None): super(ApplicationType, self).__init__() self.action_uri_link = action_uri_link self.aut_portal_link = aut_portal_link self.is_enabled = is_enabled self.max_components_allowed_for_collection = max_components_allowed_for_collection self.max_counters_allowed = max_counters_allowed self.type = type class BrowserMix(Model): """BrowserMix. :param browser_name: :type browser_name: str :param browser_percentage: :type browser_percentage: int """ _attribute_map = { 'browser_name': {'key': 'browserName', 'type': 'str'}, 'browser_percentage': {'key': 'browserPercentage', 'type': 'int'} } def __init__(self, browser_name=None, browser_percentage=None): super(BrowserMix, self).__init__() self.browser_name = browser_name self.browser_percentage = browser_percentage class CltCustomerIntelligenceData(Model): """CltCustomerIntelligenceData. :param area: :type area: str :param feature: :type feature: str :param properties: :type properties: dict """ _attribute_map = { 'area': {'key': 'area', 'type': 'str'}, 'feature': {'key': 'feature', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'} } def __init__(self, area=None, feature=None, properties=None): super(CltCustomerIntelligenceData, self).__init__() self.area = area self.feature = feature self.properties = properties class CounterGroup(Model): """CounterGroup. :param group_name: :type group_name: str :param url: :type url: str """ _attribute_map = { 'group_name': {'key': 'groupName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, group_name=None, url=None): super(CounterGroup, self).__init__() self.group_name = group_name self.url = url class CounterInstanceSamples(Model): """CounterInstanceSamples. :param count: :type count: int :param counter_instance_id: :type counter_instance_id: str :param next_refresh_time: :type next_refresh_time: datetime :param values: :type values: list of :class:`CounterSample ` """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, 'next_refresh_time': {'key': 'nextRefreshTime', 'type': 'iso-8601'}, 'values': {'key': 'values', 'type': '[CounterSample]'} } def __init__(self, count=None, counter_instance_id=None, next_refresh_time=None, values=None): super(CounterInstanceSamples, self).__init__() self.count = count self.counter_instance_id = counter_instance_id self.next_refresh_time = next_refresh_time self.values = values class CounterSample(Model): """CounterSample. :param base_value: :type base_value: long :param computed_value: :type computed_value: int :param counter_frequency: :type counter_frequency: long :param counter_instance_id: :type counter_instance_id: str :param counter_type: :type counter_type: str :param interval_end_date: :type interval_end_date: datetime :param interval_number: :type interval_number: int :param raw_value: :type raw_value: long :param system_frequency: :type system_frequency: long :param time_stamp: :type time_stamp: long """ _attribute_map = { 'base_value': {'key': 'baseValue', 'type': 'long'}, 'computed_value': {'key': 'computedValue', 'type': 'int'}, 'counter_frequency': {'key': 'counterFrequency', 'type': 'long'}, 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, 'counter_type': {'key': 'counterType', 'type': 'str'}, 'interval_end_date': {'key': 'intervalEndDate', 'type': 'iso-8601'}, 'interval_number': {'key': 'intervalNumber', 'type': 'int'}, 'raw_value': {'key': 'rawValue', 'type': 'long'}, 'system_frequency': {'key': 'systemFrequency', 'type': 'long'}, 'time_stamp': {'key': 'timeStamp', 'type': 'long'} } def __init__(self, base_value=None, computed_value=None, counter_frequency=None, counter_instance_id=None, counter_type=None, interval_end_date=None, interval_number=None, raw_value=None, system_frequency=None, time_stamp=None): super(CounterSample, self).__init__() self.base_value = base_value self.computed_value = computed_value self.counter_frequency = counter_frequency self.counter_instance_id = counter_instance_id self.counter_type = counter_type self.interval_end_date = interval_end_date self.interval_number = interval_number self.raw_value = raw_value self.system_frequency = system_frequency self.time_stamp = time_stamp class CounterSampleQueryDetails(Model): """CounterSampleQueryDetails. :param counter_instance_id: :type counter_instance_id: str :param from_interval: :type from_interval: int :param to_interval: :type to_interval: int """ _attribute_map = { 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, 'from_interval': {'key': 'fromInterval', 'type': 'int'}, 'to_interval': {'key': 'toInterval', 'type': 'int'} } def __init__(self, counter_instance_id=None, from_interval=None, to_interval=None): super(CounterSampleQueryDetails, self).__init__() self.counter_instance_id = counter_instance_id self.from_interval = from_interval self.to_interval = to_interval class CounterSamplesResult(Model): """CounterSamplesResult. :param count: :type count: int :param max_batch_size: :type max_batch_size: int :param total_samples_count: :type total_samples_count: int :param values: :type values: list of :class:`CounterInstanceSamples ` """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'max_batch_size': {'key': 'maxBatchSize', 'type': 'int'}, 'total_samples_count': {'key': 'totalSamplesCount', 'type': 'int'}, 'values': {'key': 'values', 'type': '[CounterInstanceSamples]'} } def __init__(self, count=None, max_batch_size=None, total_samples_count=None, values=None): super(CounterSamplesResult, self).__init__() self.count = count self.max_batch_size = max_batch_size self.total_samples_count = total_samples_count self.values = values class Diagnostics(Model): """Diagnostics. :param diagnostic_store_connection_string: :type diagnostic_store_connection_string: str :param last_modified_time: :type last_modified_time: datetime :param relative_path_to_diagnostic_files: :type relative_path_to_diagnostic_files: str """ _attribute_map = { 'diagnostic_store_connection_string': {'key': 'diagnosticStoreConnectionString', 'type': 'str'}, 'last_modified_time': {'key': 'lastModifiedTime', 'type': 'iso-8601'}, 'relative_path_to_diagnostic_files': {'key': 'relativePathToDiagnosticFiles', 'type': 'str'} } def __init__(self, diagnostic_store_connection_string=None, last_modified_time=None, relative_path_to_diagnostic_files=None): super(Diagnostics, self).__init__() self.diagnostic_store_connection_string = diagnostic_store_connection_string self.last_modified_time = last_modified_time self.relative_path_to_diagnostic_files = relative_path_to_diagnostic_files class DropAccessData(Model): """DropAccessData. :param drop_container_url: :type drop_container_url: str :param sas_key: :type sas_key: str """ _attribute_map = { 'drop_container_url': {'key': 'dropContainerUrl', 'type': 'str'}, 'sas_key': {'key': 'sasKey', 'type': 'str'} } def __init__(self, drop_container_url=None, sas_key=None): super(DropAccessData, self).__init__() self.drop_container_url = drop_container_url self.sas_key = sas_key class ErrorDetails(Model): """ErrorDetails. :param last_error_date: :type last_error_date: datetime :param message_text: :type message_text: str :param occurrences: :type occurrences: int :param request: :type request: str :param scenario_name: :type scenario_name: str :param stack_trace: :type stack_trace: str :param test_case_name: :type test_case_name: str """ _attribute_map = { 'last_error_date': {'key': 'lastErrorDate', 'type': 'iso-8601'}, 'message_text': {'key': 'messageText', 'type': 'str'}, 'occurrences': {'key': 'occurrences', 'type': 'int'}, 'request': {'key': 'request', 'type': 'str'}, 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, 'test_case_name': {'key': 'testCaseName', 'type': 'str'} } def __init__(self, last_error_date=None, message_text=None, occurrences=None, request=None, scenario_name=None, stack_trace=None, test_case_name=None): super(ErrorDetails, self).__init__() self.last_error_date = last_error_date self.message_text = message_text self.occurrences = occurrences self.request = request self.scenario_name = scenario_name self.stack_trace = stack_trace self.test_case_name = test_case_name class LoadGenerationGeoLocation(Model): """LoadGenerationGeoLocation. :param location: :type location: str :param percentage: :type percentage: int """ _attribute_map = { 'location': {'key': 'location', 'type': 'str'}, 'percentage': {'key': 'percentage', 'type': 'int'} } def __init__(self, location=None, percentage=None): super(LoadGenerationGeoLocation, self).__init__() self.location = location self.percentage = percentage class LoadTest(Model): """LoadTest. """ _attribute_map = { } def __init__(self): super(LoadTest, self).__init__() class LoadTestDefinition(Model): """LoadTestDefinition. :param agent_count: :type agent_count: int :param browser_mixs: :type browser_mixs: list of :class:`BrowserMix ` :param core_count: :type core_count: int :param cores_per_agent: :type cores_per_agent: int :param load_generation_geo_locations: :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` :param load_pattern_name: :type load_pattern_name: str :param load_test_name: :type load_test_name: str :param max_vusers: :type max_vusers: int :param run_duration: :type run_duration: int :param sampling_rate: :type sampling_rate: int :param think_time: :type think_time: int :param urls: :type urls: list of str """ _attribute_map = { 'agent_count': {'key': 'agentCount', 'type': 'int'}, 'browser_mixs': {'key': 'browserMixs', 'type': '[BrowserMix]'}, 'core_count': {'key': 'coreCount', 'type': 'int'}, 'cores_per_agent': {'key': 'coresPerAgent', 'type': 'int'}, 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, 'load_pattern_name': {'key': 'loadPatternName', 'type': 'str'}, 'load_test_name': {'key': 'loadTestName', 'type': 'str'}, 'max_vusers': {'key': 'maxVusers', 'type': 'int'}, 'run_duration': {'key': 'runDuration', 'type': 'int'}, 'sampling_rate': {'key': 'samplingRate', 'type': 'int'}, 'think_time': {'key': 'thinkTime', 'type': 'int'}, 'urls': {'key': 'urls', 'type': '[str]'} } def __init__(self, agent_count=None, browser_mixs=None, core_count=None, cores_per_agent=None, load_generation_geo_locations=None, load_pattern_name=None, load_test_name=None, max_vusers=None, run_duration=None, sampling_rate=None, think_time=None, urls=None): super(LoadTestDefinition, self).__init__() self.agent_count = agent_count self.browser_mixs = browser_mixs self.core_count = core_count self.cores_per_agent = cores_per_agent self.load_generation_geo_locations = load_generation_geo_locations self.load_pattern_name = load_pattern_name self.load_test_name = load_test_name self.max_vusers = max_vusers self.run_duration = run_duration self.sampling_rate = sampling_rate self.think_time = think_time self.urls = urls class LoadTestErrors(Model): """LoadTestErrors. :param count: :type count: int :param occurrences: :type occurrences: int :param types: :type types: list of :class:`object ` :param url: :type url: str """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'occurrences': {'key': 'occurrences', 'type': 'int'}, 'types': {'key': 'types', 'type': '[object]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, count=None, occurrences=None, types=None, url=None): super(LoadTestErrors, self).__init__() self.count = count self.occurrences = occurrences self.types = types self.url = url class LoadTestRunSettings(Model): """LoadTestRunSettings. :param agent_count: :type agent_count: int :param core_count: :type core_count: int :param cores_per_agent: :type cores_per_agent: int :param duration: :type duration: int :param load_generator_machines_type: :type load_generator_machines_type: object :param sampling_interval: :type sampling_interval: int :param warm_up_duration: :type warm_up_duration: int """ _attribute_map = { 'agent_count': {'key': 'agentCount', 'type': 'int'}, 'core_count': {'key': 'coreCount', 'type': 'int'}, 'cores_per_agent': {'key': 'coresPerAgent', 'type': 'int'}, 'duration': {'key': 'duration', 'type': 'int'}, 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, 'sampling_interval': {'key': 'samplingInterval', 'type': 'int'}, 'warm_up_duration': {'key': 'warmUpDuration', 'type': 'int'} } def __init__(self, agent_count=None, core_count=None, cores_per_agent=None, duration=None, load_generator_machines_type=None, sampling_interval=None, warm_up_duration=None): super(LoadTestRunSettings, self).__init__() self.agent_count = agent_count self.core_count = core_count self.cores_per_agent = cores_per_agent self.duration = duration self.load_generator_machines_type = load_generator_machines_type self.sampling_interval = sampling_interval self.warm_up_duration = warm_up_duration class OverridableRunSettings(Model): """OverridableRunSettings. :param load_generator_machines_type: :type load_generator_machines_type: object :param static_agent_run_settings: :type static_agent_run_settings: :class:`StaticAgentRunSetting ` """ _attribute_map = { 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, 'static_agent_run_settings': {'key': 'staticAgentRunSettings', 'type': 'StaticAgentRunSetting'} } def __init__(self, load_generator_machines_type=None, static_agent_run_settings=None): super(OverridableRunSettings, self).__init__() self.load_generator_machines_type = load_generator_machines_type self.static_agent_run_settings = static_agent_run_settings class PageSummary(Model): """PageSummary. :param average_page_time: :type average_page_time: float :param page_url: :type page_url: str :param percentage_pages_meeting_goal: :type percentage_pages_meeting_goal: int :param percentile_data: :type percentile_data: list of :class:`SummaryPercentileData ` :param scenario_name: :type scenario_name: str :param test_name: :type test_name: str :param total_pages: :type total_pages: int """ _attribute_map = { 'average_page_time': {'key': 'averagePageTime', 'type': 'float'}, 'page_url': {'key': 'pageUrl', 'type': 'str'}, 'percentage_pages_meeting_goal': {'key': 'percentagePagesMeetingGoal', 'type': 'int'}, 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, 'test_name': {'key': 'testName', 'type': 'str'}, 'total_pages': {'key': 'totalPages', 'type': 'int'} } def __init__(self, average_page_time=None, page_url=None, percentage_pages_meeting_goal=None, percentile_data=None, scenario_name=None, test_name=None, total_pages=None): super(PageSummary, self).__init__() self.average_page_time = average_page_time self.page_url = page_url self.percentage_pages_meeting_goal = percentage_pages_meeting_goal self.percentile_data = percentile_data self.scenario_name = scenario_name self.test_name = test_name self.total_pages = total_pages class RequestSummary(Model): """RequestSummary. :param average_response_time: :type average_response_time: float :param failed_requests: :type failed_requests: int :param passed_requests: :type passed_requests: int :param percentile_data: :type percentile_data: list of :class:`SummaryPercentileData ` :param requests_per_sec: :type requests_per_sec: float :param request_url: :type request_url: str :param scenario_name: :type scenario_name: str :param test_name: :type test_name: str :param total_requests: :type total_requests: int """ _attribute_map = { 'average_response_time': {'key': 'averageResponseTime', 'type': 'float'}, 'failed_requests': {'key': 'failedRequests', 'type': 'int'}, 'passed_requests': {'key': 'passedRequests', 'type': 'int'}, 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, 'requests_per_sec': {'key': 'requestsPerSec', 'type': 'float'}, 'request_url': {'key': 'requestUrl', 'type': 'str'}, 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, 'test_name': {'key': 'testName', 'type': 'str'}, 'total_requests': {'key': 'totalRequests', 'type': 'int'} } def __init__(self, average_response_time=None, failed_requests=None, passed_requests=None, percentile_data=None, requests_per_sec=None, request_url=None, scenario_name=None, test_name=None, total_requests=None): super(RequestSummary, self).__init__() self.average_response_time = average_response_time self.failed_requests = failed_requests self.passed_requests = passed_requests self.percentile_data = percentile_data self.requests_per_sec = requests_per_sec self.request_url = request_url self.scenario_name = scenario_name self.test_name = test_name self.total_requests = total_requests class ScenarioSummary(Model): """ScenarioSummary. :param max_user_load: :type max_user_load: int :param min_user_load: :type min_user_load: int :param scenario_name: :type scenario_name: str """ _attribute_map = { 'max_user_load': {'key': 'maxUserLoad', 'type': 'int'}, 'min_user_load': {'key': 'minUserLoad', 'type': 'int'}, 'scenario_name': {'key': 'scenarioName', 'type': 'str'} } def __init__(self, max_user_load=None, min_user_load=None, scenario_name=None): super(ScenarioSummary, self).__init__() self.max_user_load = max_user_load self.min_user_load = min_user_load self.scenario_name = scenario_name class StaticAgentRunSetting(Model): """StaticAgentRunSetting. :param load_generator_machines_type: :type load_generator_machines_type: object :param static_agent_group_name: :type static_agent_group_name: str """ _attribute_map = { 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, 'static_agent_group_name': {'key': 'staticAgentGroupName', 'type': 'str'} } def __init__(self, load_generator_machines_type=None, static_agent_group_name=None): super(StaticAgentRunSetting, self).__init__() self.load_generator_machines_type = load_generator_machines_type self.static_agent_group_name = static_agent_group_name class SubType(Model): """SubType. :param count: :type count: int :param error_detail_list: :type error_detail_list: list of :class:`ErrorDetails ` :param occurrences: :type occurrences: int :param sub_type_name: :type sub_type_name: str :param url: :type url: str """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'error_detail_list': {'key': 'errorDetailList', 'type': '[ErrorDetails]'}, 'occurrences': {'key': 'occurrences', 'type': 'int'}, 'sub_type_name': {'key': 'subTypeName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, count=None, error_detail_list=None, occurrences=None, sub_type_name=None, url=None): super(SubType, self).__init__() self.count = count self.error_detail_list = error_detail_list self.occurrences = occurrences self.sub_type_name = sub_type_name self.url = url class SummaryPercentileData(Model): """SummaryPercentileData. :param percentile: :type percentile: int :param percentile_value: :type percentile_value: float """ _attribute_map = { 'percentile': {'key': 'percentile', 'type': 'int'}, 'percentile_value': {'key': 'percentileValue', 'type': 'float'} } def __init__(self, percentile=None, percentile_value=None): super(SummaryPercentileData, self).__init__() self.percentile = percentile self.percentile_value = percentile_value class TenantDetails(Model): """TenantDetails. :param access_details: :type access_details: list of :class:`AgentGroupAccessData ` :param id: :type id: str :param static_machines: :type static_machines: list of :class:`WebApiTestMachine ` :param user_load_agent_input: :type user_load_agent_input: :class:`WebApiUserLoadTestMachineInput ` :param user_load_agent_resources_uri: :type user_load_agent_resources_uri: str :param valid_geo_locations: :type valid_geo_locations: list of str """ _attribute_map = { 'access_details': {'key': 'accessDetails', 'type': '[AgentGroupAccessData]'}, 'id': {'key': 'id', 'type': 'str'}, 'static_machines': {'key': 'staticMachines', 'type': '[WebApiTestMachine]'}, 'user_load_agent_input': {'key': 'userLoadAgentInput', 'type': 'WebApiUserLoadTestMachineInput'}, 'user_load_agent_resources_uri': {'key': 'userLoadAgentResourcesUri', 'type': 'str'}, 'valid_geo_locations': {'key': 'validGeoLocations', 'type': '[str]'} } def __init__(self, access_details=None, id=None, static_machines=None, user_load_agent_input=None, user_load_agent_resources_uri=None, valid_geo_locations=None): super(TenantDetails, self).__init__() self.access_details = access_details self.id = id self.static_machines = static_machines self.user_load_agent_input = user_load_agent_input self.user_load_agent_resources_uri = user_load_agent_resources_uri self.valid_geo_locations = valid_geo_locations class TestDefinitionBasic(Model): """TestDefinitionBasic. :param access_data: :type access_data: :class:`DropAccessData ` :param created_by: :type created_by: IdentityRef :param created_date: :type created_date: datetime :param id: :type id: str :param last_modified_by: :type last_modified_by: IdentityRef :param last_modified_date: :type last_modified_date: datetime :param load_test_type: :type load_test_type: object :param name: :type name: str """ _attribute_map = { 'access_data': {'key': 'accessData', 'type': 'DropAccessData'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, 'last_modified_date': {'key': 'lastModifiedDate', 'type': 'iso-8601'}, 'load_test_type': {'key': 'loadTestType', 'type': 'object'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, access_data=None, created_by=None, created_date=None, id=None, last_modified_by=None, last_modified_date=None, load_test_type=None, name=None): super(TestDefinitionBasic, self).__init__() self.access_data = access_data self.created_by = created_by self.created_date = created_date self.id = id self.last_modified_by = last_modified_by self.last_modified_date = last_modified_date self.load_test_type = load_test_type self.name = name class TestDrop(Model): """TestDrop. :param access_data: :type access_data: :class:`DropAccessData ` :param created_date: :type created_date: datetime :param drop_type: :type drop_type: str :param id: :type id: str :param load_test_definition: :type load_test_definition: :class:`LoadTestDefinition ` :param test_run_id: :type test_run_id: str """ _attribute_map = { 'access_data': {'key': 'accessData', 'type': 'DropAccessData'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'drop_type': {'key': 'dropType', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'load_test_definition': {'key': 'loadTestDefinition', 'type': 'LoadTestDefinition'}, 'test_run_id': {'key': 'testRunId', 'type': 'str'} } def __init__(self, access_data=None, created_date=None, drop_type=None, id=None, load_test_definition=None, test_run_id=None): super(TestDrop, self).__init__() self.access_data = access_data self.created_date = created_date self.drop_type = drop_type self.id = id self.load_test_definition = load_test_definition self.test_run_id = test_run_id class TestDropRef(Model): """TestDropRef. :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(TestDropRef, self).__init__() self.id = id self.url = url class TestResults(Model): """TestResults. :param cloud_load_test_solution_url: :type cloud_load_test_solution_url: str :param counter_groups: :type counter_groups: list of :class:`CounterGroup ` :param diagnostics: :type diagnostics: :class:`Diagnostics ` :param results_url: :type results_url: str """ _attribute_map = { 'cloud_load_test_solution_url': {'key': 'cloudLoadTestSolutionUrl', 'type': 'str'}, 'counter_groups': {'key': 'counterGroups', 'type': '[CounterGroup]'}, 'diagnostics': {'key': 'diagnostics', 'type': 'Diagnostics'}, 'results_url': {'key': 'resultsUrl', 'type': 'str'} } def __init__(self, cloud_load_test_solution_url=None, counter_groups=None, diagnostics=None, results_url=None): super(TestResults, self).__init__() self.cloud_load_test_solution_url = cloud_load_test_solution_url self.counter_groups = counter_groups self.diagnostics = diagnostics self.results_url = results_url class TestResultsSummary(Model): """TestResultsSummary. :param overall_page_summary: :type overall_page_summary: :class:`PageSummary ` :param overall_request_summary: :type overall_request_summary: :class:`RequestSummary ` :param overall_scenario_summary: :type overall_scenario_summary: :class:`ScenarioSummary ` :param overall_test_summary: :type overall_test_summary: :class:`TestSummary ` :param overall_transaction_summary: :type overall_transaction_summary: :class:`TransactionSummary ` :param top_slow_pages: :type top_slow_pages: list of :class:`PageSummary ` :param top_slow_requests: :type top_slow_requests: list of :class:`RequestSummary ` :param top_slow_tests: :type top_slow_tests: list of :class:`TestSummary ` :param top_slow_transactions: :type top_slow_transactions: list of :class:`TransactionSummary ` """ _attribute_map = { 'overall_page_summary': {'key': 'overallPageSummary', 'type': 'PageSummary'}, 'overall_request_summary': {'key': 'overallRequestSummary', 'type': 'RequestSummary'}, 'overall_scenario_summary': {'key': 'overallScenarioSummary', 'type': 'ScenarioSummary'}, 'overall_test_summary': {'key': 'overallTestSummary', 'type': 'TestSummary'}, 'overall_transaction_summary': {'key': 'overallTransactionSummary', 'type': 'TransactionSummary'}, 'top_slow_pages': {'key': 'topSlowPages', 'type': '[PageSummary]'}, 'top_slow_requests': {'key': 'topSlowRequests', 'type': '[RequestSummary]'}, 'top_slow_tests': {'key': 'topSlowTests', 'type': '[TestSummary]'}, 'top_slow_transactions': {'key': 'topSlowTransactions', 'type': '[TransactionSummary]'} } def __init__(self, overall_page_summary=None, overall_request_summary=None, overall_scenario_summary=None, overall_test_summary=None, overall_transaction_summary=None, top_slow_pages=None, top_slow_requests=None, top_slow_tests=None, top_slow_transactions=None): super(TestResultsSummary, self).__init__() self.overall_page_summary = overall_page_summary self.overall_request_summary = overall_request_summary self.overall_scenario_summary = overall_scenario_summary self.overall_test_summary = overall_test_summary self.overall_transaction_summary = overall_transaction_summary self.top_slow_pages = top_slow_pages self.top_slow_requests = top_slow_requests self.top_slow_tests = top_slow_tests self.top_slow_transactions = top_slow_transactions class TestRunAbortMessage(Model): """TestRunAbortMessage. :param action: :type action: str :param cause: :type cause: str :param details: :type details: list of str :param logged_date: :type logged_date: datetime :param source: :type source: str """ _attribute_map = { 'action': {'key': 'action', 'type': 'str'}, 'cause': {'key': 'cause', 'type': 'str'}, 'details': {'key': 'details', 'type': '[str]'}, 'logged_date': {'key': 'loggedDate', 'type': 'iso-8601'}, 'source': {'key': 'source', 'type': 'str'} } def __init__(self, action=None, cause=None, details=None, logged_date=None, source=None): super(TestRunAbortMessage, self).__init__() self.action = action self.cause = cause self.details = details self.logged_date = logged_date self.source = source class TestRunBasic(Model): """TestRunBasic. :param created_by: :type created_by: IdentityRef :param created_date: :type created_date: datetime :param deleted_by: :type deleted_by: IdentityRef :param deleted_date: :type deleted_date: datetime :param finished_date: :type finished_date: datetime :param id: :type id: str :param load_generation_geo_locations: :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` :param load_test_file_name: :type load_test_file_name: str :param name: :type name: str :param run_number: :type run_number: int :param run_source: :type run_source: str :param run_specific_details: :type run_specific_details: :class:`LoadTestRunDetails ` :param run_type: :type run_type: object :param state: :type state: object :param url: :type url: str """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'deleted_by': {'key': 'deletedBy', 'type': 'IdentityRef'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'finished_date': {'key': 'finishedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, 'load_test_file_name': {'key': 'loadTestFileName', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'run_number': {'key': 'runNumber', 'type': 'int'}, 'run_source': {'key': 'runSource', 'type': 'str'}, 'run_specific_details': {'key': 'runSpecificDetails', 'type': 'LoadTestRunDetails'}, 'run_type': {'key': 'runType', 'type': 'object'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, created_by=None, created_date=None, deleted_by=None, deleted_date=None, finished_date=None, id=None, load_generation_geo_locations=None, load_test_file_name=None, name=None, run_number=None, run_source=None, run_specific_details=None, run_type=None, state=None, url=None): super(TestRunBasic, self).__init__() self.created_by = created_by self.created_date = created_date self.deleted_by = deleted_by self.deleted_date = deleted_date self.finished_date = finished_date self.id = id self.load_generation_geo_locations = load_generation_geo_locations self.load_test_file_name = load_test_file_name self.name = name self.run_number = run_number self.run_source = run_source self.run_specific_details = run_specific_details self.run_type = run_type self.state = state self.url = url class TestRunCounterInstance(Model): """TestRunCounterInstance. :param category_name: :type category_name: str :param counter_instance_id: :type counter_instance_id: str :param counter_name: :type counter_name: str :param counter_units: :type counter_units: str :param instance_name: :type instance_name: str :param is_preselected_counter: :type is_preselected_counter: bool :param machine_name: :type machine_name: str :param part_of_counter_groups: :type part_of_counter_groups: list of str :param summary_data: :type summary_data: :class:`WebInstanceSummaryData ` :param unique_name: :type unique_name: str """ _attribute_map = { 'category_name': {'key': 'categoryName', 'type': 'str'}, 'counter_instance_id': {'key': 'counterInstanceId', 'type': 'str'}, 'counter_name': {'key': 'counterName', 'type': 'str'}, 'counter_units': {'key': 'counterUnits', 'type': 'str'}, 'instance_name': {'key': 'instanceName', 'type': 'str'}, 'is_preselected_counter': {'key': 'isPreselectedCounter', 'type': 'bool'}, 'machine_name': {'key': 'machineName', 'type': 'str'}, 'part_of_counter_groups': {'key': 'partOfCounterGroups', 'type': '[str]'}, 'summary_data': {'key': 'summaryData', 'type': 'WebInstanceSummaryData'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, category_name=None, counter_instance_id=None, counter_name=None, counter_units=None, instance_name=None, is_preselected_counter=None, machine_name=None, part_of_counter_groups=None, summary_data=None, unique_name=None): super(TestRunCounterInstance, self).__init__() self.category_name = category_name self.counter_instance_id = counter_instance_id self.counter_name = counter_name self.counter_units = counter_units self.instance_name = instance_name self.is_preselected_counter = is_preselected_counter self.machine_name = machine_name self.part_of_counter_groups = part_of_counter_groups self.summary_data = summary_data self.unique_name = unique_name class TestRunMessage(Model): """TestRunMessage. :param agent_id: :type agent_id: str :param error_code: :type error_code: str :param logged_date: :type logged_date: datetime :param message: :type message: str :param message_id: :type message_id: str :param message_source: :type message_source: object :param message_type: :type message_type: object :param test_run_id: :type test_run_id: str :param url: :type url: str """ _attribute_map = { 'agent_id': {'key': 'agentId', 'type': 'str'}, 'error_code': {'key': 'errorCode', 'type': 'str'}, 'logged_date': {'key': 'loggedDate', 'type': 'iso-8601'}, 'message': {'key': 'message', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'message_source': {'key': 'messageSource', 'type': 'object'}, 'message_type': {'key': 'messageType', 'type': 'object'}, 'test_run_id': {'key': 'testRunId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, agent_id=None, error_code=None, logged_date=None, message=None, message_id=None, message_source=None, message_type=None, test_run_id=None, url=None): super(TestRunMessage, self).__init__() self.agent_id = agent_id self.error_code = error_code self.logged_date = logged_date self.message = message self.message_id = message_id self.message_source = message_source self.message_type = message_type self.test_run_id = test_run_id self.url = url class TestSettings(Model): """TestSettings. :param cleanup_command: :type cleanup_command: str :param host_process_platform: :type host_process_platform: object :param setup_command: :type setup_command: str """ _attribute_map = { 'cleanup_command': {'key': 'cleanupCommand', 'type': 'str'}, 'host_process_platform': {'key': 'hostProcessPlatform', 'type': 'object'}, 'setup_command': {'key': 'setupCommand', 'type': 'str'} } def __init__(self, cleanup_command=None, host_process_platform=None, setup_command=None): super(TestSettings, self).__init__() self.cleanup_command = cleanup_command self.host_process_platform = host_process_platform self.setup_command = setup_command class TestSummary(Model): """TestSummary. :param average_test_time: :type average_test_time: float :param failed_tests: :type failed_tests: int :param passed_tests: :type passed_tests: int :param percentile_data: :type percentile_data: list of :class:`SummaryPercentileData ` :param scenario_name: :type scenario_name: str :param test_name: :type test_name: str :param total_tests: :type total_tests: int """ _attribute_map = { 'average_test_time': {'key': 'averageTestTime', 'type': 'float'}, 'failed_tests': {'key': 'failedTests', 'type': 'int'}, 'passed_tests': {'key': 'passedTests', 'type': 'int'}, 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, 'test_name': {'key': 'testName', 'type': 'str'}, 'total_tests': {'key': 'totalTests', 'type': 'int'} } def __init__(self, average_test_time=None, failed_tests=None, passed_tests=None, percentile_data=None, scenario_name=None, test_name=None, total_tests=None): super(TestSummary, self).__init__() self.average_test_time = average_test_time self.failed_tests = failed_tests self.passed_tests = passed_tests self.percentile_data = percentile_data self.scenario_name = scenario_name self.test_name = test_name self.total_tests = total_tests class TransactionSummary(Model): """TransactionSummary. :param average_response_time: :type average_response_time: float :param average_transaction_time: :type average_transaction_time: float :param percentile_data: :type percentile_data: list of :class:`SummaryPercentileData ` :param scenario_name: :type scenario_name: str :param test_name: :type test_name: str :param total_transactions: :type total_transactions: int :param transaction_name: :type transaction_name: str """ _attribute_map = { 'average_response_time': {'key': 'averageResponseTime', 'type': 'float'}, 'average_transaction_time': {'key': 'averageTransactionTime', 'type': 'float'}, 'percentile_data': {'key': 'percentileData', 'type': '[SummaryPercentileData]'}, 'scenario_name': {'key': 'scenarioName', 'type': 'str'}, 'test_name': {'key': 'testName', 'type': 'str'}, 'total_transactions': {'key': 'totalTransactions', 'type': 'int'}, 'transaction_name': {'key': 'transactionName', 'type': 'str'} } def __init__(self, average_response_time=None, average_transaction_time=None, percentile_data=None, scenario_name=None, test_name=None, total_transactions=None, transaction_name=None): super(TransactionSummary, self).__init__() self.average_response_time = average_response_time self.average_transaction_time = average_transaction_time self.percentile_data = percentile_data self.scenario_name = scenario_name self.test_name = test_name self.total_transactions = total_transactions self.transaction_name = transaction_name class WebApiLoadTestMachineInput(Model): """WebApiLoadTestMachineInput. :param machine_group_id: :type machine_group_id: str :param machine_type: :type machine_type: object :param setup_configuration: :type setup_configuration: :class:`WebApiSetupParamaters ` :param supported_run_types: :type supported_run_types: list of TestRunType """ _attribute_map = { 'machine_group_id': {'key': 'machineGroupId', 'type': 'str'}, 'machine_type': {'key': 'machineType', 'type': 'object'}, 'setup_configuration': {'key': 'setupConfiguration', 'type': 'WebApiSetupParamaters'}, 'supported_run_types': {'key': 'supportedRunTypes', 'type': '[object]'} } def __init__(self, machine_group_id=None, machine_type=None, setup_configuration=None, supported_run_types=None): super(WebApiLoadTestMachineInput, self).__init__() self.machine_group_id = machine_group_id self.machine_type = machine_type self.setup_configuration = setup_configuration self.supported_run_types = supported_run_types class WebApiSetupParamaters(Model): """WebApiSetupParamaters. :param configurations: :type configurations: dict """ _attribute_map = { 'configurations': {'key': 'configurations', 'type': '{str}'} } def __init__(self, configurations=None): super(WebApiSetupParamaters, self).__init__() self.configurations = configurations class WebApiTestMachine(Model): """WebApiTestMachine. :param last_heart_beat: :type last_heart_beat: datetime :param machine_name: :type machine_name: str :param status: :type status: str """ _attribute_map = { 'last_heart_beat': {'key': 'lastHeartBeat', 'type': 'iso-8601'}, 'machine_name': {'key': 'machineName', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'} } def __init__(self, last_heart_beat=None, machine_name=None, status=None): super(WebApiTestMachine, self).__init__() self.last_heart_beat = last_heart_beat self.machine_name = machine_name self.status = status class WebApiUserLoadTestMachineInput(WebApiLoadTestMachineInput): """WebApiUserLoadTestMachineInput. :param machine_group_id: :type machine_group_id: str :param machine_type: :type machine_type: object :param setup_configuration: :type setup_configuration: :class:`WebApiSetupParamaters ` :param supported_run_types: :type supported_run_types: list of TestRunType :param agent_group_name: :type agent_group_name: str :param tenant_id: :type tenant_id: str :param user_load_agent_resources_uri: :type user_load_agent_resources_uri: str :param vsts_account_uri: :type vsts_account_uri: str """ _attribute_map = { 'machine_group_id': {'key': 'machineGroupId', 'type': 'str'}, 'machine_type': {'key': 'machineType', 'type': 'object'}, 'setup_configuration': {'key': 'setupConfiguration', 'type': 'WebApiSetupParamaters'}, 'supported_run_types': {'key': 'supportedRunTypes', 'type': '[TestRunType]'}, 'agent_group_name': {'key': 'agentGroupName', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'user_load_agent_resources_uri': {'key': 'userLoadAgentResourcesUri', 'type': 'str'}, 'vsts_account_uri': {'key': 'vstsAccountUri', 'type': 'str'} } def __init__(self, machine_group_id=None, machine_type=None, setup_configuration=None, supported_run_types=None, agent_group_name=None, tenant_id=None, user_load_agent_resources_uri=None, vsts_account_uri=None): super(WebApiUserLoadTestMachineInput, self).__init__(machine_group_id=machine_group_id, machine_type=machine_type, setup_configuration=setup_configuration, supported_run_types=supported_run_types) self.agent_group_name = agent_group_name self.tenant_id = tenant_id self.user_load_agent_resources_uri = user_load_agent_resources_uri self.vsts_account_uri = vsts_account_uri class WebInstanceSummaryData(Model): """WebInstanceSummaryData. :param average: :type average: float :param max: :type max: float :param min: :type min: float """ _attribute_map = { 'average': {'key': 'average', 'type': 'float'}, 'max': {'key': 'max', 'type': 'float'}, 'min': {'key': 'min', 'type': 'float'} } def __init__(self, average=None, max=None, min=None): super(WebInstanceSummaryData, self).__init__() self.average = average self.max = max self.min = min class LoadTestRunDetails(LoadTestRunSettings): """LoadTestRunDetails. :param agent_count: :type agent_count: int :param core_count: :type core_count: int :param cores_per_agent: :type cores_per_agent: int :param duration: :type duration: int :param load_generator_machines_type: :type load_generator_machines_type: object :param sampling_interval: :type sampling_interval: int :param warm_up_duration: :type warm_up_duration: int :param virtual_user_count: :type virtual_user_count: int """ _attribute_map = { 'agent_count': {'key': 'agentCount', 'type': 'int'}, 'core_count': {'key': 'coreCount', 'type': 'int'}, 'cores_per_agent': {'key': 'coresPerAgent', 'type': 'int'}, 'duration': {'key': 'duration', 'type': 'int'}, 'load_generator_machines_type': {'key': 'loadGeneratorMachinesType', 'type': 'object'}, 'sampling_interval': {'key': 'samplingInterval', 'type': 'int'}, 'warm_up_duration': {'key': 'warmUpDuration', 'type': 'int'}, 'virtual_user_count': {'key': 'virtualUserCount', 'type': 'int'} } def __init__(self, agent_count=None, core_count=None, cores_per_agent=None, duration=None, load_generator_machines_type=None, sampling_interval=None, warm_up_duration=None, virtual_user_count=None): super(LoadTestRunDetails, self).__init__(agent_count=agent_count, core_count=core_count, cores_per_agent=cores_per_agent, duration=duration, load_generator_machines_type=load_generator_machines_type, sampling_interval=sampling_interval, warm_up_duration=warm_up_duration) self.virtual_user_count = virtual_user_count class TestDefinition(TestDefinitionBasic): """TestDefinition. :param access_data: :type access_data: :class:`DropAccessData ` :param created_by: :type created_by: IdentityRef :param created_date: :type created_date: datetime :param id: :type id: str :param last_modified_by: :type last_modified_by: IdentityRef :param last_modified_date: :type last_modified_date: datetime :param load_test_type: :type load_test_type: object :param name: :type name: str :param description: :type description: str :param load_generation_geo_locations: :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` :param load_test_definition_source: :type load_test_definition_source: str :param run_settings: :type run_settings: :class:`LoadTestRunSettings ` :param static_agent_run_settings: :type static_agent_run_settings: :class:`StaticAgentRunSetting ` :param test_details: :type test_details: :class:`LoadTest ` """ _attribute_map = { 'access_data': {'key': 'accessData', 'type': 'DropAccessData'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, 'last_modified_date': {'key': 'lastModifiedDate', 'type': 'iso-8601'}, 'load_test_type': {'key': 'loadTestType', 'type': 'object'}, 'name': {'key': 'name', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, 'load_test_definition_source': {'key': 'loadTestDefinitionSource', 'type': 'str'}, 'run_settings': {'key': 'runSettings', 'type': 'LoadTestRunSettings'}, 'static_agent_run_settings': {'key': 'staticAgentRunSettings', 'type': 'StaticAgentRunSetting'}, 'test_details': {'key': 'testDetails', 'type': 'LoadTest'} } def __init__(self, access_data=None, created_by=None, created_date=None, id=None, last_modified_by=None, last_modified_date=None, load_test_type=None, name=None, description=None, load_generation_geo_locations=None, load_test_definition_source=None, run_settings=None, static_agent_run_settings=None, test_details=None): super(TestDefinition, self).__init__(access_data=access_data, created_by=created_by, created_date=created_date, id=id, last_modified_by=last_modified_by, last_modified_date=last_modified_date, load_test_type=load_test_type, name=name) self.description = description self.load_generation_geo_locations = load_generation_geo_locations self.load_test_definition_source = load_test_definition_source self.run_settings = run_settings self.static_agent_run_settings = static_agent_run_settings self.test_details = test_details class TestRun(TestRunBasic): """TestRun. :param created_by: :type created_by: IdentityRef :param created_date: :type created_date: datetime :param deleted_by: :type deleted_by: IdentityRef :param deleted_date: :type deleted_date: datetime :param finished_date: :type finished_date: datetime :param id: :type id: str :param load_generation_geo_locations: :type load_generation_geo_locations: list of :class:`LoadGenerationGeoLocation ` :param load_test_file_name: :type load_test_file_name: str :param name: :type name: str :param run_number: :type run_number: int :param run_source: :type run_source: str :param run_specific_details: :type run_specific_details: :class:`LoadTestRunDetails ` :param run_type: :type run_type: object :param state: :type state: object :param url: :type url: str :param abort_message: :type abort_message: :class:`TestRunAbortMessage ` :param aut_initialization_error: :type aut_initialization_error: bool :param chargeable: :type chargeable: bool :param charged_vUserminutes: :type charged_vUserminutes: int :param description: :type description: str :param execution_finished_date: :type execution_finished_date: datetime :param execution_started_date: :type execution_started_date: datetime :param queued_date: :type queued_date: datetime :param retention_state: :type retention_state: object :param run_source_identifier: :type run_source_identifier: str :param run_source_url: :type run_source_url: str :param started_by: :type started_by: IdentityRef :param started_date: :type started_date: datetime :param stopped_by: :type stopped_by: IdentityRef :param sub_state: :type sub_state: object :param supersede_run_settings: :type supersede_run_settings: :class:`OverridableRunSettings ` :param test_drop: :type test_drop: :class:`TestDropRef ` :param test_settings: :type test_settings: :class:`TestSettings ` :param warm_up_started_date: :type warm_up_started_date: datetime :param web_result_url: :type web_result_url: str """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'deleted_by': {'key': 'deletedBy', 'type': 'IdentityRef'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'finished_date': {'key': 'finishedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'load_generation_geo_locations': {'key': 'loadGenerationGeoLocations', 'type': '[LoadGenerationGeoLocation]'}, 'load_test_file_name': {'key': 'loadTestFileName', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'run_number': {'key': 'runNumber', 'type': 'int'}, 'run_source': {'key': 'runSource', 'type': 'str'}, 'run_specific_details': {'key': 'runSpecificDetails', 'type': 'LoadTestRunDetails'}, 'run_type': {'key': 'runType', 'type': 'object'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'abort_message': {'key': 'abortMessage', 'type': 'TestRunAbortMessage'}, 'aut_initialization_error': {'key': 'autInitializationError', 'type': 'bool'}, 'chargeable': {'key': 'chargeable', 'type': 'bool'}, 'charged_vUserminutes': {'key': 'chargedVUserminutes', 'type': 'int'}, 'description': {'key': 'description', 'type': 'str'}, 'execution_finished_date': {'key': 'executionFinishedDate', 'type': 'iso-8601'}, 'execution_started_date': {'key': 'executionStartedDate', 'type': 'iso-8601'}, 'queued_date': {'key': 'queuedDate', 'type': 'iso-8601'}, 'retention_state': {'key': 'retentionState', 'type': 'object'}, 'run_source_identifier': {'key': 'runSourceIdentifier', 'type': 'str'}, 'run_source_url': {'key': 'runSourceUrl', 'type': 'str'}, 'started_by': {'key': 'startedBy', 'type': 'IdentityRef'}, 'started_date': {'key': 'startedDate', 'type': 'iso-8601'}, 'stopped_by': {'key': 'stoppedBy', 'type': 'IdentityRef'}, 'sub_state': {'key': 'subState', 'type': 'object'}, 'supersede_run_settings': {'key': 'supersedeRunSettings', 'type': 'OverridableRunSettings'}, 'test_drop': {'key': 'testDrop', 'type': 'TestDropRef'}, 'test_settings': {'key': 'testSettings', 'type': 'TestSettings'}, 'warm_up_started_date': {'key': 'warmUpStartedDate', 'type': 'iso-8601'}, 'web_result_url': {'key': 'webResultUrl', 'type': 'str'} } def __init__(self, created_by=None, created_date=None, deleted_by=None, deleted_date=None, finished_date=None, id=None, load_generation_geo_locations=None, load_test_file_name=None, name=None, run_number=None, run_source=None, run_specific_details=None, run_type=None, state=None, url=None, abort_message=None, aut_initialization_error=None, chargeable=None, charged_vUserminutes=None, description=None, execution_finished_date=None, execution_started_date=None, queued_date=None, retention_state=None, run_source_identifier=None, run_source_url=None, started_by=None, started_date=None, stopped_by=None, sub_state=None, supersede_run_settings=None, test_drop=None, test_settings=None, warm_up_started_date=None, web_result_url=None): super(TestRun, self).__init__(created_by=created_by, created_date=created_date, deleted_by=deleted_by, deleted_date=deleted_date, finished_date=finished_date, id=id, load_generation_geo_locations=load_generation_geo_locations, load_test_file_name=load_test_file_name, name=name, run_number=run_number, run_source=run_source, run_specific_details=run_specific_details, run_type=run_type, state=state, url=url) self.abort_message = abort_message self.aut_initialization_error = aut_initialization_error self.chargeable = chargeable self.charged_vUserminutes = charged_vUserminutes self.description = description self.execution_finished_date = execution_finished_date self.execution_started_date = execution_started_date self.queued_date = queued_date self.retention_state = retention_state self.run_source_identifier = run_source_identifier self.run_source_url = run_source_url self.started_by = started_by self.started_date = started_date self.stopped_by = stopped_by self.sub_state = sub_state self.supersede_run_settings = supersede_run_settings self.test_drop = test_drop self.test_settings = test_settings self.warm_up_started_date = warm_up_started_date self.web_result_url = web_result_url __all__ = [ 'AgentGroup', 'AgentGroupAccessData', 'Application', 'ApplicationCounters', 'ApplicationType', 'BrowserMix', 'CltCustomerIntelligenceData', 'CounterGroup', 'CounterInstanceSamples', 'CounterSample', 'CounterSampleQueryDetails', 'CounterSamplesResult', 'Diagnostics', 'DropAccessData', 'ErrorDetails', 'LoadGenerationGeoLocation', 'LoadTest', 'LoadTestDefinition', 'LoadTestErrors', 'LoadTestRunSettings', 'OverridableRunSettings', 'PageSummary', 'RequestSummary', 'ScenarioSummary', 'StaticAgentRunSetting', 'SubType', 'SummaryPercentileData', 'TenantDetails', 'TestDefinitionBasic', 'TestDrop', 'TestDropRef', 'TestResults', 'TestResultsSummary', 'TestRunAbortMessage', 'TestRunBasic', 'TestRunCounterInstance', 'TestRunMessage', 'TestSettings', 'TestSummary', 'TransactionSummary', 'WebApiLoadTestMachineInput', 'WebApiSetupParamaters', 'WebApiTestMachine', 'WebApiUserLoadTestMachineInput', 'WebInstanceSummaryData', 'LoadTestRunDetails', 'TestDefinition', 'TestRun', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/contributions/000077500000000000000000000000001360605530400317575ustar00rootroot00000000000000__init__.py000066400000000000000000000025761360605530400340230ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/contributions# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .contributions_client import ContributionsClient __all__ = [ 'ClientContribution', 'ClientContributionNode', 'ClientContributionProviderDetails', 'ClientDataProviderQuery', 'Contribution', 'ContributionBase', 'ContributionConstraint', 'ContributionNodeQuery', 'ContributionNodeQueryResult', 'ContributionPropertyDescription', 'ContributionType', 'DataProviderContext', 'DataProviderExceptionDetails', 'DataProviderQuery', 'DataProviderResult', 'ExtensionEventCallback', 'ExtensionEventCallbackCollection', 'ExtensionFile', 'ExtensionLicensing', 'ExtensionManifest', 'InstalledExtension', 'InstalledExtensionState', 'InstalledExtensionStateIssue', 'LicensingOverride', 'ResolvedDataProvider', 'ContributionsClient' ] contributions_client.py000066400000000000000000000131661360605530400365210ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/contributions# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class ContributionsClient(Client): """Contributions :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ContributionsClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '8477aec9-a4c7-4bd4-a456-ba4c53c989cb' def query_contribution_nodes(self, query): """QueryContributionNodes. [Preview API] Query for contribution nodes and provider details according the parameters in the passed in query object. :param :class:` ` query: :rtype: :class:` ` """ content = self._serialize.body(query, 'ContributionNodeQuery') response = self._send(http_method='POST', location_id='db7f2146-2309-4cee-b39c-c767777a1c55', version='5.0-preview.1', content=content) return self._deserialize('ContributionNodeQueryResult', response) def query_data_providers(self, query, scope_name=None, scope_value=None): """QueryDataProviders. [Preview API] :param :class:` ` query: :param str scope_name: :param str scope_value: :rtype: :class:` ` """ route_values = {} if scope_name is not None: route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') if scope_value is not None: route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') content = self._serialize.body(query, 'DataProviderQuery') response = self._send(http_method='POST', location_id='738368db-35ee-4b85-9f94-77ed34af2b0d', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('DataProviderResult', response) def get_installed_extensions(self, contribution_ids=None, include_disabled_apps=None, asset_types=None): """GetInstalledExtensions. [Preview API] :param [str] contribution_ids: :param bool include_disabled_apps: :param [str] asset_types: :rtype: [InstalledExtension] """ query_parameters = {} if contribution_ids is not None: contribution_ids = ";".join(contribution_ids) query_parameters['contributionIds'] = self._serialize.query('contribution_ids', contribution_ids, 'str') if include_disabled_apps is not None: query_parameters['includeDisabledApps'] = self._serialize.query('include_disabled_apps', include_disabled_apps, 'bool') if asset_types is not None: asset_types = ":".join(asset_types) query_parameters['assetTypes'] = self._serialize.query('asset_types', asset_types, 'str') response = self._send(http_method='GET', location_id='2648442b-fd63-4b9a-902f-0c913510f139', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[InstalledExtension]', self._unwrap_collection(response)) def get_installed_extension_by_name(self, publisher_name, extension_name, asset_types=None): """GetInstalledExtensionByName. [Preview API] :param str publisher_name: :param str extension_name: :param [str] asset_types: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if asset_types is not None: asset_types = ":".join(asset_types) query_parameters['assetTypes'] = self._serialize.query('asset_types', asset_types, 'str') response = self._send(http_method='GET', location_id='3e2f6668-0798-4dcb-b592-bfe2fa57fde2', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('InstalledExtension', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/contributions/models.py000066400000000000000000001135211360605530400336170ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class ClientContribution(Model): """ClientContribution. :param description: Description of the contribution/type :type description: str :param id: Fully qualified identifier of the contribution/type :type id: str :param includes: Includes is a set of contributions that should have this contribution included in their targets list. :type includes: list of str :param properties: Properties/attributes of this contribution :type properties: :class:`object ` :param targets: The ids of the contribution(s) that this contribution targets. (parent contributions) :type targets: list of str :param type: Id of the Contribution Type :type type: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'includes': {'key': 'includes', 'type': '[str]'}, 'properties': {'key': 'properties', 'type': 'object'}, 'targets': {'key': 'targets', 'type': '[str]'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, description=None, id=None, includes=None, properties=None, targets=None, type=None): super(ClientContribution, self).__init__() self.description = description self.id = id self.includes = includes self.properties = properties self.targets = targets self.type = type class ClientContributionNode(Model): """ClientContributionNode. :param children: List of ids for contributions which are children to the current contribution. :type children: list of str :param contribution: Contribution associated with this node. :type contribution: :class:`ClientContribution ` :param parents: List of ids for contributions which are parents to the current contribution. :type parents: list of str """ _attribute_map = { 'children': {'key': 'children', 'type': '[str]'}, 'contribution': {'key': 'contribution', 'type': 'ClientContribution'}, 'parents': {'key': 'parents', 'type': '[str]'} } def __init__(self, children=None, contribution=None, parents=None): super(ClientContributionNode, self).__init__() self.children = children self.contribution = contribution self.parents = parents class ClientContributionProviderDetails(Model): """ClientContributionProviderDetails. :param display_name: Friendly name for the provider. :type display_name: str :param name: Unique identifier for this provider. The provider name can be used to cache the contribution data and refer back to it when looking for changes :type name: str :param properties: Properties associated with the provider :type properties: dict :param version: Version of contributions assoicated with this contribution provider. :type version: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, display_name=None, name=None, properties=None, version=None): super(ClientContributionProviderDetails, self).__init__() self.display_name = display_name self.name = name self.properties = properties self.version = version class ContributionBase(Model): """ContributionBase. :param description: Description of the contribution/type :type description: str :param id: Fully qualified identifier of the contribution/type :type id: str :param visible_to: VisibleTo can be used to restrict whom can reference a given contribution/type. This value should be a list of publishers or extensions access is restricted too. Examples: "ms" - Means only the "ms" publisher can reference this. "ms.vss-web" - Means only the "vss-web" extension from the "ms" publisher can reference this. :type visible_to: list of str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'visible_to': {'key': 'visibleTo', 'type': '[str]'} } def __init__(self, description=None, id=None, visible_to=None): super(ContributionBase, self).__init__() self.description = description self.id = id self.visible_to = visible_to class ContributionConstraint(Model): """ContributionConstraint. :param group: An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included). :type group: int :param id: Fully qualified identifier of a shared constraint :type id: str :param inverse: If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true) :type inverse: bool :param name: Name of the IContributionFilter plugin :type name: str :param properties: Properties that are fed to the contribution filter class :type properties: :class:`object ` :param relationships: Constraints can be optionally be applied to one or more of the relationships defined in the contribution. If no relationships are defined then all relationships are associated with the constraint. This means the default behaviour will elimiate the contribution from the tree completely if the constraint is applied. :type relationships: list of str """ _attribute_map = { 'group': {'key': 'group', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'inverse': {'key': 'inverse', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'relationships': {'key': 'relationships', 'type': '[str]'} } def __init__(self, group=None, id=None, inverse=None, name=None, properties=None, relationships=None): super(ContributionConstraint, self).__init__() self.group = group self.id = id self.inverse = inverse self.name = name self.properties = properties self.relationships = relationships class ContributionNodeQuery(Model): """ContributionNodeQuery. :param contribution_ids: The contribution ids of the nodes to find. :type contribution_ids: list of str :param data_provider_context: Contextual information that can be leveraged by contribution constraints :type data_provider_context: :class:`DataProviderContext ` :param include_provider_details: Indicator if contribution provider details should be included in the result. :type include_provider_details: bool :param query_options: Query options tpo be used when fetching ContributionNodes :type query_options: object """ _attribute_map = { 'contribution_ids': {'key': 'contributionIds', 'type': '[str]'}, 'data_provider_context': {'key': 'dataProviderContext', 'type': 'DataProviderContext'}, 'include_provider_details': {'key': 'includeProviderDetails', 'type': 'bool'}, 'query_options': {'key': 'queryOptions', 'type': 'object'} } def __init__(self, contribution_ids=None, data_provider_context=None, include_provider_details=None, query_options=None): super(ContributionNodeQuery, self).__init__() self.contribution_ids = contribution_ids self.data_provider_context = data_provider_context self.include_provider_details = include_provider_details self.query_options = query_options class ContributionNodeQueryResult(Model): """ContributionNodeQueryResult. :param nodes: Map of contribution ids to corresponding node. :type nodes: dict :param provider_details: Map of provder ids to the corresponding provider details object. :type provider_details: dict """ _attribute_map = { 'nodes': {'key': 'nodes', 'type': '{ClientContributionNode}'}, 'provider_details': {'key': 'providerDetails', 'type': '{ClientContributionProviderDetails}'} } def __init__(self, nodes=None, provider_details=None): super(ContributionNodeQueryResult, self).__init__() self.nodes = nodes self.provider_details = provider_details class ContributionPropertyDescription(Model): """ContributionPropertyDescription. :param description: Description of the property :type description: str :param name: Name of the property :type name: str :param required: True if this property is required :type required: bool :param type: The type of value used for this property :type type: object """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, description=None, name=None, required=None, type=None): super(ContributionPropertyDescription, self).__init__() self.description = description self.name = name self.required = required self.type = type class ContributionType(ContributionBase): """ContributionType. :param description: Description of the contribution/type :type description: str :param id: Fully qualified identifier of the contribution/type :type id: str :param visible_to: VisibleTo can be used to restrict whom can reference a given contribution/type. This value should be a list of publishers or extensions access is restricted too. Examples: "ms" - Means only the "ms" publisher can reference this. "ms.vss-web" - Means only the "vss-web" extension from the "ms" publisher can reference this. :type visible_to: list of str :param indexed: Controls whether or not contributions of this type have the type indexed for queries. This allows clients to find all extensions that have a contribution of this type. NOTE: Only TrustedPartners are allowed to specify indexed contribution types. :type indexed: bool :param name: Friendly name of the contribution/type :type name: str :param properties: Describes the allowed properties for this contribution type :type properties: dict """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'visible_to': {'key': 'visibleTo', 'type': '[str]'}, 'indexed': {'key': 'indexed', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{ContributionPropertyDescription}'} } def __init__(self, description=None, id=None, visible_to=None, indexed=None, name=None, properties=None): super(ContributionType, self).__init__(description=description, id=id, visible_to=visible_to) self.indexed = indexed self.name = name self.properties = properties class DataProviderContext(Model): """DataProviderContext. :param properties: Generic property bag that contains context-specific properties that data providers can use when populating their data dictionary :type properties: dict """ _attribute_map = { 'properties': {'key': 'properties', 'type': '{object}'} } def __init__(self, properties=None): super(DataProviderContext, self).__init__() self.properties = properties class DataProviderExceptionDetails(Model): """DataProviderExceptionDetails. :param exception_type: The type of the exception that was thrown. :type exception_type: str :param message: Message that is associated with the exception. :type message: str :param stack_trace: The StackTrace from the exception turned into a string. :type stack_trace: str """ _attribute_map = { 'exception_type': {'key': 'exceptionType', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'stack_trace': {'key': 'stackTrace', 'type': 'str'} } def __init__(self, exception_type=None, message=None, stack_trace=None): super(DataProviderExceptionDetails, self).__init__() self.exception_type = exception_type self.message = message self.stack_trace = stack_trace class DataProviderQuery(Model): """DataProviderQuery. :param context: Contextual information to pass to the data providers :type context: :class:`DataProviderContext ` :param contribution_ids: The contribution ids of the data providers to resolve :type contribution_ids: list of str """ _attribute_map = { 'context': {'key': 'context', 'type': 'DataProviderContext'}, 'contribution_ids': {'key': 'contributionIds', 'type': '[str]'} } def __init__(self, context=None, contribution_ids=None): super(DataProviderQuery, self).__init__() self.context = context self.contribution_ids = contribution_ids class DataProviderResult(Model): """DataProviderResult. :param client_providers: This is the set of data providers that were requested, but either they were defined as client providers, or as remote providers that failed and may be retried by the client. :type client_providers: dict :param data: Property bag of data keyed off of the data provider contribution id :type data: dict :param exceptions: Set of exceptions that occurred resolving the data providers. :type exceptions: dict :param resolved_providers: List of data providers resolved in the data-provider query :type resolved_providers: list of :class:`ResolvedDataProvider ` :param scope_name: Scope name applied to this data provider result. :type scope_name: str :param scope_value: Scope value applied to this data provider result. :type scope_value: str :param shared_data: Property bag of shared data that was contributed to by any of the individual data providers :type shared_data: dict """ _attribute_map = { 'client_providers': {'key': 'clientProviders', 'type': '{ClientDataProviderQuery}'}, 'data': {'key': 'data', 'type': '{object}'}, 'exceptions': {'key': 'exceptions', 'type': '{DataProviderExceptionDetails}'}, 'resolved_providers': {'key': 'resolvedProviders', 'type': '[ResolvedDataProvider]'}, 'scope_name': {'key': 'scopeName', 'type': 'str'}, 'scope_value': {'key': 'scopeValue', 'type': 'str'}, 'shared_data': {'key': 'sharedData', 'type': '{object}'} } def __init__(self, client_providers=None, data=None, exceptions=None, resolved_providers=None, scope_name=None, scope_value=None, shared_data=None): super(DataProviderResult, self).__init__() self.client_providers = client_providers self.data = data self.exceptions = exceptions self.resolved_providers = resolved_providers self.scope_name = scope_name self.scope_value = scope_value self.shared_data = shared_data class ExtensionEventCallback(Model): """ExtensionEventCallback. :param uri: The uri of the endpoint that is hit when an event occurs :type uri: str """ _attribute_map = { 'uri': {'key': 'uri', 'type': 'str'} } def __init__(self, uri=None): super(ExtensionEventCallback, self).__init__() self.uri = uri class ExtensionEventCallbackCollection(Model): """ExtensionEventCallbackCollection. :param post_disable: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension disable has occurred. :type post_disable: :class:`ExtensionEventCallback ` :param post_enable: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension enable has occurred. :type post_enable: :class:`ExtensionEventCallback ` :param post_install: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension install has completed. :type post_install: :class:`ExtensionEventCallback ` :param post_uninstall: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension uninstall has occurred. :type post_uninstall: :class:`ExtensionEventCallback ` :param post_update: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension update has occurred. :type post_update: :class:`ExtensionEventCallback ` :param pre_install: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension install is about to occur. Response indicates whether to proceed or abort. :type pre_install: :class:`ExtensionEventCallback ` :param version_check: For multi-version extensions, defines an endpoint that gets called via an OPTIONS request to determine the particular version of the extension to be used :type version_check: :class:`ExtensionEventCallback ` """ _attribute_map = { 'post_disable': {'key': 'postDisable', 'type': 'ExtensionEventCallback'}, 'post_enable': {'key': 'postEnable', 'type': 'ExtensionEventCallback'}, 'post_install': {'key': 'postInstall', 'type': 'ExtensionEventCallback'}, 'post_uninstall': {'key': 'postUninstall', 'type': 'ExtensionEventCallback'}, 'post_update': {'key': 'postUpdate', 'type': 'ExtensionEventCallback'}, 'pre_install': {'key': 'preInstall', 'type': 'ExtensionEventCallback'}, 'version_check': {'key': 'versionCheck', 'type': 'ExtensionEventCallback'} } def __init__(self, post_disable=None, post_enable=None, post_install=None, post_uninstall=None, post_update=None, pre_install=None, version_check=None): super(ExtensionEventCallbackCollection, self).__init__() self.post_disable = post_disable self.post_enable = post_enable self.post_install = post_install self.post_uninstall = post_uninstall self.post_update = post_update self.pre_install = pre_install self.version_check = version_check class ExtensionFile(Model): """ExtensionFile. :param asset_type: :type asset_type: str :param language: :type language: str :param source: :type source: str """ _attribute_map = { 'asset_type': {'key': 'assetType', 'type': 'str'}, 'language': {'key': 'language', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'} } def __init__(self, asset_type=None, language=None, source=None): super(ExtensionFile, self).__init__() self.asset_type = asset_type self.language = language self.source = source class ExtensionLicensing(Model): """ExtensionLicensing. :param overrides: A list of contributions which deviate from the default licensing behavior :type overrides: list of :class:`LicensingOverride ` """ _attribute_map = { 'overrides': {'key': 'overrides', 'type': '[LicensingOverride]'} } def __init__(self, overrides=None): super(ExtensionLicensing, self).__init__() self.overrides = overrides class ExtensionManifest(Model): """ExtensionManifest. :param base_uri: Uri used as base for other relative uri's defined in extension :type base_uri: str :param constraints: List of shared constraints defined by this extension :type constraints: list of :class:`ContributionConstraint ` :param contributions: List of contributions made by this extension :type contributions: list of :class:`Contribution ` :param contribution_types: List of contribution types defined by this extension :type contribution_types: list of :class:`ContributionType ` :param demands: List of explicit demands required by this extension :type demands: list of str :param event_callbacks: Collection of endpoints that get called when particular extension events occur :type event_callbacks: :class:`ExtensionEventCallbackCollection ` :param fallback_base_uri: Secondary location that can be used as base for other relative uri's defined in extension :type fallback_base_uri: str :param language: Language Culture Name set by the Gallery :type language: str :param licensing: How this extension behaves with respect to licensing :type licensing: :class:`ExtensionLicensing ` :param manifest_version: Version of the extension manifest format/content :type manifest_version: float :param restricted_to: Default user claims applied to all contributions (except the ones which have been speficied restrictedTo explicitly) to control the visibility of a contribution. :type restricted_to: list of str :param scopes: List of all oauth scopes required by this extension :type scopes: list of str :param service_instance_type: The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed :type service_instance_type: str """ _attribute_map = { 'base_uri': {'key': 'baseUri', 'type': 'str'}, 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'contributions': {'key': 'contributions', 'type': '[Contribution]'}, 'contribution_types': {'key': 'contributionTypes', 'type': '[ContributionType]'}, 'demands': {'key': 'demands', 'type': '[str]'}, 'event_callbacks': {'key': 'eventCallbacks', 'type': 'ExtensionEventCallbackCollection'}, 'fallback_base_uri': {'key': 'fallbackBaseUri', 'type': 'str'}, 'language': {'key': 'language', 'type': 'str'}, 'licensing': {'key': 'licensing', 'type': 'ExtensionLicensing'}, 'manifest_version': {'key': 'manifestVersion', 'type': 'float'}, 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'scopes': {'key': 'scopes', 'type': '[str]'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'} } def __init__(self, base_uri=None, constraints=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, restricted_to=None, scopes=None, service_instance_type=None): super(ExtensionManifest, self).__init__() self.base_uri = base_uri self.constraints = constraints self.contributions = contributions self.contribution_types = contribution_types self.demands = demands self.event_callbacks = event_callbacks self.fallback_base_uri = fallback_base_uri self.language = language self.licensing = licensing self.manifest_version = manifest_version self.restricted_to = restricted_to self.scopes = scopes self.service_instance_type = service_instance_type class InstalledExtension(ExtensionManifest): """InstalledExtension. :param base_uri: Uri used as base for other relative uri's defined in extension :type base_uri: str :param constraints: List of shared constraints defined by this extension :type constraints: list of :class:`ContributionConstraint ` :param contributions: List of contributions made by this extension :type contributions: list of :class:`Contribution ` :param contribution_types: List of contribution types defined by this extension :type contribution_types: list of :class:`ContributionType ` :param demands: List of explicit demands required by this extension :type demands: list of str :param event_callbacks: Collection of endpoints that get called when particular extension events occur :type event_callbacks: :class:`ExtensionEventCallbackCollection ` :param fallback_base_uri: Secondary location that can be used as base for other relative uri's defined in extension :type fallback_base_uri: str :param language: Language Culture Name set by the Gallery :type language: str :param licensing: How this extension behaves with respect to licensing :type licensing: :class:`ExtensionLicensing ` :param manifest_version: Version of the extension manifest format/content :type manifest_version: float :param restricted_to: Default user claims applied to all contributions (except the ones which have been speficied restrictedTo explicitly) to control the visibility of a contribution. :type restricted_to: list of str :param scopes: List of all oauth scopes required by this extension :type scopes: list of str :param service_instance_type: The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed :type service_instance_type: str :param extension_id: The friendly extension id for this extension - unique for a given publisher. :type extension_id: str :param extension_name: The display name of the extension. :type extension_name: str :param files: This is the set of files available from the extension. :type files: list of :class:`ExtensionFile ` :param flags: Extension flags relevant to contribution consumers :type flags: object :param install_state: Information about this particular installation of the extension :type install_state: :class:`InstalledExtensionState ` :param last_published: This represents the date/time the extensions was last updated in the gallery. This doesnt mean this version was updated the value represents changes to any and all versions of the extension. :type last_published: datetime :param publisher_id: Unique id of the publisher of this extension :type publisher_id: str :param publisher_name: The display name of the publisher :type publisher_name: str :param registration_id: Unique id for this extension (the same id is used for all versions of a single extension) :type registration_id: str :param version: Version of this extension :type version: str """ _attribute_map = { 'base_uri': {'key': 'baseUri', 'type': 'str'}, 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'contributions': {'key': 'contributions', 'type': '[Contribution]'}, 'contribution_types': {'key': 'contributionTypes', 'type': '[ContributionType]'}, 'demands': {'key': 'demands', 'type': '[str]'}, 'event_callbacks': {'key': 'eventCallbacks', 'type': 'ExtensionEventCallbackCollection'}, 'fallback_base_uri': {'key': 'fallbackBaseUri', 'type': 'str'}, 'language': {'key': 'language', 'type': 'str'}, 'licensing': {'key': 'licensing', 'type': 'ExtensionLicensing'}, 'manifest_version': {'key': 'manifestVersion', 'type': 'float'}, 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'scopes': {'key': 'scopes', 'type': '[str]'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'files': {'key': 'files', 'type': '[ExtensionFile]'}, 'flags': {'key': 'flags', 'type': 'object'}, 'install_state': {'key': 'installState', 'type': 'InstalledExtensionState'}, 'last_published': {'key': 'lastPublished', 'type': 'iso-8601'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'registration_id': {'key': 'registrationId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, base_uri=None, constraints=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, restricted_to=None, scopes=None, service_instance_type=None, extension_id=None, extension_name=None, files=None, flags=None, install_state=None, last_published=None, publisher_id=None, publisher_name=None, registration_id=None, version=None): super(InstalledExtension, self).__init__(base_uri=base_uri, constraints=constraints, contributions=contributions, contribution_types=contribution_types, demands=demands, event_callbacks=event_callbacks, fallback_base_uri=fallback_base_uri, language=language, licensing=licensing, manifest_version=manifest_version, restricted_to=restricted_to, scopes=scopes, service_instance_type=service_instance_type) self.extension_id = extension_id self.extension_name = extension_name self.files = files self.flags = flags self.install_state = install_state self.last_published = last_published self.publisher_id = publisher_id self.publisher_name = publisher_name self.registration_id = registration_id self.version = version class InstalledExtensionState(Model): """InstalledExtensionState. :param flags: States of an installed extension :type flags: object :param installation_issues: List of installation issues :type installation_issues: list of :class:`InstalledExtensionStateIssue ` :param last_updated: The time at which this installation was last updated :type last_updated: datetime """ _attribute_map = { 'flags': {'key': 'flags', 'type': 'object'}, 'installation_issues': {'key': 'installationIssues', 'type': '[InstalledExtensionStateIssue]'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'} } def __init__(self, flags=None, installation_issues=None, last_updated=None): super(InstalledExtensionState, self).__init__() self.flags = flags self.installation_issues = installation_issues self.last_updated = last_updated class InstalledExtensionStateIssue(Model): """InstalledExtensionStateIssue. :param message: The error message :type message: str :param source: Source of the installation issue, for example "Demands" :type source: str :param type: Installation issue type (Warning, Error) :type type: object """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, message=None, source=None, type=None): super(InstalledExtensionStateIssue, self).__init__() self.message = message self.source = source self.type = type class LicensingOverride(Model): """LicensingOverride. :param behavior: How the inclusion of this contribution should change based on licensing :type behavior: object :param id: Fully qualified contribution id which we want to define licensing behavior for :type id: str """ _attribute_map = { 'behavior': {'key': 'behavior', 'type': 'object'}, 'id': {'key': 'id', 'type': 'str'} } def __init__(self, behavior=None, id=None): super(LicensingOverride, self).__init__() self.behavior = behavior self.id = id class ResolvedDataProvider(Model): """ResolvedDataProvider. :param duration: The total time the data provider took to resolve its data (in milliseconds) :type duration: int :param error: :type error: str :param id: :type id: str """ _attribute_map = { 'duration': {'key': 'duration', 'type': 'int'}, 'error': {'key': 'error', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'} } def __init__(self, duration=None, error=None, id=None): super(ResolvedDataProvider, self).__init__() self.duration = duration self.error = error self.id = id class ClientDataProviderQuery(DataProviderQuery): """ClientDataProviderQuery. :param context: Contextual information to pass to the data providers :type context: :class:`DataProviderContext ` :param contribution_ids: The contribution ids of the data providers to resolve :type contribution_ids: list of str :param query_service_instance_type: The Id of the service instance type that should be communicated with in order to resolve the data providers from the client given the query values. :type query_service_instance_type: str """ _attribute_map = { 'context': {'key': 'context', 'type': 'DataProviderContext'}, 'contribution_ids': {'key': 'contributionIds', 'type': '[str]'}, 'query_service_instance_type': {'key': 'queryServiceInstanceType', 'type': 'str'} } def __init__(self, context=None, contribution_ids=None, query_service_instance_type=None): super(ClientDataProviderQuery, self).__init__(context=context, contribution_ids=contribution_ids) self.query_service_instance_type = query_service_instance_type class Contribution(ContributionBase): """Contribution. :param description: Description of the contribution/type :type description: str :param id: Fully qualified identifier of the contribution/type :type id: str :param visible_to: VisibleTo can be used to restrict whom can reference a given contribution/type. This value should be a list of publishers or extensions access is restricted too. Examples: "ms" - Means only the "ms" publisher can reference this. "ms.vss-web" - Means only the "vss-web" extension from the "ms" publisher can reference this. :type visible_to: list of str :param constraints: List of constraints (filters) that should be applied to the availability of this contribution :type constraints: list of :class:`ContributionConstraint ` :param includes: Includes is a set of contributions that should have this contribution included in their targets list. :type includes: list of str :param properties: Properties/attributes of this contribution :type properties: :class:`object ` :param restricted_to: List of demanded claims in order for the user to see this contribution (like anonymous, public, member...). :type restricted_to: list of str :param targets: The ids of the contribution(s) that this contribution targets. (parent contributions) :type targets: list of str :param type: Id of the Contribution Type :type type: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'visible_to': {'key': 'visibleTo', 'type': '[str]'}, 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'includes': {'key': 'includes', 'type': '[str]'}, 'properties': {'key': 'properties', 'type': 'object'}, 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'targets': {'key': 'targets', 'type': '[str]'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, description=None, id=None, visible_to=None, constraints=None, includes=None, properties=None, restricted_to=None, targets=None, type=None): super(Contribution, self).__init__(description=description, id=id, visible_to=visible_to) self.constraints = constraints self.includes = includes self.properties = properties self.restricted_to = restricted_to self.targets = targets self.type = type __all__ = [ 'ClientContribution', 'ClientContributionNode', 'ClientContributionProviderDetails', 'ContributionBase', 'ContributionConstraint', 'ContributionNodeQuery', 'ContributionNodeQueryResult', 'ContributionPropertyDescription', 'ContributionType', 'DataProviderContext', 'DataProviderExceptionDetails', 'DataProviderQuery', 'DataProviderResult', 'ExtensionEventCallback', 'ExtensionEventCallbackCollection', 'ExtensionFile', 'ExtensionLicensing', 'ExtensionManifest', 'InstalledExtension', 'InstalledExtensionState', 'InstalledExtensionStateIssue', 'LicensingOverride', 'ResolvedDataProvider', 'ClientDataProviderQuery', 'Contribution', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/core/000077500000000000000000000000001360605530400300055ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/core/__init__.py000066400000000000000000000022511360605530400321160ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .core_client import CoreClient __all__ = [ 'GraphSubjectBase', 'IdentityData', 'IdentityRef', 'JsonPatchOperation', 'OperationReference', 'Process', 'ProcessReference', 'ProjectInfo', 'ProjectProperty', 'Proxy', 'ProxyAuthorization', 'PublicKey', 'ReferenceLinks', 'TeamMember', 'TeamProject', 'TeamProjectCollection', 'TeamProjectCollectionReference', 'TeamProjectReference', 'WebApiConnectedService', 'WebApiConnectedServiceDetails', 'WebApiConnectedServiceRef', 'WebApiTeam', 'WebApiTeamRef', 'CoreClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/core/core_client.py000066400000000000000000000574301360605530400326560ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class CoreClient(Client): """Core :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(CoreClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '79134c72-4a58-4b42-976c-04e7115f32bf' def create_connected_service(self, connected_service_creation_data, project_id): """CreateConnectedService. [Preview API] :param :class:` ` connected_service_creation_data: :param str project_id: :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') content = self._serialize.body(connected_service_creation_data, 'WebApiConnectedServiceDetails') response = self._send(http_method='POST', location_id='b4f70219-e18b-42c5-abe3-98b07d35525e', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WebApiConnectedService', response) def get_connected_service_details(self, project_id, name): """GetConnectedServiceDetails. [Preview API] :param str project_id: :param str name: :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='b4f70219-e18b-42c5-abe3-98b07d35525e', version='5.0-preview.1', route_values=route_values) return self._deserialize('WebApiConnectedServiceDetails', response) def get_connected_services(self, project_id, kind=None): """GetConnectedServices. [Preview API] :param str project_id: :param str kind: :rtype: [WebApiConnectedService] """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') query_parameters = {} if kind is not None: query_parameters['kind'] = self._serialize.query('kind', kind, 'str') response = self._send(http_method='GET', location_id='b4f70219-e18b-42c5-abe3-98b07d35525e', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WebApiConnectedService]', self._unwrap_collection(response)) def get_team_members_with_extended_properties(self, project_id, team_id, top=None, skip=None): """GetTeamMembersWithExtendedProperties. Get a list of members for a specific team. :param str project_id: The name or ID (GUID) of the team project the team belongs to. :param str team_id: The name or ID (GUID) of the team . :param int top: :param int skip: :rtype: [TeamMember] """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') if team_id is not None: route_values['teamId'] = self._serialize.url('team_id', team_id, 'str') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='294c494c-2600-4d7e-b76c-3dd50c3c95be', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TeamMember]', self._unwrap_collection(response)) def get_process_by_id(self, process_id): """GetProcessById. Get a process by ID. :param str process_id: ID for a process. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') response = self._send(http_method='GET', location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8', version='5.0', route_values=route_values) return self._deserialize('Process', response) def get_processes(self): """GetProcesses. Get a list of processes. :rtype: [Process] """ response = self._send(http_method='GET', location_id='93878975-88c5-4e6a-8abb-7ddd77a8a7d8', version='5.0') return self._deserialize('[Process]', self._unwrap_collection(response)) def get_project_collection(self, collection_id): """GetProjectCollection. Get project collection with the specified id or name. :param str collection_id: :rtype: :class:` ` """ route_values = {} if collection_id is not None: route_values['collectionId'] = self._serialize.url('collection_id', collection_id, 'str') response = self._send(http_method='GET', location_id='8031090f-ef1d-4af6-85fc-698cd75d42bf', version='5.0', route_values=route_values) return self._deserialize('TeamProjectCollection', response) def get_project_collections(self, top=None, skip=None): """GetProjectCollections. Get project collection references for this application. :param int top: :param int skip: :rtype: [TeamProjectCollectionReference] """ query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='8031090f-ef1d-4af6-85fc-698cd75d42bf', version='5.0', query_parameters=query_parameters) return self._deserialize('[TeamProjectCollectionReference]', self._unwrap_collection(response)) def get_project(self, project_id, include_capabilities=None, include_history=None): """GetProject. Get project with the specified id or name, optionally including capabilities. :param str project_id: :param bool include_capabilities: Include capabilities (such as source control) in the team project result (default: false). :param bool include_history: Search within renamed projects (that had such name in the past). :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') query_parameters = {} if include_capabilities is not None: query_parameters['includeCapabilities'] = self._serialize.query('include_capabilities', include_capabilities, 'bool') if include_history is not None: query_parameters['includeHistory'] = self._serialize.query('include_history', include_history, 'bool') response = self._send(http_method='GET', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TeamProject', response) def get_projects(self, state_filter=None, top=None, skip=None, continuation_token=None, get_default_team_image_url=None): """GetProjects. Get all projects in the organization that the authenticated user has access to. :param str state_filter: Filter on team projects in a specific team project state (default: WellFormed). :param int top: :param int skip: :param str continuation_token: :param bool get_default_team_image_url: :rtype: [TeamProjectReference] """ query_parameters = {} if state_filter is not None: query_parameters['stateFilter'] = self._serialize.query('state_filter', state_filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if get_default_team_image_url is not None: query_parameters['getDefaultTeamImageUrl'] = self._serialize.query('get_default_team_image_url', get_default_team_image_url, 'bool') response = self._send(http_method='GET', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.0', query_parameters=query_parameters) return self._deserialize('[TeamProjectReference]', self._unwrap_collection(response)) def queue_create_project(self, project_to_create): """QueueCreateProject. Queues a project to be created. Use the [GetOperation](../../operations/operations/get) to periodically check for create project status. :param :class:` ` project_to_create: The project to create. :rtype: :class:` ` """ content = self._serialize.body(project_to_create, 'TeamProject') response = self._send(http_method='POST', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.0', content=content) return self._deserialize('OperationReference', response) def queue_delete_project(self, project_id): """QueueDeleteProject. Queues a project to be deleted. Use the [GetOperation](../../operations/operations/get) to periodically check for delete project status. :param str project_id: The project id of the project to delete. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') response = self._send(http_method='DELETE', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.0', route_values=route_values) return self._deserialize('OperationReference', response) def update_project(self, project_update, project_id): """UpdateProject. Update an existing project's name, abbreviation, or description. :param :class:` ` project_update: The updates for the project. :param str project_id: The project id of the project to update. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') content = self._serialize.body(project_update, 'TeamProject') response = self._send(http_method='PATCH', location_id='603fe2ac-9723-48b9-88ad-09305aa6c6e1', version='5.0', route_values=route_values, content=content) return self._deserialize('OperationReference', response) def get_project_properties(self, project_id, keys=None): """GetProjectProperties. [Preview API] Get a collection of team project properties. :param str project_id: The team project ID. :param [str] keys: A comma-delimited string of team project property names. Wildcard characters ("?" and "*") are supported. If no key is specified, all properties will be returned. :rtype: [ProjectProperty] """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') query_parameters = {} if keys is not None: keys = ",".join(keys) query_parameters['keys'] = self._serialize.query('keys', keys, 'str') response = self._send(http_method='GET', location_id='4976a71a-4487-49aa-8aab-a1eda469037a', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ProjectProperty]', self._unwrap_collection(response)) def set_project_properties(self, project_id, patch_document): """SetProjectProperties. [Preview API] Create, update, and delete team project properties. :param str project_id: The team project ID. :param :class:`<[JsonPatchOperation]> ` patch_document: A JSON Patch document that represents an array of property operations. See RFC 6902 for more details on JSON Patch. The accepted operation verbs are Add and Remove, where Add is used for both creating and updating properties. The path consists of a forward slash and a property name. """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') content = self._serialize.body(patch_document, '[JsonPatchOperation]') self._send(http_method='PATCH', location_id='4976a71a-4487-49aa-8aab-a1eda469037a', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') def create_or_update_proxy(self, proxy): """CreateOrUpdateProxy. [Preview API] :param :class:` ` proxy: :rtype: :class:` ` """ content = self._serialize.body(proxy, 'Proxy') response = self._send(http_method='PUT', location_id='ec1f4311-f2b4-4c15-b2b8-8990b80d2908', version='5.0-preview.2', content=content) return self._deserialize('Proxy', response) def delete_proxy(self, proxy_url, site=None): """DeleteProxy. [Preview API] :param str proxy_url: :param str site: """ query_parameters = {} if proxy_url is not None: query_parameters['proxyUrl'] = self._serialize.query('proxy_url', proxy_url, 'str') if site is not None: query_parameters['site'] = self._serialize.query('site', site, 'str') self._send(http_method='DELETE', location_id='ec1f4311-f2b4-4c15-b2b8-8990b80d2908', version='5.0-preview.2', query_parameters=query_parameters) def get_proxies(self, proxy_url=None): """GetProxies. [Preview API] :param str proxy_url: :rtype: [Proxy] """ query_parameters = {} if proxy_url is not None: query_parameters['proxyUrl'] = self._serialize.query('proxy_url', proxy_url, 'str') response = self._send(http_method='GET', location_id='ec1f4311-f2b4-4c15-b2b8-8990b80d2908', version='5.0-preview.2', query_parameters=query_parameters) return self._deserialize('[Proxy]', self._unwrap_collection(response)) def create_team(self, team, project_id): """CreateTeam. Create a team in a team project. :param :class:` ` team: The team data used to create the team. :param str project_id: The name or ID (GUID) of the team project in which to create the team. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') content = self._serialize.body(team, 'WebApiTeam') response = self._send(http_method='POST', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.0', route_values=route_values, content=content) return self._deserialize('WebApiTeam', response) def delete_team(self, project_id, team_id): """DeleteTeam. Delete a team. :param str project_id: The name or ID (GUID) of the team project containing the team to delete. :param str team_id: The name of ID of the team to delete. """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') if team_id is not None: route_values['teamId'] = self._serialize.url('team_id', team_id, 'str') self._send(http_method='DELETE', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.0', route_values=route_values) def get_team(self, project_id, team_id): """GetTeam. Get a specific team. :param str project_id: The name or ID (GUID) of the team project containing the team. :param str team_id: The name or ID (GUID) of the team. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') if team_id is not None: route_values['teamId'] = self._serialize.url('team_id', team_id, 'str') response = self._send(http_method='GET', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.0', route_values=route_values) return self._deserialize('WebApiTeam', response) def get_teams(self, project_id, mine=None, top=None, skip=None): """GetTeams. Get a list of teams. :param str project_id: :param bool mine: If true return all the teams requesting user is member, otherwise return all the teams user has read access :param int top: Maximum number of teams to return. :param int skip: Number of teams to skip. :rtype: [WebApiTeam] """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') query_parameters = {} if mine is not None: query_parameters['$mine'] = self._serialize.query('mine', mine, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WebApiTeam]', self._unwrap_collection(response)) def update_team(self, team_data, project_id, team_id): """UpdateTeam. Update a team's name and/or description. :param :class:` ` team_data: :param str project_id: The name or ID (GUID) of the team project containing the team to update. :param str team_id: The name of ID of the team to update. :rtype: :class:` ` """ route_values = {} if project_id is not None: route_values['projectId'] = self._serialize.url('project_id', project_id, 'str') if team_id is not None: route_values['teamId'] = self._serialize.url('team_id', team_id, 'str') content = self._serialize.body(team_data, 'WebApiTeam') response = self._send(http_method='PATCH', location_id='d30a3dd1-f8ba-442a-b86a-bd0c0c383e59', version='5.0', route_values=route_values, content=content) return self._deserialize('WebApiTeam', response) def get_all_teams(self, mine=None, top=None, skip=None): """GetAllTeams. [Preview API] Get a list of all teams. :param bool mine: If true return all the teams requesting user is member, otherwise return all the teams user has read access :param int top: Maximum number of teams to return. :param int skip: Number of teams to skip. :rtype: [WebApiTeam] """ query_parameters = {} if mine is not None: query_parameters['$mine'] = self._serialize.query('mine', mine, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='7a4d9ee9-3433-4347-b47a-7a80f1cf307e', version='5.0-preview.2', query_parameters=query_parameters) return self._deserialize('[WebApiTeam]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/core/models.py000066400000000000000000000661031360605530400316500ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityData(Model): """IdentityData. :param identity_ids: :type identity_ids: list of str """ _attribute_map = { 'identity_ids': {'key': 'identityIds', 'type': '[str]'} } def __init__(self, identity_ids=None): super(IdentityData, self).__init__() self.identity_ids = identity_ids class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class OperationReference(Model): """OperationReference. :param id: Unique identifier for the operation. :type id: str :param plugin_id: Unique identifier for the plugin. :type plugin_id: str :param status: The current status of the operation. :type status: object :param url: URL to get the full operation object. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'plugin_id': {'key': 'pluginId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, plugin_id=None, status=None, url=None): super(OperationReference, self).__init__() self.id = id self.plugin_id = plugin_id self.status = status self.url = url class ProcessReference(Model): """ProcessReference. :param name: :type name: str :param url: :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, url=None): super(ProcessReference, self).__init__() self.name = name self.url = url class ProjectInfo(Model): """ProjectInfo. :param abbreviation: :type abbreviation: str :param description: :type description: str :param id: :type id: str :param last_update_time: :type last_update_time: datetime :param name: :type name: str :param properties: :type properties: list of :class:`ProjectProperty ` :param revision: Current revision of the project :type revision: long :param state: :type state: object :param uri: :type uri: str :param version: :type version: long :param visibility: :type visibility: object """ _attribute_map = { 'abbreviation': {'key': 'abbreviation', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'last_update_time': {'key': 'lastUpdateTime', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '[ProjectProperty]'}, 'revision': {'key': 'revision', 'type': 'long'}, 'state': {'key': 'state', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'version': {'key': 'version', 'type': 'long'}, 'visibility': {'key': 'visibility', 'type': 'object'} } def __init__(self, abbreviation=None, description=None, id=None, last_update_time=None, name=None, properties=None, revision=None, state=None, uri=None, version=None, visibility=None): super(ProjectInfo, self).__init__() self.abbreviation = abbreviation self.description = description self.id = id self.last_update_time = last_update_time self.name = name self.properties = properties self.revision = revision self.state = state self.uri = uri self.version = version self.visibility = visibility class ProjectProperty(Model): """ProjectProperty. :param name: :type name: str :param value: :type value: object """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, name=None, value=None): super(ProjectProperty, self).__init__() self.name = name self.value = value class Proxy(Model): """Proxy. :param authorization: :type authorization: :class:`ProxyAuthorization ` :param description: This is a description string :type description: str :param friendly_name: The friendly name of the server :type friendly_name: str :param global_default: :type global_default: bool :param site: This is a string representation of the site that the proxy server is located in (e.g. "NA-WA-RED") :type site: str :param site_default: :type site_default: bool :param url: The URL of the proxy server :type url: str """ _attribute_map = { 'authorization': {'key': 'authorization', 'type': 'ProxyAuthorization'}, 'description': {'key': 'description', 'type': 'str'}, 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'global_default': {'key': 'globalDefault', 'type': 'bool'}, 'site': {'key': 'site', 'type': 'str'}, 'site_default': {'key': 'siteDefault', 'type': 'bool'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, authorization=None, description=None, friendly_name=None, global_default=None, site=None, site_default=None, url=None): super(Proxy, self).__init__() self.authorization = authorization self.description = description self.friendly_name = friendly_name self.global_default = global_default self.site = site self.site_default = site_default self.url = url class ProxyAuthorization(Model): """ProxyAuthorization. :param authorization_url: Gets or sets the endpoint used to obtain access tokens from the configured token service. :type authorization_url: str :param client_id: Gets or sets the client identifier for this proxy. :type client_id: str :param identity: Gets or sets the user identity to authorize for on-prem. :type identity: :class:`str ` :param public_key: Gets or sets the public key used to verify the identity of this proxy. Only specify on hosted. :type public_key: :class:`PublicKey ` """ _attribute_map = { 'authorization_url': {'key': 'authorizationUrl', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, 'identity': {'key': 'identity', 'type': 'str'}, 'public_key': {'key': 'publicKey', 'type': 'PublicKey'} } def __init__(self, authorization_url=None, client_id=None, identity=None, public_key=None): super(ProxyAuthorization, self).__init__() self.authorization_url = authorization_url self.client_id = client_id self.identity = identity self.public_key = public_key class PublicKey(Model): """PublicKey. :param exponent: Gets or sets the exponent for the public key. :type exponent: str :param modulus: Gets or sets the modulus for the public key. :type modulus: str """ _attribute_map = { 'exponent': {'key': 'exponent', 'type': 'str'}, 'modulus': {'key': 'modulus', 'type': 'str'} } def __init__(self, exponent=None, modulus=None): super(PublicKey, self).__init__() self.exponent = exponent self.modulus = modulus class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class TeamMember(Model): """TeamMember. :param identity: :type identity: :class:`IdentityRef ` :param is_team_admin: :type is_team_admin: bool """ _attribute_map = { 'identity': {'key': 'identity', 'type': 'IdentityRef'}, 'is_team_admin': {'key': 'isTeamAdmin', 'type': 'bool'} } def __init__(self, identity=None, is_team_admin=None): super(TeamMember, self).__init__() self.identity = identity self.is_team_admin = is_team_admin class TeamProjectCollectionReference(Model): """TeamProjectCollectionReference. :param id: Collection Id. :type id: str :param name: Collection Name. :type name: str :param url: Collection REST Url. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, name=None, url=None): super(TeamProjectCollectionReference, self).__init__() self.id = id self.name = name self.url = url class TeamProjectReference(Model): """TeamProjectReference. :param abbreviation: Project abbreviation. :type abbreviation: str :param default_team_image_url: Url to default team identity image. :type default_team_image_url: str :param description: The project's description (if any). :type description: str :param id: Project identifier. :type id: str :param name: Project name. :type name: str :param revision: Project revision. :type revision: long :param state: Project state. :type state: object :param url: Url to the full version of the object. :type url: str :param visibility: Project visibility. :type visibility: object """ _attribute_map = { 'abbreviation': {'key': 'abbreviation', 'type': 'str'}, 'default_team_image_url': {'key': 'defaultTeamImageUrl', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'long'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'visibility': {'key': 'visibility', 'type': 'object'} } def __init__(self, abbreviation=None, default_team_image_url=None, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): super(TeamProjectReference, self).__init__() self.abbreviation = abbreviation self.default_team_image_url = default_team_image_url self.description = description self.id = id self.name = name self.revision = revision self.state = state self.url = url self.visibility = visibility class WebApiConnectedServiceRef(Model): """WebApiConnectedServiceRef. :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(WebApiConnectedServiceRef, self).__init__() self.id = id self.url = url class WebApiTeamRef(Model): """WebApiTeamRef. :param id: Team (Identity) Guid. A Team Foundation ID. :type id: str :param name: Team name :type name: str :param url: Team REST API Url :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, name=None, url=None): super(WebApiTeamRef, self).__init__() self.id = id self.name = name self.url = url class Process(ProcessReference): """Process. :param name: :type name: str :param url: :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param description: :type description: str :param id: :type id: str :param is_default: :type is_default: bool :param type: :type type: object """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, name=None, url=None, _links=None, description=None, id=None, is_default=None, type=None): super(Process, self).__init__(name=name, url=url) self._links = _links self.description = description self.id = id self.is_default = is_default self.type = type class TeamProject(TeamProjectReference): """TeamProject. :param abbreviation: Project abbreviation. :type abbreviation: str :param default_team_image_url: Url to default team identity image. :type default_team_image_url: str :param description: The project's description (if any). :type description: str :param id: Project identifier. :type id: str :param name: Project name. :type name: str :param revision: Project revision. :type revision: long :param state: Project state. :type state: object :param url: Url to the full version of the object. :type url: str :param visibility: Project visibility. :type visibility: object :param _links: The links to other objects related to this object. :type _links: :class:`ReferenceLinks ` :param capabilities: Set of capabilities this project has (such as process template & version control). :type capabilities: dict :param default_team: The shallow ref to the default team. :type default_team: :class:`WebApiTeamRef ` """ _attribute_map = { 'abbreviation': {'key': 'abbreviation', 'type': 'str'}, 'default_team_image_url': {'key': 'defaultTeamImageUrl', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'long'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'visibility': {'key': 'visibility', 'type': 'object'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'capabilities': {'key': 'capabilities', 'type': '{{str}}'}, 'default_team': {'key': 'defaultTeam', 'type': 'WebApiTeamRef'} } def __init__(self, abbreviation=None, default_team_image_url=None, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None, _links=None, capabilities=None, default_team=None): super(TeamProject, self).__init__(abbreviation=abbreviation, default_team_image_url=default_team_image_url, description=description, id=id, name=name, revision=revision, state=state, url=url, visibility=visibility) self._links = _links self.capabilities = capabilities self.default_team = default_team class TeamProjectCollection(TeamProjectCollectionReference): """TeamProjectCollection. :param id: Collection Id. :type id: str :param name: Collection Name. :type name: str :param url: Collection REST Url. :type url: str :param _links: The links to other objects related to this object. :type _links: :class:`ReferenceLinks ` :param description: Project collection description. :type description: str :param process_customization_type: Process customzation type on this collection. It can be Xml or Inherited. :type process_customization_type: object :param state: Project collection state. :type state: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'process_customization_type': {'key': 'processCustomizationType', 'type': 'object'}, 'state': {'key': 'state', 'type': 'str'} } def __init__(self, id=None, name=None, url=None, _links=None, description=None, process_customization_type=None, state=None): super(TeamProjectCollection, self).__init__(id=id, name=name, url=url) self._links = _links self.description = description self.process_customization_type = process_customization_type self.state = state class WebApiConnectedService(WebApiConnectedServiceRef): """WebApiConnectedService. :param url: :type url: str :param authenticated_by: The user who did the OAuth authentication to created this service :type authenticated_by: :class:`IdentityRef ` :param description: Extra description on the service. :type description: str :param friendly_name: Friendly Name of service connection :type friendly_name: str :param id: Id/Name of the connection service. For Ex: Subscription Id for Azure Connection :type id: str :param kind: The kind of service. :type kind: str :param project: The project associated with this service :type project: :class:`TeamProjectReference ` :param service_uri: Optional uri to connect directly to the service such as https://windows.azure.com :type service_uri: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, 'authenticated_by': {'key': 'authenticatedBy', 'type': 'IdentityRef'}, 'description': {'key': 'description', 'type': 'str'}, 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'kind': {'key': 'kind', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'service_uri': {'key': 'serviceUri', 'type': 'str'} } def __init__(self, url=None, authenticated_by=None, description=None, friendly_name=None, id=None, kind=None, project=None, service_uri=None): super(WebApiConnectedService, self).__init__(url=url) self.authenticated_by = authenticated_by self.description = description self.friendly_name = friendly_name self.id = id self.kind = kind self.project = project self.service_uri = service_uri class WebApiConnectedServiceDetails(WebApiConnectedServiceRef): """WebApiConnectedServiceDetails. :param id: :type id: str :param url: :type url: str :param connected_service_meta_data: Meta data for service connection :type connected_service_meta_data: :class:`WebApiConnectedService ` :param credentials_xml: Credential info :type credentials_xml: str :param end_point: Optional uri to connect directly to the service such as https://windows.azure.com :type end_point: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'connected_service_meta_data': {'key': 'connectedServiceMetaData', 'type': 'WebApiConnectedService'}, 'credentials_xml': {'key': 'credentialsXml', 'type': 'str'}, 'end_point': {'key': 'endPoint', 'type': 'str'} } def __init__(self, id=None, url=None, connected_service_meta_data=None, credentials_xml=None, end_point=None): super(WebApiConnectedServiceDetails, self).__init__(id=id, url=url) self.connected_service_meta_data = connected_service_meta_data self.credentials_xml = credentials_xml self.end_point = end_point class WebApiTeam(WebApiTeamRef): """WebApiTeam. :param id: Team (Identity) Guid. A Team Foundation ID. :type id: str :param name: Team name :type name: str :param url: Team REST API Url :type url: str :param description: Team description :type description: str :param identity_url: Identity REST API Url to this team :type identity_url: str :param project_id: :type project_id: str :param project_name: :type project_name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'identity_url': {'key': 'identityUrl', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'project_name': {'key': 'projectName', 'type': 'str'} } def __init__(self, id=None, name=None, url=None, description=None, identity_url=None, project_id=None, project_name=None): super(WebApiTeam, self).__init__(id=id, name=name, url=url) self.description = description self.identity_url = identity_url self.project_id = project_id self.project_name = project_name __all__ = [ 'GraphSubjectBase', 'IdentityData', 'IdentityRef', 'JsonPatchOperation', 'OperationReference', 'ProcessReference', 'ProjectInfo', 'ProjectProperty', 'Proxy', 'ProxyAuthorization', 'PublicKey', 'ReferenceLinks', 'TeamMember', 'TeamProjectCollectionReference', 'TeamProjectReference', 'WebApiConnectedServiceRef', 'WebApiTeamRef', 'Process', 'TeamProject', 'TeamProjectCollection', 'WebApiConnectedService', 'WebApiConnectedServiceDetails', 'WebApiTeam', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/customer_intelligence/000077500000000000000000000000001360605530400334405ustar00rootroot00000000000000__init__.py000066400000000000000000000013321360605530400354710ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/customer_intelligence# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .customer_intelligence_client import CustomerIntelligenceClient __all__ = [ 'CustomerIntelligenceEvent', 'CustomerIntelligenceClient' ] customer_intelligence_client.py000066400000000000000000000031111360605530400416500ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/customer_intelligence# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class CustomerIntelligenceClient(Client): """CustomerIntelligence :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(CustomerIntelligenceClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def publish_events(self, events): """PublishEvents. [Preview API] :param [CustomerIntelligenceEvent] events: """ content = self._serialize.body(events, '[CustomerIntelligenceEvent]') self._send(http_method='POST', location_id='b5cc35c2-ff2b-491d-a085-24b6e9f396fd', version='5.0-preview.1', content=content) models.py000066400000000000000000000023731360605530400352230ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/customer_intelligence# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class CustomerIntelligenceEvent(Model): """CustomerIntelligenceEvent. :param area: :type area: str :param feature: :type feature: str :param properties: :type properties: dict """ _attribute_map = { 'area': {'key': 'area', 'type': 'str'}, 'feature': {'key': 'feature', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'} } def __init__(self, area=None, feature=None, properties=None): super(CustomerIntelligenceEvent, self).__init__() self.area = area self.feature = feature self.properties = properties __all__ = [ 'CustomerIntelligenceEvent', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/dashboard/000077500000000000000000000000001360605530400310045ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/dashboard/__init__.py000066400000000000000000000020431360605530400331140ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .dashboard_client import DashboardClient __all__ = [ 'Dashboard', 'DashboardGroup', 'DashboardGroupEntry', 'DashboardGroupEntryResponse', 'DashboardResponse', 'LightboxOptions', 'ReferenceLinks', 'SemanticVersion', 'TeamContext', 'Widget', 'WidgetMetadata', 'WidgetMetadataResponse', 'WidgetPosition', 'WidgetResponse', 'WidgetSize', 'WidgetsVersionedList', 'WidgetTypesResponse', 'DashboardClient' ] dashboard_client.py000066400000000000000000000664111360605530400345740ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/dashboard# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class DashboardClient(Client): """Dashboard :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(DashboardClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '31c84e0a-3ece-48fd-a29d-100849af99ba' def create_dashboard(self, dashboard, team_context): """CreateDashboard. [Preview API] Create the supplied dashboard. :param :class:` ` dashboard: The initial state of the dashboard :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(dashboard, 'Dashboard') response = self._send(http_method='POST', location_id='454b3e51-2e6e-48d4-ad81-978154089351', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('Dashboard', response) def delete_dashboard(self, team_context, dashboard_id): """DeleteDashboard. [Preview API] Delete a dashboard given its ID. This also deletes the widgets associated with this dashboard. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of the dashboard to delete. """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') self._send(http_method='DELETE', location_id='454b3e51-2e6e-48d4-ad81-978154089351', version='5.0-preview.2', route_values=route_values) def get_dashboard(self, team_context, dashboard_id): """GetDashboard. [Preview API] Get a dashboard by its ID. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') response = self._send(http_method='GET', location_id='454b3e51-2e6e-48d4-ad81-978154089351', version='5.0-preview.2', route_values=route_values) return self._deserialize('Dashboard', response) def get_dashboards(self, team_context): """GetDashboards. [Preview API] Get a list of dashboards. :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='454b3e51-2e6e-48d4-ad81-978154089351', version='5.0-preview.2', route_values=route_values) return self._deserialize('DashboardGroup', response) def replace_dashboard(self, dashboard, team_context, dashboard_id): """ReplaceDashboard. [Preview API] Replace configuration for the specified dashboard. Replaces Widget list on Dashboard, only if property is supplied. :param :class:` ` dashboard: The Configuration of the dashboard to replace. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of the dashboard to replace. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') content = self._serialize.body(dashboard, 'Dashboard') response = self._send(http_method='PUT', location_id='454b3e51-2e6e-48d4-ad81-978154089351', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('Dashboard', response) def replace_dashboards(self, group, team_context): """ReplaceDashboards. [Preview API] Update the name and position of dashboards in the supplied group, and remove omitted dashboards. Does not modify dashboard content. :param :class:` ` group: :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(group, 'DashboardGroup') response = self._send(http_method='PUT', location_id='454b3e51-2e6e-48d4-ad81-978154089351', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('DashboardGroup', response) def create_widget(self, widget, team_context, dashboard_id): """CreateWidget. [Preview API] Create a widget on the specified dashboard. :param :class:` ` widget: State of the widget to add :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of dashboard the widget will be added to. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') content = self._serialize.body(widget, 'Widget') response = self._send(http_method='POST', location_id='bdcff53a-8355-4172-a00a-40497ea23afc', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('Widget', response) def delete_widget(self, team_context, dashboard_id, widget_id): """DeleteWidget. [Preview API] Delete the specified widget. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of the dashboard containing the widget. :param str widget_id: ID of the widget to update. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') if widget_id is not None: route_values['widgetId'] = self._serialize.url('widget_id', widget_id, 'str') response = self._send(http_method='DELETE', location_id='bdcff53a-8355-4172-a00a-40497ea23afc', version='5.0-preview.2', route_values=route_values) return self._deserialize('Dashboard', response) def get_widget(self, team_context, dashboard_id, widget_id): """GetWidget. [Preview API] Get the current state of the specified widget. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of the dashboard containing the widget. :param str widget_id: ID of the widget to read. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') if widget_id is not None: route_values['widgetId'] = self._serialize.url('widget_id', widget_id, 'str') response = self._send(http_method='GET', location_id='bdcff53a-8355-4172-a00a-40497ea23afc', version='5.0-preview.2', route_values=route_values) return self._deserialize('Widget', response) def get_widgets(self, team_context, dashboard_id, eTag=None): """GetWidgets. [Preview API] Get widgets contained on the specified dashboard. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of the dashboard to read. :param String eTag: Dashboard Widgets Version :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') additional_headers = {} if eTag is not None: additional_headers['ETag'] = eTag response = self._send(http_method='GET', location_id='bdcff53a-8355-4172-a00a-40497ea23afc', version='5.0-preview.2', route_values=route_values, additional_headers=additional_headers) response_object = models.WidgetsVersionedList() response_object.widgets = self._deserialize('[Widget]', self._unwrap_collection(response)) response_object.eTag = response.headers.get('ETag') return response_object def replace_widget(self, widget, team_context, dashboard_id, widget_id): """ReplaceWidget. [Preview API] Override the state of the specified widget. :param :class:` ` widget: State to be written for the widget. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of the dashboard containing the widget. :param str widget_id: ID of the widget to update. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') if widget_id is not None: route_values['widgetId'] = self._serialize.url('widget_id', widget_id, 'str') content = self._serialize.body(widget, 'Widget') response = self._send(http_method='PUT', location_id='bdcff53a-8355-4172-a00a-40497ea23afc', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('Widget', response) def replace_widgets(self, widgets, team_context, dashboard_id, eTag=None): """ReplaceWidgets. [Preview API] Replace the widgets on specified dashboard with the supplied widgets. :param [Widget] widgets: Revised state of widgets to store for the dashboard. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of the Dashboard to modify. :param String eTag: Dashboard Widgets Version :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') additional_headers = {} if eTag is not None: additional_headers['ETag'] = eTag content = self._serialize.body(widgets, '[Widget]') response = self._send(http_method='PUT', location_id='bdcff53a-8355-4172-a00a-40497ea23afc', version='5.0-preview.2', route_values=route_values, additional_headers=additional_headers, content=content) response_object = models.WidgetsVersionedList() response_object.widgets = self._deserialize('[Widget]', self._unwrap_collection(response)) response_object.eTag = response.headers.get('ETag') return response_object def update_widget(self, widget, team_context, dashboard_id, widget_id): """UpdateWidget. [Preview API] Perform a partial update of the specified widget. :param :class:` ` widget: Description of the widget changes to apply. All non-null fields will be replaced. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of the dashboard containing the widget. :param str widget_id: ID of the widget to update. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') if widget_id is not None: route_values['widgetId'] = self._serialize.url('widget_id', widget_id, 'str') content = self._serialize.body(widget, 'Widget') response = self._send(http_method='PATCH', location_id='bdcff53a-8355-4172-a00a-40497ea23afc', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('Widget', response) def update_widgets(self, widgets, team_context, dashboard_id, eTag=None): """UpdateWidgets. [Preview API] Update the supplied widgets on the dashboard using supplied state. State of existing Widgets not passed in the widget list is preserved. :param [Widget] widgets: The set of widget states to update on the dashboard. :param :class:` ` team_context: The team context for the operation :param str dashboard_id: ID of the Dashboard to modify. :param String eTag: Dashboard Widgets Version :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if dashboard_id is not None: route_values['dashboardId'] = self._serialize.url('dashboard_id', dashboard_id, 'str') additional_headers = {} if eTag is not None: additional_headers['ETag'] = eTag content = self._serialize.body(widgets, '[Widget]') response = self._send(http_method='PATCH', location_id='bdcff53a-8355-4172-a00a-40497ea23afc', version='5.0-preview.2', route_values=route_values, additional_headers=additional_headers, content=content) response_object = models.WidgetsVersionedList() response_object.widgets = self._deserialize('[Widget]', self._unwrap_collection(response)) response_object.eTag = response.headers.get('ETag') return response_object def get_widget_metadata(self, contribution_id, project=None): """GetWidgetMetadata. [Preview API] Get the widget metadata satisfying the specified contribution ID. :param str contribution_id: The ID of Contribution for the Widget :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if contribution_id is not None: route_values['contributionId'] = self._serialize.url('contribution_id', contribution_id, 'str') response = self._send(http_method='GET', location_id='6b3628d3-e96f-4fc7-b176-50240b03b515', version='5.0-preview.1', route_values=route_values) return self._deserialize('WidgetMetadataResponse', response) def get_widget_types(self, scope, project=None): """GetWidgetTypes. [Preview API] Get all available widget metadata in alphabetical order. :param str scope: :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if scope is not None: query_parameters['$scope'] = self._serialize.query('scope', scope, 'str') response = self._send(http_method='GET', location_id='6b3628d3-e96f-4fc7-b176-50240b03b515', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WidgetTypesResponse', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/dashboard/models.py000066400000000000000000001024001360605530400326360ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class Dashboard(Model): """Dashboard. :param _links: :type _links: :class:`ReferenceLinks ` :param description: Description of the dashboard. :type description: str :param eTag: Server defined version tracking value, used for edit collision detection. :type eTag: str :param id: ID of the Dashboard. Provided by service at creation time. :type id: str :param name: Name of the Dashboard. :type name: str :param owner_id: ID of the Owner for a dashboard. For any legacy dashboards, this would be the unique identifier for the team associated with the dashboard. :type owner_id: str :param position: Position of the dashboard, within a dashboard group. If unset at creation time, position is decided by the service. :type position: int :param refresh_interval: Interval for client to automatically refresh the dashboard. Expressed in minutes. :type refresh_interval: int :param url: :type url: str :param widgets: The set of Widgets on the dashboard. :type widgets: list of :class:`Widget ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'eTag': {'key': 'eTag', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'owner_id': {'key': 'ownerId', 'type': 'str'}, 'position': {'key': 'position', 'type': 'int'}, 'refresh_interval': {'key': 'refreshInterval', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'}, 'widgets': {'key': 'widgets', 'type': '[Widget]'} } def __init__(self, _links=None, description=None, eTag=None, id=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): super(Dashboard, self).__init__() self._links = _links self.description = description self.eTag = eTag self.id = id self.name = name self.owner_id = owner_id self.position = position self.refresh_interval = refresh_interval self.url = url self.widgets = widgets class DashboardGroup(Model): """DashboardGroup. :param _links: :type _links: :class:`ReferenceLinks ` :param dashboard_entries: A list of Dashboards held by the Dashboard Group :type dashboard_entries: list of :class:`DashboardGroupEntry ` :param permission: Deprecated: The old permission model describing the level of permissions for the current team. Pre-M125. :type permission: object :param team_dashboard_permission: A permissions bit mask describing the security permissions of the current team for dashboards. When this permission is the value None, use GroupMemberPermission. Permissions are evaluated based on the presence of a value other than None, else the GroupMemberPermission will be saved. :type team_dashboard_permission: object :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'dashboard_entries': {'key': 'dashboardEntries', 'type': '[DashboardGroupEntry]'}, 'permission': {'key': 'permission', 'type': 'object'}, 'team_dashboard_permission': {'key': 'teamDashboardPermission', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, dashboard_entries=None, permission=None, team_dashboard_permission=None, url=None): super(DashboardGroup, self).__init__() self._links = _links self.dashboard_entries = dashboard_entries self.permission = permission self.team_dashboard_permission = team_dashboard_permission self.url = url class DashboardGroupEntry(Dashboard): """DashboardGroupEntry. :param _links: :type _links: :class:`ReferenceLinks ` :param description: Description of the dashboard. :type description: str :param eTag: Server defined version tracking value, used for edit collision detection. :type eTag: str :param id: ID of the Dashboard. Provided by service at creation time. :type id: str :param name: Name of the Dashboard. :type name: str :param owner_id: ID of the Owner for a dashboard. For any legacy dashboards, this would be the unique identifier for the team associated with the dashboard. :type owner_id: str :param position: Position of the dashboard, within a dashboard group. If unset at creation time, position is decided by the service. :type position: int :param refresh_interval: Interval for client to automatically refresh the dashboard. Expressed in minutes. :type refresh_interval: int :param url: :type url: str :param widgets: The set of Widgets on the dashboard. :type widgets: list of :class:`Widget ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'eTag': {'key': 'eTag', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'owner_id': {'key': 'ownerId', 'type': 'str'}, 'position': {'key': 'position', 'type': 'int'}, 'refresh_interval': {'key': 'refreshInterval', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'}, 'widgets': {'key': 'widgets', 'type': '[Widget]'}, } def __init__(self, _links=None, description=None, eTag=None, id=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): super(DashboardGroupEntry, self).__init__(_links=_links, description=description, eTag=eTag, id=id, name=name, owner_id=owner_id, position=position, refresh_interval=refresh_interval, url=url, widgets=widgets) class DashboardGroupEntryResponse(DashboardGroupEntry): """DashboardGroupEntryResponse. :param _links: :type _links: :class:`ReferenceLinks ` :param description: Description of the dashboard. :type description: str :param eTag: Server defined version tracking value, used for edit collision detection. :type eTag: str :param id: ID of the Dashboard. Provided by service at creation time. :type id: str :param name: Name of the Dashboard. :type name: str :param owner_id: ID of the Owner for a dashboard. For any legacy dashboards, this would be the unique identifier for the team associated with the dashboard. :type owner_id: str :param position: Position of the dashboard, within a dashboard group. If unset at creation time, position is decided by the service. :type position: int :param refresh_interval: Interval for client to automatically refresh the dashboard. Expressed in minutes. :type refresh_interval: int :param url: :type url: str :param widgets: The set of Widgets on the dashboard. :type widgets: list of :class:`Widget ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'eTag': {'key': 'eTag', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'owner_id': {'key': 'ownerId', 'type': 'str'}, 'position': {'key': 'position', 'type': 'int'}, 'refresh_interval': {'key': 'refreshInterval', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'}, 'widgets': {'key': 'widgets', 'type': '[Widget]'}, } def __init__(self, _links=None, description=None, eTag=None, id=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): super(DashboardGroupEntryResponse, self).__init__(_links=_links, description=description, eTag=eTag, id=id, name=name, owner_id=owner_id, position=position, refresh_interval=refresh_interval, url=url, widgets=widgets) class DashboardResponse(DashboardGroupEntry): """DashboardResponse. :param _links: :type _links: :class:`ReferenceLinks ` :param description: Description of the dashboard. :type description: str :param eTag: Server defined version tracking value, used for edit collision detection. :type eTag: str :param id: ID of the Dashboard. Provided by service at creation time. :type id: str :param name: Name of the Dashboard. :type name: str :param owner_id: ID of the Owner for a dashboard. For any legacy dashboards, this would be the unique identifier for the team associated with the dashboard. :type owner_id: str :param position: Position of the dashboard, within a dashboard group. If unset at creation time, position is decided by the service. :type position: int :param refresh_interval: Interval for client to automatically refresh the dashboard. Expressed in minutes. :type refresh_interval: int :param url: :type url: str :param widgets: The set of Widgets on the dashboard. :type widgets: list of :class:`Widget ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'eTag': {'key': 'eTag', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'owner_id': {'key': 'ownerId', 'type': 'str'}, 'position': {'key': 'position', 'type': 'int'}, 'refresh_interval': {'key': 'refreshInterval', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'}, 'widgets': {'key': 'widgets', 'type': '[Widget]'}, } def __init__(self, _links=None, description=None, eTag=None, id=None, name=None, owner_id=None, position=None, refresh_interval=None, url=None, widgets=None): super(DashboardResponse, self).__init__(_links=_links, description=description, eTag=eTag, id=id, name=name, owner_id=owner_id, position=position, refresh_interval=refresh_interval, url=url, widgets=widgets) class LightboxOptions(Model): """LightboxOptions. :param height: Height of desired lightbox, in pixels :type height: int :param resizable: True to allow lightbox resizing, false to disallow lightbox resizing, defaults to false. :type resizable: bool :param width: Width of desired lightbox, in pixels :type width: int """ _attribute_map = { 'height': {'key': 'height', 'type': 'int'}, 'resizable': {'key': 'resizable', 'type': 'bool'}, 'width': {'key': 'width', 'type': 'int'} } def __init__(self, height=None, resizable=None, width=None): super(LightboxOptions, self).__init__() self.height = height self.resizable = resizable self.width = width class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class SemanticVersion(Model): """SemanticVersion. :param major: Major version when you make incompatible API changes :type major: int :param minor: Minor version when you add functionality in a backwards-compatible manner :type minor: int :param patch: Patch version when you make backwards-compatible bug fixes :type patch: int """ _attribute_map = { 'major': {'key': 'major', 'type': 'int'}, 'minor': {'key': 'minor', 'type': 'int'}, 'patch': {'key': 'patch', 'type': 'int'} } def __init__(self, major=None, minor=None, patch=None): super(SemanticVersion, self).__init__() self.major = major self.minor = minor self.patch = patch class TeamContext(Model): """TeamContext. :param project: The team project Id or name. Ignored if ProjectId is set. :type project: str :param project_id: The Team Project ID. Required if Project is not set. :type project_id: str :param team: The Team Id or name. Ignored if TeamId is set. :type team: str :param team_id: The Team Id :type team_id: str """ _attribute_map = { 'project': {'key': 'project', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'team': {'key': 'team', 'type': 'str'}, 'team_id': {'key': 'teamId', 'type': 'str'} } def __init__(self, project=None, project_id=None, team=None, team_id=None): super(TeamContext, self).__init__() self.project = project self.project_id = project_id self.team = team self.team_id = team_id class Widget(Model): """Widget. :param _links: :type _links: :class:`ReferenceLinks ` :param allowed_sizes: Refers to the allowed sizes for the widget. This gets populated when user wants to configure the widget :type allowed_sizes: list of :class:`WidgetSize ` :param are_settings_blocked_for_user: Read-Only Property from Dashboard Service. Indicates if settings are blocked for the current user. :type are_settings_blocked_for_user: bool :param artifact_id: Refers to unique identifier of a feature artifact. Used for pinning+unpinning a specific artifact. :type artifact_id: str :param configuration_contribution_id: :type configuration_contribution_id: str :param configuration_contribution_relative_id: :type configuration_contribution_relative_id: str :param content_uri: :type content_uri: str :param contribution_id: The id of the underlying contribution defining the supplied Widget Configuration. :type contribution_id: str :param dashboard: Optional partial dashboard content, to support exchanging dashboard-level version ETag for widget-level APIs :type dashboard: :class:`Dashboard ` :param eTag: :type eTag: str :param id: :type id: str :param is_enabled: :type is_enabled: bool :param is_name_configurable: :type is_name_configurable: bool :param lightbox_options: :type lightbox_options: :class:`LightboxOptions ` :param loading_image_url: :type loading_image_url: str :param name: :type name: str :param position: :type position: :class:`WidgetPosition ` :param settings: :type settings: str :param settings_version: :type settings_version: :class:`SemanticVersion ` :param size: :type size: :class:`WidgetSize ` :param type_id: :type type_id: str :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'allowed_sizes': {'key': 'allowedSizes', 'type': '[WidgetSize]'}, 'are_settings_blocked_for_user': {'key': 'areSettingsBlockedForUser', 'type': 'bool'}, 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'configuration_contribution_id': {'key': 'configurationContributionId', 'type': 'str'}, 'configuration_contribution_relative_id': {'key': 'configurationContributionRelativeId', 'type': 'str'}, 'content_uri': {'key': 'contentUri', 'type': 'str'}, 'contribution_id': {'key': 'contributionId', 'type': 'str'}, 'dashboard': {'key': 'dashboard', 'type': 'Dashboard'}, 'eTag': {'key': 'eTag', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'is_name_configurable': {'key': 'isNameConfigurable', 'type': 'bool'}, 'lightbox_options': {'key': 'lightboxOptions', 'type': 'LightboxOptions'}, 'loading_image_url': {'key': 'loadingImageUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'position': {'key': 'position', 'type': 'WidgetPosition'}, 'settings': {'key': 'settings', 'type': 'str'}, 'settings_version': {'key': 'settingsVersion', 'type': 'SemanticVersion'}, 'size': {'key': 'size', 'type': 'WidgetSize'}, 'type_id': {'key': 'typeId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, allowed_sizes=None, are_settings_blocked_for_user=None, artifact_id=None, configuration_contribution_id=None, configuration_contribution_relative_id=None, content_uri=None, contribution_id=None, dashboard=None, eTag=None, id=None, is_enabled=None, is_name_configurable=None, lightbox_options=None, loading_image_url=None, name=None, position=None, settings=None, settings_version=None, size=None, type_id=None, url=None): super(Widget, self).__init__() self._links = _links self.allowed_sizes = allowed_sizes self.are_settings_blocked_for_user = are_settings_blocked_for_user self.artifact_id = artifact_id self.configuration_contribution_id = configuration_contribution_id self.configuration_contribution_relative_id = configuration_contribution_relative_id self.content_uri = content_uri self.contribution_id = contribution_id self.dashboard = dashboard self.eTag = eTag self.id = id self.is_enabled = is_enabled self.is_name_configurable = is_name_configurable self.lightbox_options = lightbox_options self.loading_image_url = loading_image_url self.name = name self.position = position self.settings = settings self.settings_version = settings_version self.size = size self.type_id = type_id self.url = url class WidgetMetadata(Model): """WidgetMetadata. :param allowed_sizes: Sizes supported by the Widget. :type allowed_sizes: list of :class:`WidgetSize ` :param analytics_service_required: Opt-in boolean that indicates if the widget requires the Analytics Service to function. Widgets requiring the analytics service are hidden from the catalog if the Analytics Service is not available. :type analytics_service_required: bool :param catalog_icon_url: Resource for an icon in the widget catalog. :type catalog_icon_url: str :param catalog_info_url: Opt-in URL string pointing at widget information. Defaults to extension marketplace URL if omitted :type catalog_info_url: str :param configuration_contribution_id: The id of the underlying contribution defining the supplied Widget custom configuration UI. Null if custom configuration UI is not available. :type configuration_contribution_id: str :param configuration_contribution_relative_id: The relative id of the underlying contribution defining the supplied Widget custom configuration UI. Null if custom configuration UI is not available. :type configuration_contribution_relative_id: str :param configuration_required: Indicates if the widget requires configuration before being added to dashboard. :type configuration_required: bool :param content_uri: Uri for the widget content to be loaded from . :type content_uri: str :param contribution_id: The id of the underlying contribution defining the supplied Widget. :type contribution_id: str :param default_settings: Optional default settings to be copied into widget settings. :type default_settings: str :param description: Summary information describing the widget. :type description: str :param is_enabled: Widgets can be disabled by the app store. We'll need to gracefully handle for: - persistence (Allow) - Requests (Tag as disabled, and provide context) :type is_enabled: bool :param is_name_configurable: Opt-out boolean that indicates if the widget supports widget name/title configuration. Widgets ignoring the name should set it to false in the manifest. :type is_name_configurable: bool :param is_visible_from_catalog: Opt-out boolean indicating if the widget is hidden from the catalog. Commonly, this is used to allow developers to disable creation of a deprecated widget. A widget must have a functional default state, or have a configuration experience, in order to be visible from the catalog. :type is_visible_from_catalog: bool :param lightbox_options: Opt-in properties for customizing widget presentation in a "lightbox" dialog. :type lightbox_options: :class:`LightboxOptions ` :param loading_image_url: Resource for a loading placeholder image on dashboard :type loading_image_url: str :param name: User facing name of the widget type. Each widget must use a unique value here. :type name: str :param publisher_name: Publisher Name of this kind of widget. :type publisher_name: str :param supported_scopes: Data contract required for the widget to function and to work in its container. :type supported_scopes: list of WidgetScope :param targets: Contribution target IDs :type targets: list of str :param type_id: Deprecated: locally unique developer-facing id of this kind of widget. ContributionId provides a globally unique identifier for widget types. :type type_id: str """ _attribute_map = { 'allowed_sizes': {'key': 'allowedSizes', 'type': '[WidgetSize]'}, 'analytics_service_required': {'key': 'analyticsServiceRequired', 'type': 'bool'}, 'catalog_icon_url': {'key': 'catalogIconUrl', 'type': 'str'}, 'catalog_info_url': {'key': 'catalogInfoUrl', 'type': 'str'}, 'configuration_contribution_id': {'key': 'configurationContributionId', 'type': 'str'}, 'configuration_contribution_relative_id': {'key': 'configurationContributionRelativeId', 'type': 'str'}, 'configuration_required': {'key': 'configurationRequired', 'type': 'bool'}, 'content_uri': {'key': 'contentUri', 'type': 'str'}, 'contribution_id': {'key': 'contributionId', 'type': 'str'}, 'default_settings': {'key': 'defaultSettings', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'is_name_configurable': {'key': 'isNameConfigurable', 'type': 'bool'}, 'is_visible_from_catalog': {'key': 'isVisibleFromCatalog', 'type': 'bool'}, 'lightbox_options': {'key': 'lightboxOptions', 'type': 'LightboxOptions'}, 'loading_image_url': {'key': 'loadingImageUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'supported_scopes': {'key': 'supportedScopes', 'type': '[object]'}, 'targets': {'key': 'targets', 'type': '[str]'}, 'type_id': {'key': 'typeId', 'type': 'str'} } def __init__(self, allowed_sizes=None, analytics_service_required=None, catalog_icon_url=None, catalog_info_url=None, configuration_contribution_id=None, configuration_contribution_relative_id=None, configuration_required=None, content_uri=None, contribution_id=None, default_settings=None, description=None, is_enabled=None, is_name_configurable=None, is_visible_from_catalog=None, lightbox_options=None, loading_image_url=None, name=None, publisher_name=None, supported_scopes=None, targets=None, type_id=None): super(WidgetMetadata, self).__init__() self.allowed_sizes = allowed_sizes self.analytics_service_required = analytics_service_required self.catalog_icon_url = catalog_icon_url self.catalog_info_url = catalog_info_url self.configuration_contribution_id = configuration_contribution_id self.configuration_contribution_relative_id = configuration_contribution_relative_id self.configuration_required = configuration_required self.content_uri = content_uri self.contribution_id = contribution_id self.default_settings = default_settings self.description = description self.is_enabled = is_enabled self.is_name_configurable = is_name_configurable self.is_visible_from_catalog = is_visible_from_catalog self.lightbox_options = lightbox_options self.loading_image_url = loading_image_url self.name = name self.publisher_name = publisher_name self.supported_scopes = supported_scopes self.targets = targets self.type_id = type_id class WidgetMetadataResponse(Model): """WidgetMetadataResponse. :param uri: :type uri: str :param widget_metadata: :type widget_metadata: :class:`WidgetMetadata ` """ _attribute_map = { 'uri': {'key': 'uri', 'type': 'str'}, 'widget_metadata': {'key': 'widgetMetadata', 'type': 'WidgetMetadata'} } def __init__(self, uri=None, widget_metadata=None): super(WidgetMetadataResponse, self).__init__() self.uri = uri self.widget_metadata = widget_metadata class WidgetPosition(Model): """WidgetPosition. :param column: :type column: int :param row: :type row: int """ _attribute_map = { 'column': {'key': 'column', 'type': 'int'}, 'row': {'key': 'row', 'type': 'int'} } def __init__(self, column=None, row=None): super(WidgetPosition, self).__init__() self.column = column self.row = row class WidgetResponse(Widget): """WidgetResponse. :param _links: :type _links: :class:`ReferenceLinks ` :param allowed_sizes: Refers to the allowed sizes for the widget. This gets populated when user wants to configure the widget :type allowed_sizes: list of :class:`WidgetSize ` :param are_settings_blocked_for_user: Read-Only Property from Dashboard Service. Indicates if settings are blocked for the current user. :type are_settings_blocked_for_user: bool :param artifact_id: Refers to unique identifier of a feature artifact. Used for pinning+unpinning a specific artifact. :type artifact_id: str :param configuration_contribution_id: :type configuration_contribution_id: str :param configuration_contribution_relative_id: :type configuration_contribution_relative_id: str :param content_uri: :type content_uri: str :param contribution_id: The id of the underlying contribution defining the supplied Widget Configuration. :type contribution_id: str :param dashboard: Optional partial dashboard content, to support exchanging dashboard-level version ETag for widget-level APIs :type dashboard: :class:`Dashboard ` :param eTag: :type eTag: str :param id: :type id: str :param is_enabled: :type is_enabled: bool :param is_name_configurable: :type is_name_configurable: bool :param lightbox_options: :type lightbox_options: :class:`LightboxOptions ` :param loading_image_url: :type loading_image_url: str :param name: :type name: str :param position: :type position: :class:`WidgetPosition ` :param settings: :type settings: str :param settings_version: :type settings_version: :class:`SemanticVersion ` :param size: :type size: :class:`WidgetSize ` :param type_id: :type type_id: str :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'allowed_sizes': {'key': 'allowedSizes', 'type': '[WidgetSize]'}, 'are_settings_blocked_for_user': {'key': 'areSettingsBlockedForUser', 'type': 'bool'}, 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'configuration_contribution_id': {'key': 'configurationContributionId', 'type': 'str'}, 'configuration_contribution_relative_id': {'key': 'configurationContributionRelativeId', 'type': 'str'}, 'content_uri': {'key': 'contentUri', 'type': 'str'}, 'contribution_id': {'key': 'contributionId', 'type': 'str'}, 'dashboard': {'key': 'dashboard', 'type': 'Dashboard'}, 'eTag': {'key': 'eTag', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'is_name_configurable': {'key': 'isNameConfigurable', 'type': 'bool'}, 'lightbox_options': {'key': 'lightboxOptions', 'type': 'LightboxOptions'}, 'loading_image_url': {'key': 'loadingImageUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'position': {'key': 'position', 'type': 'WidgetPosition'}, 'settings': {'key': 'settings', 'type': 'str'}, 'settings_version': {'key': 'settingsVersion', 'type': 'SemanticVersion'}, 'size': {'key': 'size', 'type': 'WidgetSize'}, 'type_id': {'key': 'typeId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, } def __init__(self, _links=None, allowed_sizes=None, are_settings_blocked_for_user=None, artifact_id=None, configuration_contribution_id=None, configuration_contribution_relative_id=None, content_uri=None, contribution_id=None, dashboard=None, eTag=None, id=None, is_enabled=None, is_name_configurable=None, lightbox_options=None, loading_image_url=None, name=None, position=None, settings=None, settings_version=None, size=None, type_id=None, url=None): super(WidgetResponse, self).__init__(_links=_links, allowed_sizes=allowed_sizes, are_settings_blocked_for_user=are_settings_blocked_for_user, artifact_id=artifact_id, configuration_contribution_id=configuration_contribution_id, configuration_contribution_relative_id=configuration_contribution_relative_id, content_uri=content_uri, contribution_id=contribution_id, dashboard=dashboard, eTag=eTag, id=id, is_enabled=is_enabled, is_name_configurable=is_name_configurable, lightbox_options=lightbox_options, loading_image_url=loading_image_url, name=name, position=position, settings=settings, settings_version=settings_version, size=size, type_id=type_id, url=url) class WidgetSize(Model): """WidgetSize. :param column_span: The Width of the widget, expressed in dashboard grid columns. :type column_span: int :param row_span: The height of the widget, expressed in dashboard grid rows. :type row_span: int """ _attribute_map = { 'column_span': {'key': 'columnSpan', 'type': 'int'}, 'row_span': {'key': 'rowSpan', 'type': 'int'} } def __init__(self, column_span=None, row_span=None): super(WidgetSize, self).__init__() self.column_span = column_span self.row_span = row_span class WidgetsVersionedList(Model): """WidgetsVersionedList. :param eTag: :type eTag: list of str :param widgets: :type widgets: list of :class:`Widget ` """ _attribute_map = { 'eTag': {'key': 'eTag', 'type': '[str]'}, 'widgets': {'key': 'widgets', 'type': '[Widget]'} } def __init__(self, eTag=None, widgets=None): super(WidgetsVersionedList, self).__init__() self.eTag = eTag self.widgets = widgets class WidgetTypesResponse(Model): """WidgetTypesResponse. :param _links: :type _links: :class:`ReferenceLinks ` :param uri: :type uri: str :param widget_types: :type widget_types: list of :class:`WidgetMetadata ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'uri': {'key': 'uri', 'type': 'str'}, 'widget_types': {'key': 'widgetTypes', 'type': '[WidgetMetadata]'} } def __init__(self, _links=None, uri=None, widget_types=None): super(WidgetTypesResponse, self).__init__() self._links = _links self.uri = uri self.widget_types = widget_types __all__ = [ 'Dashboard', 'DashboardGroup', 'DashboardGroupEntry', 'DashboardGroupEntryResponse', 'DashboardResponse', 'LightboxOptions', 'ReferenceLinks', 'SemanticVersion', 'TeamContext', 'Widget', 'WidgetMetadata', 'WidgetMetadataResponse', 'WidgetPosition', 'WidgetResponse', 'WidgetSize', 'WidgetsVersionedList', 'WidgetTypesResponse', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/extension_management/000077500000000000000000000000001360605530400332655ustar00rootroot00000000000000__init__.py000066400000000000000000000033041360605530400353170ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/extension_management# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .extension_management_client import ExtensionManagementClient __all__ = [ 'AcquisitionOperation', 'AcquisitionOperationDisallowReason', 'AcquisitionOptions', 'Contribution', 'ContributionBase', 'ContributionConstraint', 'ContributionPropertyDescription', 'ContributionType', 'ExtensionAcquisitionRequest', 'ExtensionAuthorization', 'ExtensionBadge', 'ExtensionDataCollection', 'ExtensionDataCollectionQuery', 'ExtensionEventCallback', 'ExtensionEventCallbackCollection', 'ExtensionFile', 'ExtensionIdentifier', 'ExtensionLicensing', 'ExtensionManifest', 'ExtensionPolicy', 'ExtensionRequest', 'ExtensionShare', 'ExtensionState', 'ExtensionStatistic', 'ExtensionVersion', 'GraphSubjectBase', 'IdentityRef', 'InstallationTarget', 'InstalledExtension', 'InstalledExtensionQuery', 'InstalledExtensionState', 'InstalledExtensionStateIssue', 'LicensingOverride', 'PublishedExtension', 'PublisherFacts', 'ReferenceLinks', 'RequestedExtension', 'UserExtensionPolicy', 'ExtensionManagementClient' ] extension_management_client.py000066400000000000000000000172001360605530400413260ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/extension_management# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class ExtensionManagementClient(Client): """ExtensionManagement :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ExtensionManagementClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '6c2b0933-3600-42ae-bf8b-93d4f7e83594' def get_installed_extensions(self, include_disabled_extensions=None, include_errors=None, asset_types=None, include_installation_issues=None): """GetInstalledExtensions. [Preview API] List the installed extensions in the account / project collection. :param bool include_disabled_extensions: If true (the default), include disabled extensions in the results. :param bool include_errors: If true, include installed extensions with errors. :param [str] asset_types: :param bool include_installation_issues: :rtype: [InstalledExtension] """ query_parameters = {} if include_disabled_extensions is not None: query_parameters['includeDisabledExtensions'] = self._serialize.query('include_disabled_extensions', include_disabled_extensions, 'bool') if include_errors is not None: query_parameters['includeErrors'] = self._serialize.query('include_errors', include_errors, 'bool') if asset_types is not None: asset_types = ":".join(asset_types) query_parameters['assetTypes'] = self._serialize.query('asset_types', asset_types, 'str') if include_installation_issues is not None: query_parameters['includeInstallationIssues'] = self._serialize.query('include_installation_issues', include_installation_issues, 'bool') response = self._send(http_method='GET', location_id='275424d0-c844-4fe2-bda6-04933a1357d8', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[InstalledExtension]', self._unwrap_collection(response)) def update_installed_extension(self, extension): """UpdateInstalledExtension. [Preview API] Update an installed extension. Typically this API is used to enable or disable an extension. :param :class:` ` extension: :rtype: :class:` ` """ content = self._serialize.body(extension, 'InstalledExtension') response = self._send(http_method='PATCH', location_id='275424d0-c844-4fe2-bda6-04933a1357d8', version='5.0-preview.1', content=content) return self._deserialize('InstalledExtension', response) def get_installed_extension_by_name(self, publisher_name, extension_name, asset_types=None): """GetInstalledExtensionByName. [Preview API] Get an installed extension by its publisher and extension name. :param str publisher_name: Name of the publisher. Example: "fabrikam". :param str extension_name: Name of the extension. Example: "ops-tools". :param [str] asset_types: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if asset_types is not None: asset_types = ":".join(asset_types) query_parameters['assetTypes'] = self._serialize.query('asset_types', asset_types, 'str') response = self._send(http_method='GET', location_id='fb0da285-f23e-4b56-8b53-3ef5f9f6de66', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('InstalledExtension', response) def install_extension_by_name(self, publisher_name, extension_name, version=None): """InstallExtensionByName. [Preview API] Install the specified extension into the account / project collection. :param str publisher_name: Name of the publisher. Example: "fabrikam". :param str extension_name: Name of the extension. Example: "ops-tools". :param str version: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') response = self._send(http_method='POST', location_id='fb0da285-f23e-4b56-8b53-3ef5f9f6de66', version='5.0-preview.1', route_values=route_values) return self._deserialize('InstalledExtension', response) def uninstall_extension_by_name(self, publisher_name, extension_name, reason=None, reason_code=None): """UninstallExtensionByName. [Preview API] Uninstall the specified extension from the account / project collection. :param str publisher_name: Name of the publisher. Example: "fabrikam". :param str extension_name: Name of the extension. Example: "ops-tools". :param str reason: :param str reason_code: """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if reason is not None: query_parameters['reason'] = self._serialize.query('reason', reason, 'str') if reason_code is not None: query_parameters['reasonCode'] = self._serialize.query('reason_code', reason_code, 'str') self._send(http_method='DELETE', location_id='fb0da285-f23e-4b56-8b53-3ef5f9f6de66', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) models.py000066400000000000000000001570461360605530400350600ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/extension_management# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AcquisitionOperation(Model): """AcquisitionOperation. :param operation_state: State of the the AcquisitionOperation for the current user :type operation_state: object :param operation_type: AcquisitionOperationType: install, request, buy, etc... :type operation_type: object :param reason: Optional reason to justify current state. Typically used with Disallow state. :type reason: str :param reasons: List of reasons indicating why the operation is not allowed. :type reasons: list of :class:`AcquisitionOperationDisallowReason ` """ _attribute_map = { 'operation_state': {'key': 'operationState', 'type': 'object'}, 'operation_type': {'key': 'operationType', 'type': 'object'}, 'reason': {'key': 'reason', 'type': 'str'}, 'reasons': {'key': 'reasons', 'type': '[AcquisitionOperationDisallowReason]'} } def __init__(self, operation_state=None, operation_type=None, reason=None, reasons=None): super(AcquisitionOperation, self).__init__() self.operation_state = operation_state self.operation_type = operation_type self.reason = reason self.reasons = reasons class AcquisitionOperationDisallowReason(Model): """AcquisitionOperationDisallowReason. :param message: User-friendly message clarifying the reason for disallowance :type message: str :param type: Type of reason for disallowance - AlreadyInstalled, UnresolvedDemand, etc. :type type: str """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, message=None, type=None): super(AcquisitionOperationDisallowReason, self).__init__() self.message = message self.type = type class AcquisitionOptions(Model): """AcquisitionOptions. :param default_operation: Default Operation for the ItemId in this target :type default_operation: :class:`AcquisitionOperation ` :param item_id: The item id that this options refer to :type item_id: str :param operations: Operations allowed for the ItemId in this target :type operations: list of :class:`AcquisitionOperation ` :param properties: Additional properties which can be added to the request. :type properties: :class:`object ` :param target: The target that this options refer to :type target: str """ _attribute_map = { 'default_operation': {'key': 'defaultOperation', 'type': 'AcquisitionOperation'}, 'item_id': {'key': 'itemId', 'type': 'str'}, 'operations': {'key': 'operations', 'type': '[AcquisitionOperation]'}, 'properties': {'key': 'properties', 'type': 'object'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, default_operation=None, item_id=None, operations=None, properties=None, target=None): super(AcquisitionOptions, self).__init__() self.default_operation = default_operation self.item_id = item_id self.operations = operations self.properties = properties self.target = target class ContributionBase(Model): """ContributionBase. :param description: Description of the contribution/type :type description: str :param id: Fully qualified identifier of the contribution/type :type id: str :param visible_to: VisibleTo can be used to restrict whom can reference a given contribution/type. This value should be a list of publishers or extensions access is restricted too. Examples: "ms" - Means only the "ms" publisher can reference this. "ms.vss-web" - Means only the "vss-web" extension from the "ms" publisher can reference this. :type visible_to: list of str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'visible_to': {'key': 'visibleTo', 'type': '[str]'} } def __init__(self, description=None, id=None, visible_to=None): super(ContributionBase, self).__init__() self.description = description self.id = id self.visible_to = visible_to class ContributionConstraint(Model): """ContributionConstraint. :param group: An optional property that can be specified to group constraints together. All constraints within a group are AND'd together (all must be evaluate to True in order for the contribution to be included). Different groups of constraints are OR'd (only one group needs to evaluate to True for the contribution to be included). :type group: int :param id: Fully qualified identifier of a shared constraint :type id: str :param inverse: If true, negate the result of the filter (include the contribution if the applied filter returns false instead of true) :type inverse: bool :param name: Name of the IContributionFilter plugin :type name: str :param properties: Properties that are fed to the contribution filter class :type properties: :class:`object ` :param relationships: Constraints can be optionally be applied to one or more of the relationships defined in the contribution. If no relationships are defined then all relationships are associated with the constraint. This means the default behaviour will elimiate the contribution from the tree completely if the constraint is applied. :type relationships: list of str """ _attribute_map = { 'group': {'key': 'group', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'inverse': {'key': 'inverse', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'relationships': {'key': 'relationships', 'type': '[str]'} } def __init__(self, group=None, id=None, inverse=None, name=None, properties=None, relationships=None): super(ContributionConstraint, self).__init__() self.group = group self.id = id self.inverse = inverse self.name = name self.properties = properties self.relationships = relationships class ContributionPropertyDescription(Model): """ContributionPropertyDescription. :param description: Description of the property :type description: str :param name: Name of the property :type name: str :param required: True if this property is required :type required: bool :param type: The type of value used for this property :type type: object """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, description=None, name=None, required=None, type=None): super(ContributionPropertyDescription, self).__init__() self.description = description self.name = name self.required = required self.type = type class ContributionType(ContributionBase): """ContributionType. :param description: Description of the contribution/type :type description: str :param id: Fully qualified identifier of the contribution/type :type id: str :param visible_to: VisibleTo can be used to restrict whom can reference a given contribution/type. This value should be a list of publishers or extensions access is restricted too. Examples: "ms" - Means only the "ms" publisher can reference this. "ms.vss-web" - Means only the "vss-web" extension from the "ms" publisher can reference this. :type visible_to: list of str :param indexed: Controls whether or not contributions of this type have the type indexed for queries. This allows clients to find all extensions that have a contribution of this type. NOTE: Only TrustedPartners are allowed to specify indexed contribution types. :type indexed: bool :param name: Friendly name of the contribution/type :type name: str :param properties: Describes the allowed properties for this contribution type :type properties: dict """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'visible_to': {'key': 'visibleTo', 'type': '[str]'}, 'indexed': {'key': 'indexed', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{ContributionPropertyDescription}'} } def __init__(self, description=None, id=None, visible_to=None, indexed=None, name=None, properties=None): super(ContributionType, self).__init__(description=description, id=id, visible_to=visible_to) self.indexed = indexed self.name = name self.properties = properties class ExtensionAcquisitionRequest(Model): """ExtensionAcquisitionRequest. :param assignment_type: How the item is being assigned :type assignment_type: object :param billing_id: The id of the subscription used for purchase :type billing_id: str :param item_id: The marketplace id (publisherName.extensionName) for the item :type item_id: str :param operation_type: The type of operation, such as install, request, purchase :type operation_type: object :param properties: Additional properties which can be added to the request. :type properties: :class:`object ` :param quantity: How many licenses should be purchased :type quantity: int """ _attribute_map = { 'assignment_type': {'key': 'assignmentType', 'type': 'object'}, 'billing_id': {'key': 'billingId', 'type': 'str'}, 'item_id': {'key': 'itemId', 'type': 'str'}, 'operation_type': {'key': 'operationType', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'object'}, 'quantity': {'key': 'quantity', 'type': 'int'} } def __init__(self, assignment_type=None, billing_id=None, item_id=None, operation_type=None, properties=None, quantity=None): super(ExtensionAcquisitionRequest, self).__init__() self.assignment_type = assignment_type self.billing_id = billing_id self.item_id = item_id self.operation_type = operation_type self.properties = properties self.quantity = quantity class ExtensionAuthorization(Model): """ExtensionAuthorization. :param id: :type id: str :param scopes: :type scopes: list of str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'scopes': {'key': 'scopes', 'type': '[str]'} } def __init__(self, id=None, scopes=None): super(ExtensionAuthorization, self).__init__() self.id = id self.scopes = scopes class ExtensionBadge(Model): """ExtensionBadge. :param description: :type description: str :param img_uri: :type img_uri: str :param link: :type link: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'img_uri': {'key': 'imgUri', 'type': 'str'}, 'link': {'key': 'link', 'type': 'str'} } def __init__(self, description=None, img_uri=None, link=None): super(ExtensionBadge, self).__init__() self.description = description self.img_uri = img_uri self.link = link class ExtensionDataCollection(Model): """ExtensionDataCollection. :param collection_name: The name of the collection :type collection_name: str :param documents: A list of documents belonging to the collection :type documents: list of :class:`object ` :param scope_type: The type of the collection's scope, such as Default or User :type scope_type: str :param scope_value: The value of the collection's scope, such as Current or Me :type scope_value: str """ _attribute_map = { 'collection_name': {'key': 'collectionName', 'type': 'str'}, 'documents': {'key': 'documents', 'type': '[object]'}, 'scope_type': {'key': 'scopeType', 'type': 'str'}, 'scope_value': {'key': 'scopeValue', 'type': 'str'} } def __init__(self, collection_name=None, documents=None, scope_type=None, scope_value=None): super(ExtensionDataCollection, self).__init__() self.collection_name = collection_name self.documents = documents self.scope_type = scope_type self.scope_value = scope_value class ExtensionDataCollectionQuery(Model): """ExtensionDataCollectionQuery. :param collections: A list of collections to query :type collections: list of :class:`ExtensionDataCollection ` """ _attribute_map = { 'collections': {'key': 'collections', 'type': '[ExtensionDataCollection]'} } def __init__(self, collections=None): super(ExtensionDataCollectionQuery, self).__init__() self.collections = collections class ExtensionEventCallback(Model): """ExtensionEventCallback. :param uri: The uri of the endpoint that is hit when an event occurs :type uri: str """ _attribute_map = { 'uri': {'key': 'uri', 'type': 'str'} } def __init__(self, uri=None): super(ExtensionEventCallback, self).__init__() self.uri = uri class ExtensionEventCallbackCollection(Model): """ExtensionEventCallbackCollection. :param post_disable: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension disable has occurred. :type post_disable: :class:`ExtensionEventCallback ` :param post_enable: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension enable has occurred. :type post_enable: :class:`ExtensionEventCallback ` :param post_install: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension install has completed. :type post_install: :class:`ExtensionEventCallback ` :param post_uninstall: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension uninstall has occurred. :type post_uninstall: :class:`ExtensionEventCallback ` :param post_update: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension update has occurred. :type post_update: :class:`ExtensionEventCallback ` :param pre_install: Optional. Defines an endpoint that gets called via a POST reqeust to notify that an extension install is about to occur. Response indicates whether to proceed or abort. :type pre_install: :class:`ExtensionEventCallback ` :param version_check: For multi-version extensions, defines an endpoint that gets called via an OPTIONS request to determine the particular version of the extension to be used :type version_check: :class:`ExtensionEventCallback ` """ _attribute_map = { 'post_disable': {'key': 'postDisable', 'type': 'ExtensionEventCallback'}, 'post_enable': {'key': 'postEnable', 'type': 'ExtensionEventCallback'}, 'post_install': {'key': 'postInstall', 'type': 'ExtensionEventCallback'}, 'post_uninstall': {'key': 'postUninstall', 'type': 'ExtensionEventCallback'}, 'post_update': {'key': 'postUpdate', 'type': 'ExtensionEventCallback'}, 'pre_install': {'key': 'preInstall', 'type': 'ExtensionEventCallback'}, 'version_check': {'key': 'versionCheck', 'type': 'ExtensionEventCallback'} } def __init__(self, post_disable=None, post_enable=None, post_install=None, post_uninstall=None, post_update=None, pre_install=None, version_check=None): super(ExtensionEventCallbackCollection, self).__init__() self.post_disable = post_disable self.post_enable = post_enable self.post_install = post_install self.post_uninstall = post_uninstall self.post_update = post_update self.pre_install = pre_install self.version_check = version_check class ExtensionFile(Model): """ExtensionFile. :param asset_type: :type asset_type: str :param language: :type language: str :param source: :type source: str """ _attribute_map = { 'asset_type': {'key': 'assetType', 'type': 'str'}, 'language': {'key': 'language', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'} } def __init__(self, asset_type=None, language=None, source=None): super(ExtensionFile, self).__init__() self.asset_type = asset_type self.language = language self.source = source class ExtensionIdentifier(Model): """ExtensionIdentifier. :param extension_name: The ExtensionName component part of the fully qualified ExtensionIdentifier :type extension_name: str :param publisher_name: The PublisherName component part of the fully qualified ExtensionIdentifier :type publisher_name: str """ _attribute_map = { 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'} } def __init__(self, extension_name=None, publisher_name=None): super(ExtensionIdentifier, self).__init__() self.extension_name = extension_name self.publisher_name = publisher_name class ExtensionLicensing(Model): """ExtensionLicensing. :param overrides: A list of contributions which deviate from the default licensing behavior :type overrides: list of :class:`LicensingOverride ` """ _attribute_map = { 'overrides': {'key': 'overrides', 'type': '[LicensingOverride]'} } def __init__(self, overrides=None): super(ExtensionLicensing, self).__init__() self.overrides = overrides class ExtensionManifest(Model): """ExtensionManifest. :param base_uri: Uri used as base for other relative uri's defined in extension :type base_uri: str :param constraints: List of shared constraints defined by this extension :type constraints: list of :class:`ContributionConstraint ` :param contributions: List of contributions made by this extension :type contributions: list of :class:`Contribution ` :param contribution_types: List of contribution types defined by this extension :type contribution_types: list of :class:`ContributionType ` :param demands: List of explicit demands required by this extension :type demands: list of str :param event_callbacks: Collection of endpoints that get called when particular extension events occur :type event_callbacks: :class:`ExtensionEventCallbackCollection ` :param fallback_base_uri: Secondary location that can be used as base for other relative uri's defined in extension :type fallback_base_uri: str :param language: Language Culture Name set by the Gallery :type language: str :param licensing: How this extension behaves with respect to licensing :type licensing: :class:`ExtensionLicensing ` :param manifest_version: Version of the extension manifest format/content :type manifest_version: float :param restricted_to: Default user claims applied to all contributions (except the ones which have been speficied restrictedTo explicitly) to control the visibility of a contribution. :type restricted_to: list of str :param scopes: List of all oauth scopes required by this extension :type scopes: list of str :param service_instance_type: The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed :type service_instance_type: str """ _attribute_map = { 'base_uri': {'key': 'baseUri', 'type': 'str'}, 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'contributions': {'key': 'contributions', 'type': '[Contribution]'}, 'contribution_types': {'key': 'contributionTypes', 'type': '[ContributionType]'}, 'demands': {'key': 'demands', 'type': '[str]'}, 'event_callbacks': {'key': 'eventCallbacks', 'type': 'ExtensionEventCallbackCollection'}, 'fallback_base_uri': {'key': 'fallbackBaseUri', 'type': 'str'}, 'language': {'key': 'language', 'type': 'str'}, 'licensing': {'key': 'licensing', 'type': 'ExtensionLicensing'}, 'manifest_version': {'key': 'manifestVersion', 'type': 'float'}, 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'scopes': {'key': 'scopes', 'type': '[str]'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'} } def __init__(self, base_uri=None, constraints=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, restricted_to=None, scopes=None, service_instance_type=None): super(ExtensionManifest, self).__init__() self.base_uri = base_uri self.constraints = constraints self.contributions = contributions self.contribution_types = contribution_types self.demands = demands self.event_callbacks = event_callbacks self.fallback_base_uri = fallback_base_uri self.language = language self.licensing = licensing self.manifest_version = manifest_version self.restricted_to = restricted_to self.scopes = scopes self.service_instance_type = service_instance_type class ExtensionPolicy(Model): """ExtensionPolicy. :param install: Permissions on 'Install' operation :type install: object :param request: Permission on 'Request' operation :type request: object """ _attribute_map = { 'install': {'key': 'install', 'type': 'object'}, 'request': {'key': 'request', 'type': 'object'} } def __init__(self, install=None, request=None): super(ExtensionPolicy, self).__init__() self.install = install self.request = request class ExtensionRequest(Model): """ExtensionRequest. :param reject_message: Required message supplied if the request is rejected :type reject_message: str :param request_date: Date at which the request was made :type request_date: datetime :param requested_by: Represents the user who made the request :type requested_by: :class:`IdentityRef ` :param request_message: Optional message supplied by the requester justifying the request :type request_message: str :param request_state: Represents the state of the request :type request_state: object :param resolve_date: Date at which the request was resolved :type resolve_date: datetime :param resolved_by: Represents the user who resolved the request :type resolved_by: :class:`IdentityRef ` """ _attribute_map = { 'reject_message': {'key': 'rejectMessage', 'type': 'str'}, 'request_date': {'key': 'requestDate', 'type': 'iso-8601'}, 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, 'request_message': {'key': 'requestMessage', 'type': 'str'}, 'request_state': {'key': 'requestState', 'type': 'object'}, 'resolve_date': {'key': 'resolveDate', 'type': 'iso-8601'}, 'resolved_by': {'key': 'resolvedBy', 'type': 'IdentityRef'} } def __init__(self, reject_message=None, request_date=None, requested_by=None, request_message=None, request_state=None, resolve_date=None, resolved_by=None): super(ExtensionRequest, self).__init__() self.reject_message = reject_message self.request_date = request_date self.requested_by = requested_by self.request_message = request_message self.request_state = request_state self.resolve_date = resolve_date self.resolved_by = resolved_by class ExtensionShare(Model): """ExtensionShare. :param id: :type id: str :param is_org: :type is_org: bool :param name: :type name: str :param type: :type type: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'is_org': {'key': 'isOrg', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, id=None, is_org=None, name=None, type=None): super(ExtensionShare, self).__init__() self.id = id self.is_org = is_org self.name = name self.type = type class ExtensionStatistic(Model): """ExtensionStatistic. :param statistic_name: :type statistic_name: str :param value: :type value: float """ _attribute_map = { 'statistic_name': {'key': 'statisticName', 'type': 'str'}, 'value': {'key': 'value', 'type': 'float'} } def __init__(self, statistic_name=None, value=None): super(ExtensionStatistic, self).__init__() self.statistic_name = statistic_name self.value = value class ExtensionVersion(Model): """ExtensionVersion. :param asset_uri: :type asset_uri: str :param badges: :type badges: list of :class:`ExtensionBadge ` :param fallback_asset_uri: :type fallback_asset_uri: str :param files: :type files: list of :class:`ExtensionFile ` :param flags: :type flags: object :param last_updated: :type last_updated: datetime :param properties: :type properties: list of { key: str; value: str } :param validation_result_message: :type validation_result_message: str :param version: :type version: str :param version_description: :type version_description: str """ _attribute_map = { 'asset_uri': {'key': 'assetUri', 'type': 'str'}, 'badges': {'key': 'badges', 'type': '[ExtensionBadge]'}, 'fallback_asset_uri': {'key': 'fallbackAssetUri', 'type': 'str'}, 'files': {'key': 'files', 'type': '[ExtensionFile]'}, 'flags': {'key': 'flags', 'type': 'object'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'properties': {'key': 'properties', 'type': '[{ key: str; value: str }]'}, 'validation_result_message': {'key': 'validationResultMessage', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'version_description': {'key': 'versionDescription', 'type': 'str'} } def __init__(self, asset_uri=None, badges=None, fallback_asset_uri=None, files=None, flags=None, last_updated=None, properties=None, validation_result_message=None, version=None, version_description=None): super(ExtensionVersion, self).__init__() self.asset_uri = asset_uri self.badges = badges self.fallback_asset_uri = fallback_asset_uri self.files = files self.flags = flags self.last_updated = last_updated self.properties = properties self.validation_result_message = validation_result_message self.version = version self.version_description = version_description class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class InstallationTarget(Model): """InstallationTarget. :param target: :type target: str :param target_version: :type target_version: str """ _attribute_map = { 'target': {'key': 'target', 'type': 'str'}, 'target_version': {'key': 'targetVersion', 'type': 'str'} } def __init__(self, target=None, target_version=None): super(InstallationTarget, self).__init__() self.target = target self.target_version = target_version class InstalledExtension(ExtensionManifest): """InstalledExtension. :param base_uri: Uri used as base for other relative uri's defined in extension :type base_uri: str :param constraints: List of shared constraints defined by this extension :type constraints: list of :class:`ContributionConstraint ` :param contributions: List of contributions made by this extension :type contributions: list of :class:`Contribution ` :param contribution_types: List of contribution types defined by this extension :type contribution_types: list of :class:`ContributionType ` :param demands: List of explicit demands required by this extension :type demands: list of str :param event_callbacks: Collection of endpoints that get called when particular extension events occur :type event_callbacks: :class:`ExtensionEventCallbackCollection ` :param fallback_base_uri: Secondary location that can be used as base for other relative uri's defined in extension :type fallback_base_uri: str :param language: Language Culture Name set by the Gallery :type language: str :param licensing: How this extension behaves with respect to licensing :type licensing: :class:`ExtensionLicensing ` :param manifest_version: Version of the extension manifest format/content :type manifest_version: float :param restricted_to: Default user claims applied to all contributions (except the ones which have been speficied restrictedTo explicitly) to control the visibility of a contribution. :type restricted_to: list of str :param scopes: List of all oauth scopes required by this extension :type scopes: list of str :param service_instance_type: The ServiceInstanceType(Guid) of the VSTS service that must be available to an account in order for the extension to be installed :type service_instance_type: str :param extension_id: The friendly extension id for this extension - unique for a given publisher. :type extension_id: str :param extension_name: The display name of the extension. :type extension_name: str :param files: This is the set of files available from the extension. :type files: list of :class:`ExtensionFile ` :param flags: Extension flags relevant to contribution consumers :type flags: object :param install_state: Information about this particular installation of the extension :type install_state: :class:`InstalledExtensionState ` :param last_published: This represents the date/time the extensions was last updated in the gallery. This doesnt mean this version was updated the value represents changes to any and all versions of the extension. :type last_published: datetime :param publisher_id: Unique id of the publisher of this extension :type publisher_id: str :param publisher_name: The display name of the publisher :type publisher_name: str :param registration_id: Unique id for this extension (the same id is used for all versions of a single extension) :type registration_id: str :param version: Version of this extension :type version: str """ _attribute_map = { 'base_uri': {'key': 'baseUri', 'type': 'str'}, 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'contributions': {'key': 'contributions', 'type': '[Contribution]'}, 'contribution_types': {'key': 'contributionTypes', 'type': '[ContributionType]'}, 'demands': {'key': 'demands', 'type': '[str]'}, 'event_callbacks': {'key': 'eventCallbacks', 'type': 'ExtensionEventCallbackCollection'}, 'fallback_base_uri': {'key': 'fallbackBaseUri', 'type': 'str'}, 'language': {'key': 'language', 'type': 'str'}, 'licensing': {'key': 'licensing', 'type': 'ExtensionLicensing'}, 'manifest_version': {'key': 'manifestVersion', 'type': 'float'}, 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'scopes': {'key': 'scopes', 'type': '[str]'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'files': {'key': 'files', 'type': '[ExtensionFile]'}, 'flags': {'key': 'flags', 'type': 'object'}, 'install_state': {'key': 'installState', 'type': 'InstalledExtensionState'}, 'last_published': {'key': 'lastPublished', 'type': 'iso-8601'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'registration_id': {'key': 'registrationId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, base_uri=None, constraints=None, contributions=None, contribution_types=None, demands=None, event_callbacks=None, fallback_base_uri=None, language=None, licensing=None, manifest_version=None, restricted_to=None, scopes=None, service_instance_type=None, extension_id=None, extension_name=None, files=None, flags=None, install_state=None, last_published=None, publisher_id=None, publisher_name=None, registration_id=None, version=None): super(InstalledExtension, self).__init__(base_uri=base_uri, constraints=constraints, contributions=contributions, contribution_types=contribution_types, demands=demands, event_callbacks=event_callbacks, fallback_base_uri=fallback_base_uri, language=language, licensing=licensing, manifest_version=manifest_version, restricted_to=restricted_to, scopes=scopes, service_instance_type=service_instance_type) self.extension_id = extension_id self.extension_name = extension_name self.files = files self.flags = flags self.install_state = install_state self.last_published = last_published self.publisher_id = publisher_id self.publisher_name = publisher_name self.registration_id = registration_id self.version = version class InstalledExtensionQuery(Model): """InstalledExtensionQuery. :param asset_types: :type asset_types: list of str :param monikers: :type monikers: list of :class:`ExtensionIdentifier ` """ _attribute_map = { 'asset_types': {'key': 'assetTypes', 'type': '[str]'}, 'monikers': {'key': 'monikers', 'type': '[ExtensionIdentifier]'} } def __init__(self, asset_types=None, monikers=None): super(InstalledExtensionQuery, self).__init__() self.asset_types = asset_types self.monikers = monikers class InstalledExtensionState(Model): """InstalledExtensionState. :param flags: States of an installed extension :type flags: object :param installation_issues: List of installation issues :type installation_issues: list of :class:`InstalledExtensionStateIssue ` :param last_updated: The time at which this installation was last updated :type last_updated: datetime """ _attribute_map = { 'flags': {'key': 'flags', 'type': 'object'}, 'installation_issues': {'key': 'installationIssues', 'type': '[InstalledExtensionStateIssue]'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'} } def __init__(self, flags=None, installation_issues=None, last_updated=None): super(InstalledExtensionState, self).__init__() self.flags = flags self.installation_issues = installation_issues self.last_updated = last_updated class InstalledExtensionStateIssue(Model): """InstalledExtensionStateIssue. :param message: The error message :type message: str :param source: Source of the installation issue, for example "Demands" :type source: str :param type: Installation issue type (Warning, Error) :type type: object """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, message=None, source=None, type=None): super(InstalledExtensionStateIssue, self).__init__() self.message = message self.source = source self.type = type class LicensingOverride(Model): """LicensingOverride. :param behavior: How the inclusion of this contribution should change based on licensing :type behavior: object :param id: Fully qualified contribution id which we want to define licensing behavior for :type id: str """ _attribute_map = { 'behavior': {'key': 'behavior', 'type': 'object'}, 'id': {'key': 'id', 'type': 'str'} } def __init__(self, behavior=None, id=None): super(LicensingOverride, self).__init__() self.behavior = behavior self.id = id class PublishedExtension(Model): """PublishedExtension. :param categories: :type categories: list of str :param deployment_type: :type deployment_type: object :param display_name: :type display_name: str :param extension_id: :type extension_id: str :param extension_name: :type extension_name: str :param flags: :type flags: object :param installation_targets: :type installation_targets: list of :class:`InstallationTarget ` :param last_updated: :type last_updated: datetime :param long_description: :type long_description: str :param published_date: Date on which the extension was first uploaded. :type published_date: datetime :param publisher: :type publisher: :class:`PublisherFacts ` :param release_date: Date on which the extension first went public. :type release_date: datetime :param shared_with: :type shared_with: list of :class:`ExtensionShare ` :param short_description: :type short_description: str :param statistics: :type statistics: list of :class:`ExtensionStatistic ` :param tags: :type tags: list of str :param versions: :type versions: list of :class:`ExtensionVersion ` """ _attribute_map = { 'categories': {'key': 'categories', 'type': '[str]'}, 'deployment_type': {'key': 'deploymentType', 'type': 'object'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'flags': {'key': 'flags', 'type': 'object'}, 'installation_targets': {'key': 'installationTargets', 'type': '[InstallationTarget]'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'long_description': {'key': 'longDescription', 'type': 'str'}, 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, 'publisher': {'key': 'publisher', 'type': 'PublisherFacts'}, 'release_date': {'key': 'releaseDate', 'type': 'iso-8601'}, 'shared_with': {'key': 'sharedWith', 'type': '[ExtensionShare]'}, 'short_description': {'key': 'shortDescription', 'type': 'str'}, 'statistics': {'key': 'statistics', 'type': '[ExtensionStatistic]'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'versions': {'key': 'versions', 'type': '[ExtensionVersion]'} } def __init__(self, categories=None, deployment_type=None, display_name=None, extension_id=None, extension_name=None, flags=None, installation_targets=None, last_updated=None, long_description=None, published_date=None, publisher=None, release_date=None, shared_with=None, short_description=None, statistics=None, tags=None, versions=None): super(PublishedExtension, self).__init__() self.categories = categories self.deployment_type = deployment_type self.display_name = display_name self.extension_id = extension_id self.extension_name = extension_name self.flags = flags self.installation_targets = installation_targets self.last_updated = last_updated self.long_description = long_description self.published_date = published_date self.publisher = publisher self.release_date = release_date self.shared_with = shared_with self.short_description = short_description self.statistics = statistics self.tags = tags self.versions = versions class PublisherFacts(Model): """PublisherFacts. :param display_name: :type display_name: str :param flags: :type flags: object :param publisher_id: :type publisher_id: str :param publisher_name: :type publisher_name: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'flags': {'key': 'flags', 'type': 'object'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'} } def __init__(self, display_name=None, flags=None, publisher_id=None, publisher_name=None): super(PublisherFacts, self).__init__() self.display_name = display_name self.flags = flags self.publisher_id = publisher_id self.publisher_name = publisher_name class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class RequestedExtension(Model): """RequestedExtension. :param extension_name: The unique name of the extension :type extension_name: str :param extension_requests: A list of each request for the extension :type extension_requests: list of :class:`ExtensionRequest ` :param publisher_display_name: DisplayName of the publisher that owns the extension being published. :type publisher_display_name: str :param publisher_name: Represents the Publisher of the requested extension :type publisher_name: str :param request_count: The total number of requests for an extension :type request_count: int """ _attribute_map = { 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'extension_requests': {'key': 'extensionRequests', 'type': '[ExtensionRequest]'}, 'publisher_display_name': {'key': 'publisherDisplayName', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'request_count': {'key': 'requestCount', 'type': 'int'} } def __init__(self, extension_name=None, extension_requests=None, publisher_display_name=None, publisher_name=None, request_count=None): super(RequestedExtension, self).__init__() self.extension_name = extension_name self.extension_requests = extension_requests self.publisher_display_name = publisher_display_name self.publisher_name = publisher_name self.request_count = request_count class UserExtensionPolicy(Model): """UserExtensionPolicy. :param display_name: User display name that this policy refers to :type display_name: str :param permissions: The extension policy applied to the user :type permissions: :class:`ExtensionPolicy ` :param user_id: User id that this policy refers to :type user_id: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'permissions': {'key': 'permissions', 'type': 'ExtensionPolicy'}, 'user_id': {'key': 'userId', 'type': 'str'} } def __init__(self, display_name=None, permissions=None, user_id=None): super(UserExtensionPolicy, self).__init__() self.display_name = display_name self.permissions = permissions self.user_id = user_id class Contribution(ContributionBase): """Contribution. :param description: Description of the contribution/type :type description: str :param id: Fully qualified identifier of the contribution/type :type id: str :param visible_to: VisibleTo can be used to restrict whom can reference a given contribution/type. This value should be a list of publishers or extensions access is restricted too. Examples: "ms" - Means only the "ms" publisher can reference this. "ms.vss-web" - Means only the "vss-web" extension from the "ms" publisher can reference this. :type visible_to: list of str :param constraints: List of constraints (filters) that should be applied to the availability of this contribution :type constraints: list of :class:`ContributionConstraint ` :param includes: Includes is a set of contributions that should have this contribution included in their targets list. :type includes: list of str :param properties: Properties/attributes of this contribution :type properties: :class:`object ` :param restricted_to: List of demanded claims in order for the user to see this contribution (like anonymous, public, member...). :type restricted_to: list of str :param targets: The ids of the contribution(s) that this contribution targets. (parent contributions) :type targets: list of str :param type: Id of the Contribution Type :type type: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'visible_to': {'key': 'visibleTo', 'type': '[str]'}, 'constraints': {'key': 'constraints', 'type': '[ContributionConstraint]'}, 'includes': {'key': 'includes', 'type': '[str]'}, 'properties': {'key': 'properties', 'type': 'object'}, 'restricted_to': {'key': 'restrictedTo', 'type': '[str]'}, 'targets': {'key': 'targets', 'type': '[str]'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, description=None, id=None, visible_to=None, constraints=None, includes=None, properties=None, restricted_to=None, targets=None, type=None): super(Contribution, self).__init__(description=description, id=id, visible_to=visible_to) self.constraints = constraints self.includes = includes self.properties = properties self.restricted_to = restricted_to self.targets = targets self.type = type class ExtensionState(InstalledExtensionState): """ExtensionState. :param flags: States of an installed extension :type flags: object :param installation_issues: List of installation issues :type installation_issues: list of :class:`InstalledExtensionStateIssue ` :param last_updated: The time at which this installation was last updated :type last_updated: datetime :param extension_name: :type extension_name: str :param last_version_check: The time at which the version was last checked :type last_version_check: datetime :param publisher_name: :type publisher_name: str :param version: :type version: str """ _attribute_map = { 'flags': {'key': 'flags', 'type': 'object'}, 'installation_issues': {'key': 'installationIssues', 'type': '[InstalledExtensionStateIssue]'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'last_version_check': {'key': 'lastVersionCheck', 'type': 'iso-8601'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, flags=None, installation_issues=None, last_updated=None, extension_name=None, last_version_check=None, publisher_name=None, version=None): super(ExtensionState, self).__init__(flags=flags, installation_issues=installation_issues, last_updated=last_updated) self.extension_name = extension_name self.last_version_check = last_version_check self.publisher_name = publisher_name self.version = version __all__ = [ 'AcquisitionOperation', 'AcquisitionOperationDisallowReason', 'AcquisitionOptions', 'ContributionBase', 'ContributionConstraint', 'ContributionPropertyDescription', 'ContributionType', 'ExtensionAcquisitionRequest', 'ExtensionAuthorization', 'ExtensionBadge', 'ExtensionDataCollection', 'ExtensionDataCollectionQuery', 'ExtensionEventCallback', 'ExtensionEventCallbackCollection', 'ExtensionFile', 'ExtensionIdentifier', 'ExtensionLicensing', 'ExtensionManifest', 'ExtensionPolicy', 'ExtensionRequest', 'ExtensionShare', 'ExtensionStatistic', 'ExtensionVersion', 'GraphSubjectBase', 'IdentityRef', 'InstallationTarget', 'InstalledExtension', 'InstalledExtensionQuery', 'InstalledExtensionState', 'InstalledExtensionStateIssue', 'LicensingOverride', 'PublishedExtension', 'PublisherFacts', 'ReferenceLinks', 'RequestedExtension', 'UserExtensionPolicy', 'Contribution', 'ExtensionState', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feature_availability/000077500000000000000000000000001360605530400332425ustar00rootroot00000000000000__init__.py000066400000000000000000000013411360605530400352730ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feature_availability# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .feature_availability_client import FeatureAvailabilityClient __all__ = [ 'FeatureFlag', 'FeatureFlagPatch', 'FeatureAvailabilityClient' ] feature_availability_client.py000066400000000000000000000170711360605530400412660ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feature_availability# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class FeatureAvailabilityClient(Client): """FeatureAvailability :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(FeatureAvailabilityClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_all_feature_flags(self, user_email=None): """GetAllFeatureFlags. [Preview API] Retrieve a listing of all feature flags and their current states for a user :param str user_email: The email of the user to check :rtype: [FeatureFlag] """ query_parameters = {} if user_email is not None: query_parameters['userEmail'] = self._serialize.query('user_email', user_email, 'str') response = self._send(http_method='GET', location_id='3e2b80f8-9e6f-441e-8393-005610692d9c', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[FeatureFlag]', self._unwrap_collection(response)) def get_feature_flag_by_name(self, name, check_feature_exists=None): """GetFeatureFlagByName. [Preview API] Retrieve information on a single feature flag and its current states :param str name: The name of the feature to retrieve :param bool check_feature_exists: Check if feature exists :rtype: :class:` ` """ route_values = {} if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') query_parameters = {} if check_feature_exists is not None: query_parameters['checkFeatureExists'] = self._serialize.query('check_feature_exists', check_feature_exists, 'bool') response = self._send(http_method='GET', location_id='3e2b80f8-9e6f-441e-8393-005610692d9c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('FeatureFlag', response) def get_feature_flag_by_name_and_user_email(self, name, user_email, check_feature_exists=None): """GetFeatureFlagByNameAndUserEmail. [Preview API] Retrieve information on a single feature flag and its current states for a user :param str name: The name of the feature to retrieve :param str user_email: The email of the user to check :param bool check_feature_exists: Check if feature exists :rtype: :class:` ` """ route_values = {} if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') query_parameters = {} if user_email is not None: query_parameters['userEmail'] = self._serialize.query('user_email', user_email, 'str') if check_feature_exists is not None: query_parameters['checkFeatureExists'] = self._serialize.query('check_feature_exists', check_feature_exists, 'bool') response = self._send(http_method='GET', location_id='3e2b80f8-9e6f-441e-8393-005610692d9c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('FeatureFlag', response) def get_feature_flag_by_name_and_user_id(self, name, user_id, check_feature_exists=None): """GetFeatureFlagByNameAndUserId. [Preview API] Retrieve information on a single feature flag and its current states for a user :param str name: The name of the feature to retrieve :param str user_id: The id of the user to check :param bool check_feature_exists: Check if feature exists :rtype: :class:` ` """ route_values = {} if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') query_parameters = {} if user_id is not None: query_parameters['userId'] = self._serialize.query('user_id', user_id, 'str') if check_feature_exists is not None: query_parameters['checkFeatureExists'] = self._serialize.query('check_feature_exists', check_feature_exists, 'bool') response = self._send(http_method='GET', location_id='3e2b80f8-9e6f-441e-8393-005610692d9c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('FeatureFlag', response) def update_feature_flag(self, state, name, user_email=None, check_feature_exists=None, set_at_application_level_also=None): """UpdateFeatureFlag. [Preview API] Change the state of an individual feature flag for a name :param :class:` ` state: State that should be set :param str name: The name of the feature to change :param str user_email: :param bool check_feature_exists: Checks if the feature exists before setting the state :param bool set_at_application_level_also: :rtype: :class:` ` """ route_values = {} if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') query_parameters = {} if user_email is not None: query_parameters['userEmail'] = self._serialize.query('user_email', user_email, 'str') if check_feature_exists is not None: query_parameters['checkFeatureExists'] = self._serialize.query('check_feature_exists', check_feature_exists, 'bool') if set_at_application_level_also is not None: query_parameters['setAtApplicationLevelAlso'] = self._serialize.query('set_at_application_level_also', set_at_application_level_also, 'bool') content = self._serialize.body(state, 'FeatureFlagPatch') response = self._send(http_method='PATCH', location_id='3e2b80f8-9e6f-441e-8393-005610692d9c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('FeatureFlag', response) models.py000066400000000000000000000035551360605530400350300ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feature_availability# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class FeatureFlag(Model): """FeatureFlag. :param description: :type description: str :param effective_state: :type effective_state: str :param explicit_state: :type explicit_state: str :param name: :type name: str :param uri: :type uri: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'effective_state': {'key': 'effectiveState', 'type': 'str'}, 'explicit_state': {'key': 'explicitState', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'} } def __init__(self, description=None, effective_state=None, explicit_state=None, name=None, uri=None): super(FeatureFlag, self).__init__() self.description = description self.effective_state = effective_state self.explicit_state = explicit_state self.name = name self.uri = uri class FeatureFlagPatch(Model): """FeatureFlagPatch. :param state: :type state: str """ _attribute_map = { 'state': {'key': 'state', 'type': 'str'} } def __init__(self, state=None): super(FeatureFlagPatch, self).__init__() self.state = state __all__ = [ 'FeatureFlag', 'FeatureFlagPatch', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feature_management/000077500000000000000000000000001360605530400327045ustar00rootroot00000000000000__init__.py000066400000000000000000000016671360605530400347500ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feature_management# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .feature_management_client import FeatureManagementClient __all__ = [ 'ContributedFeature', 'ContributedFeatureHandlerSettings', 'ContributedFeatureListener', 'ContributedFeatureSettingScope', 'ContributedFeatureState', 'ContributedFeatureStateQuery', 'ContributedFeatureValueRule', 'ReferenceLinks', 'FeatureManagementClient' ] feature_management_client.py000066400000000000000000000320261360605530400403670ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feature_management# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class FeatureManagementClient(Client): """FeatureManagement :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(FeatureManagementClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_feature(self, feature_id): """GetFeature. [Preview API] Get a specific feature by its id :param str feature_id: The contribution id of the feature :rtype: :class:` ` """ route_values = {} if feature_id is not None: route_values['featureId'] = self._serialize.url('feature_id', feature_id, 'str') response = self._send(http_method='GET', location_id='c4209f25-7a27-41dd-9f04-06080c7b6afd', version='5.0-preview.1', route_values=route_values) return self._deserialize('ContributedFeature', response) def get_features(self, target_contribution_id=None): """GetFeatures. [Preview API] Get a list of all defined features :param str target_contribution_id: Optional target contribution. If null/empty, return all features. If specified include the features that target the specified contribution. :rtype: [ContributedFeature] """ query_parameters = {} if target_contribution_id is not None: query_parameters['targetContributionId'] = self._serialize.query('target_contribution_id', target_contribution_id, 'str') response = self._send(http_method='GET', location_id='c4209f25-7a27-41dd-9f04-06080c7b6afd', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[ContributedFeature]', self._unwrap_collection(response)) def get_feature_state(self, feature_id, user_scope): """GetFeatureState. [Preview API] Get the state of the specified feature for the given user/all-users scope :param str feature_id: Contribution id of the feature :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. :rtype: :class:` ` """ route_values = {} if feature_id is not None: route_values['featureId'] = self._serialize.url('feature_id', feature_id, 'str') if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') response = self._send(http_method='GET', location_id='98911314-3f9b-4eaf-80e8-83900d8e85d9', version='5.0-preview.1', route_values=route_values) return self._deserialize('ContributedFeatureState', response) def set_feature_state(self, feature, feature_id, user_scope, reason=None, reason_code=None): """SetFeatureState. [Preview API] Set the state of a feature :param :class:` ` feature: Posted feature state object. Should specify the effective value. :param str feature_id: Contribution id of the feature :param str user_scope: User-Scope at which to set the value. Should be "me" for the current user or "host" for all users. :param str reason: Reason for changing the state :param str reason_code: Short reason code :rtype: :class:` ` """ route_values = {} if feature_id is not None: route_values['featureId'] = self._serialize.url('feature_id', feature_id, 'str') if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') query_parameters = {} if reason is not None: query_parameters['reason'] = self._serialize.query('reason', reason, 'str') if reason_code is not None: query_parameters['reasonCode'] = self._serialize.query('reason_code', reason_code, 'str') content = self._serialize.body(feature, 'ContributedFeatureState') response = self._send(http_method='PATCH', location_id='98911314-3f9b-4eaf-80e8-83900d8e85d9', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('ContributedFeatureState', response) def get_feature_state_for_scope(self, feature_id, user_scope, scope_name, scope_value): """GetFeatureStateForScope. [Preview API] Get the state of the specified feature for the given named scope :param str feature_id: Contribution id of the feature :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. :param str scope_name: Scope at which to get the feature setting for (e.g. "project" or "team") :param str scope_value: Value of the scope (e.g. the project or team id) :rtype: :class:` ` """ route_values = {} if feature_id is not None: route_values['featureId'] = self._serialize.url('feature_id', feature_id, 'str') if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') if scope_name is not None: route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') if scope_value is not None: route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') response = self._send(http_method='GET', location_id='dd291e43-aa9f-4cee-8465-a93c78e414a4', version='5.0-preview.1', route_values=route_values) return self._deserialize('ContributedFeatureState', response) def set_feature_state_for_scope(self, feature, feature_id, user_scope, scope_name, scope_value, reason=None, reason_code=None): """SetFeatureStateForScope. [Preview API] Set the state of a feature at a specific scope :param :class:` ` feature: Posted feature state object. Should specify the effective value. :param str feature_id: Contribution id of the feature :param str user_scope: User-Scope at which to set the value. Should be "me" for the current user or "host" for all users. :param str scope_name: Scope at which to get the feature setting for (e.g. "project" or "team") :param str scope_value: Value of the scope (e.g. the project or team id) :param str reason: Reason for changing the state :param str reason_code: Short reason code :rtype: :class:` ` """ route_values = {} if feature_id is not None: route_values['featureId'] = self._serialize.url('feature_id', feature_id, 'str') if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') if scope_name is not None: route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') if scope_value is not None: route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') query_parameters = {} if reason is not None: query_parameters['reason'] = self._serialize.query('reason', reason, 'str') if reason_code is not None: query_parameters['reasonCode'] = self._serialize.query('reason_code', reason_code, 'str') content = self._serialize.body(feature, 'ContributedFeatureState') response = self._send(http_method='PATCH', location_id='dd291e43-aa9f-4cee-8465-a93c78e414a4', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('ContributedFeatureState', response) def query_feature_states(self, query): """QueryFeatureStates. [Preview API] Get the effective state for a list of feature ids :param :class:` ` query: Features to query along with current scope values :rtype: :class:` ` """ content = self._serialize.body(query, 'ContributedFeatureStateQuery') response = self._send(http_method='POST', location_id='2b4486ad-122b-400c-ae65-17b6672c1f9d', version='5.0-preview.1', content=content) return self._deserialize('ContributedFeatureStateQuery', response) def query_feature_states_for_default_scope(self, query, user_scope): """QueryFeatureStatesForDefaultScope. [Preview API] Get the states of the specified features for the default scope :param :class:` ` query: Query describing the features to query. :param str user_scope: :rtype: :class:` ` """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') content = self._serialize.body(query, 'ContributedFeatureStateQuery') response = self._send(http_method='POST', location_id='3f810f28-03e2-4239-b0bc-788add3005e5', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('ContributedFeatureStateQuery', response) def query_feature_states_for_named_scope(self, query, user_scope, scope_name, scope_value): """QueryFeatureStatesForNamedScope. [Preview API] Get the states of the specified features for the specific named scope :param :class:` ` query: Query describing the features to query. :param str user_scope: :param str scope_name: :param str scope_value: :rtype: :class:` ` """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') if scope_name is not None: route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') if scope_value is not None: route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') content = self._serialize.body(query, 'ContributedFeatureStateQuery') response = self._send(http_method='POST', location_id='f29e997b-c2da-4d15-8380-765788a1a74c', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('ContributedFeatureStateQuery', response) models.py000066400000000000000000000242331360605530400344660ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feature_management# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class ContributedFeature(Model): """ContributedFeature. :param _links: Named links describing the feature :type _links: :class:`ReferenceLinks ` :param default_state: If true, the feature is enabled unless overridden at some scope :type default_state: bool :param default_value_rules: Rules for setting the default value if not specified by any setting/scope. Evaluated in order until a rule returns an Enabled or Disabled state (not Undefined) :type default_value_rules: list of :class:`ContributedFeatureValueRule ` :param description: The description of the feature :type description: str :param feature_properties: Extra properties for the feature :type feature_properties: dict :param feature_state_changed_listeners: Handler for listening to setter calls on feature value. These listeners are only invoked after a successful set has occured :type feature_state_changed_listeners: list of :class:`ContributedFeatureListener ` :param id: The full contribution id of the feature :type id: str :param include_as_claim: If this is set to true, then the id for this feature will be added to the list of claims for the request. :type include_as_claim: bool :param name: The friendly name of the feature :type name: str :param order: Suggested order to display feature in. :type order: int :param override_rules: Rules for overriding a feature value. These rules are run before explicit user/host state values are checked. They are evaluated in order until a rule returns an Enabled or Disabled state (not Undefined) :type override_rules: list of :class:`ContributedFeatureValueRule ` :param scopes: The scopes/levels at which settings can set the enabled/disabled state of this feature :type scopes: list of :class:`ContributedFeatureSettingScope ` :param service_instance_type: The service instance id of the service that owns this feature :type service_instance_type: str :param tags: Tags associated with the feature. :type tags: list of str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'default_state': {'key': 'defaultState', 'type': 'bool'}, 'default_value_rules': {'key': 'defaultValueRules', 'type': '[ContributedFeatureValueRule]'}, 'description': {'key': 'description', 'type': 'str'}, 'feature_properties': {'key': 'featureProperties', 'type': '{object}'}, 'feature_state_changed_listeners': {'key': 'featureStateChangedListeners', 'type': '[ContributedFeatureListener]'}, 'id': {'key': 'id', 'type': 'str'}, 'include_as_claim': {'key': 'includeAsClaim', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'order': {'key': 'order', 'type': 'int'}, 'override_rules': {'key': 'overrideRules', 'type': '[ContributedFeatureValueRule]'}, 'scopes': {'key': 'scopes', 'type': '[ContributedFeatureSettingScope]'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '[str]'} } def __init__(self, _links=None, default_state=None, default_value_rules=None, description=None, feature_properties=None, feature_state_changed_listeners=None, id=None, include_as_claim=None, name=None, order=None, override_rules=None, scopes=None, service_instance_type=None, tags=None): super(ContributedFeature, self).__init__() self._links = _links self.default_state = default_state self.default_value_rules = default_value_rules self.description = description self.feature_properties = feature_properties self.feature_state_changed_listeners = feature_state_changed_listeners self.id = id self.include_as_claim = include_as_claim self.name = name self.order = order self.override_rules = override_rules self.scopes = scopes self.service_instance_type = service_instance_type self.tags = tags class ContributedFeatureHandlerSettings(Model): """ContributedFeatureHandlerSettings. :param name: Name of the handler to run :type name: str :param properties: Properties to feed to the handler :type properties: dict """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'} } def __init__(self, name=None, properties=None): super(ContributedFeatureHandlerSettings, self).__init__() self.name = name self.properties = properties class ContributedFeatureListener(ContributedFeatureHandlerSettings): """ContributedFeatureListener. :param name: Name of the handler to run :type name: str :param properties: Properties to feed to the handler :type properties: dict """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'}, } def __init__(self, name=None, properties=None): super(ContributedFeatureListener, self).__init__(name=name, properties=properties) class ContributedFeatureSettingScope(Model): """ContributedFeatureSettingScope. :param setting_scope: The name of the settings scope to use when reading/writing the setting :type setting_scope: str :param user_scoped: Whether this is a user-scope or this is a host-wide (all users) setting :type user_scoped: bool """ _attribute_map = { 'setting_scope': {'key': 'settingScope', 'type': 'str'}, 'user_scoped': {'key': 'userScoped', 'type': 'bool'} } def __init__(self, setting_scope=None, user_scoped=None): super(ContributedFeatureSettingScope, self).__init__() self.setting_scope = setting_scope self.user_scoped = user_scoped class ContributedFeatureState(Model): """ContributedFeatureState. :param feature_id: The full contribution id of the feature :type feature_id: str :param overridden: True if the effective state was set by an override rule (indicating that the state cannot be managed by the end user) :type overridden: bool :param reason: Reason that the state was set (by a plugin/rule). :type reason: str :param scope: The scope at which this state applies :type scope: :class:`ContributedFeatureSettingScope ` :param state: The current state of this feature :type state: object """ _attribute_map = { 'feature_id': {'key': 'featureId', 'type': 'str'}, 'overridden': {'key': 'overridden', 'type': 'bool'}, 'reason': {'key': 'reason', 'type': 'str'}, 'scope': {'key': 'scope', 'type': 'ContributedFeatureSettingScope'}, 'state': {'key': 'state', 'type': 'object'} } def __init__(self, feature_id=None, overridden=None, reason=None, scope=None, state=None): super(ContributedFeatureState, self).__init__() self.feature_id = feature_id self.overridden = overridden self.reason = reason self.scope = scope self.state = state class ContributedFeatureStateQuery(Model): """ContributedFeatureStateQuery. :param feature_ids: The list of feature ids to query :type feature_ids: list of str :param feature_states: The query result containing the current feature states for each of the queried feature ids :type feature_states: dict :param scope_values: A dictionary of scope values (project name, etc.) to use in the query (if querying across scopes) :type scope_values: dict """ _attribute_map = { 'feature_ids': {'key': 'featureIds', 'type': '[str]'}, 'feature_states': {'key': 'featureStates', 'type': '{ContributedFeatureState}'}, 'scope_values': {'key': 'scopeValues', 'type': '{str}'} } def __init__(self, feature_ids=None, feature_states=None, scope_values=None): super(ContributedFeatureStateQuery, self).__init__() self.feature_ids = feature_ids self.feature_states = feature_states self.scope_values = scope_values class ContributedFeatureValueRule(ContributedFeatureHandlerSettings): """ContributedFeatureValueRule. :param name: Name of the handler to run :type name: str :param properties: Properties to feed to the handler :type properties: dict """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'}, } def __init__(self, name=None, properties=None): super(ContributedFeatureValueRule, self).__init__(name=name, properties=properties) class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links __all__ = [ 'ContributedFeature', 'ContributedFeatureHandlerSettings', 'ContributedFeatureListener', 'ContributedFeatureSettingScope', 'ContributedFeatureState', 'ContributedFeatureStateQuery', 'ContributedFeatureValueRule', 'ReferenceLinks', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feed/000077500000000000000000000000001360605530400277605ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feed/__init__.py000066400000000000000000000025361360605530400320770ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .feed_client import FeedClient __all__ = [ 'Feed', 'FeedBatchData', 'FeedBatchOperationData', 'FeedChange', 'FeedChangesResponse', 'FeedCore', 'FeedPermission', 'FeedRetentionPolicy', 'FeedUpdate', 'FeedView', 'GlobalPermission', 'JsonPatchOperation', 'MinimalPackageVersion', 'Package', 'PackageChange', 'PackageChangesResponse', 'PackageDependency', 'PackageDownloadMetricsQuery', 'PackageFile', 'PackageIdMetrics', 'PackageVersion', 'PackageVersionChange', 'PackageVersionDownloadMetricsQuery', 'PackageVersionMetrics', 'PackageVersionProvenance', 'ProtocolMetadata', 'Provenance', 'RecycleBinPackageVersion', 'ReferenceLinks', 'UpstreamSource', 'FeedClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feed/feed_client.py000066400000000000000000001217761360605530400326110ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class FeedClient(Client): """Feed :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(FeedClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '7ab4e64e-c4d8-4f50-ae73-5ef2e21642a5' def get_badge(self, feed_id, package_id): """GetBadge. [Preview API] Generate a SVG badge for the latest version of a package. The generated SVG is typically used as the image in an HTML link which takes users to the feed containing the package to accelerate discovery and consumption. :param str feed_id: Name or Id of the feed. :param str package_id: Id of the package (GUID Id, not name). :rtype: str """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_id is not None: route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') response = self._send(http_method='GET', location_id='61d885fd-10f3-4a55-82b6-476d866b673f', version='5.0-preview.1', route_values=route_values) return self._deserialize('str', response) def get_feed_change(self, feed_id): """GetFeedChange. [Preview API] Query a feed to determine its current state. :param str feed_id: Name or ID of the feed. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') response = self._send(http_method='GET', location_id='29ba2dad-389a-4661-b5d3-de76397ca05b', version='5.0-preview.1', route_values=route_values) return self._deserialize('FeedChange', response) def get_feed_changes(self, include_deleted=None, continuation_token=None, batch_size=None): """GetFeedChanges. [Preview API] Query to determine which feeds have changed since the last call, tracked through the provided continuationToken. Only changes to a feed itself are returned and impact the continuationToken, not additions or alterations to packages within the feeds. :param bool include_deleted: If true, get changes for all feeds including deleted feeds. The default value is false. :param long continuation_token: A continuation token which acts as a bookmark to a previously retrieved change. This token allows the user to continue retrieving changes in batches, picking up where the previous batch left off. If specified, all the changes that occur strictly after the token will be returned. If not specified or 0, iteration will start with the first change. :param int batch_size: Number of package changes to fetch. The default value is 1000. The maximum value is 2000. :rtype: :class:` ` """ query_parameters = {} if include_deleted is not None: query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'long') if batch_size is not None: query_parameters['batchSize'] = self._serialize.query('batch_size', batch_size, 'int') response = self._send(http_method='GET', location_id='29ba2dad-389a-4661-b5d3-de76397ca05b', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('FeedChangesResponse', response) def create_feed(self, feed): """CreateFeed. [Preview API] Create a feed, a container for various package types. :param :class:` ` feed: A JSON object containing both required and optional attributes for the feed. Name is the only required value. :rtype: :class:` ` """ content = self._serialize.body(feed, 'Feed') response = self._send(http_method='POST', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', version='5.0-preview.1', content=content) return self._deserialize('Feed', response) def delete_feed(self, feed_id): """DeleteFeed. [Preview API] Remove a feed and all its packages. The action does not result in packages moving to the RecycleBin and is not reversible. :param str feed_id: Name or Id of the feed. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') self._send(http_method='DELETE', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', version='5.0-preview.1', route_values=route_values) def get_feed(self, feed_id, include_deleted_upstreams=None): """GetFeed. [Preview API] Get the settings for a specific feed. :param str feed_id: Name or Id of the feed. :param bool include_deleted_upstreams: Include upstreams that have been deleted in the response. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') query_parameters = {} if include_deleted_upstreams is not None: query_parameters['includeDeletedUpstreams'] = self._serialize.query('include_deleted_upstreams', include_deleted_upstreams, 'bool') response = self._send(http_method='GET', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Feed', response) def get_feeds(self, feed_role=None, include_deleted_upstreams=None): """GetFeeds. [Preview API] Get all feeds in an account where you have the provided role access. :param str feed_role: Filter by this role, either Administrator(4), Contributor(3), or Reader(2) level permissions. :param bool include_deleted_upstreams: Include upstreams that have been deleted in the response. :rtype: [Feed] """ query_parameters = {} if feed_role is not None: query_parameters['feedRole'] = self._serialize.query('feed_role', feed_role, 'str') if include_deleted_upstreams is not None: query_parameters['includeDeletedUpstreams'] = self._serialize.query('include_deleted_upstreams', include_deleted_upstreams, 'bool') response = self._send(http_method='GET', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[Feed]', self._unwrap_collection(response)) def update_feed(self, feed, feed_id): """UpdateFeed. [Preview API] Change the attributes of a feed. :param :class:` ` feed: A JSON object containing the feed settings to be updated. :param str feed_id: Name or Id of the feed. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') content = self._serialize.body(feed, 'FeedUpdate') response = self._send(http_method='PATCH', location_id='c65009a7-474a-4ad1-8b42-7d852107ef8c', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Feed', response) def get_global_permissions(self): """GetGlobalPermissions. [Preview API] Get all service-wide feed creation permissions. :rtype: [GlobalPermission] """ response = self._send(http_method='GET', location_id='a74419ef-b477-43df-8758-3cd1cd5f56c6', version='5.0-preview.1') return self._deserialize('[GlobalPermission]', self._unwrap_collection(response)) def set_global_permissions(self, global_permissions): """SetGlobalPermissions. [Preview API] Set service-wide permissions that govern feed creation. :param [GlobalPermission] global_permissions: New permissions for the organization. :rtype: [GlobalPermission] """ content = self._serialize.body(global_permissions, '[GlobalPermission]') response = self._send(http_method='PATCH', location_id='a74419ef-b477-43df-8758-3cd1cd5f56c6', version='5.0-preview.1', content=content) return self._deserialize('[GlobalPermission]', self._unwrap_collection(response)) def get_package_changes(self, feed_id, continuation_token=None, batch_size=None): """GetPackageChanges. [Preview API] Get a batch of package changes made to a feed. The changes returned are 'most recent change' so if an Add is followed by an Update before you begin enumerating, you'll only see one change in the batch. While consuming batches using the continuation token, you may see changes to the same package version multiple times if they are happening as you enumerate. :param str feed_id: Name or Id of the feed. :param long continuation_token: A continuation token which acts as a bookmark to a previously retrieved change. This token allows the user to continue retrieving changes in batches, picking up where the previous batch left off. If specified, all the changes that occur strictly after the token will be returned. If not specified or 0, iteration will start with the first change. :param int batch_size: Number of package changes to fetch. The default value is 1000. The maximum value is 2000. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') query_parameters = {} if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'long') if batch_size is not None: query_parameters['batchSize'] = self._serialize.query('batch_size', batch_size, 'int') response = self._send(http_method='GET', location_id='323a0631-d083-4005-85ae-035114dfb681', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PackageChangesResponse', response) def get_package(self, feed_id, package_id, include_all_versions=None, include_urls=None, is_listed=None, is_release=None, include_deleted=None, include_description=None): """GetPackage. [Preview API] Get details about a specific package. :param str feed_id: Name or Id of the feed. :param str package_id: The package Id (GUID Id, not the package name). :param bool include_all_versions: True to return all versions of the package in the response. Default is false (latest version only). :param bool include_urls: True to return REST Urls with the response. Default is True. :param bool is_listed: Only applicable for NuGet packages, setting it for other package types will result in a 404. If false, delisted package versions will be returned. Use this to filter the response when includeAllVersions is set to true. Default is unset (do not return delisted packages). :param bool is_release: Only applicable for Nuget packages. Use this to filter the response when includeAllVersions is set to true. Default is True (only return packages without prerelease versioning). :param bool include_deleted: Return deleted or unpublished versions of packages in the response. Default is False. :param bool include_description: Return the description for every version of each package in the response. Default is False. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_id is not None: route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') query_parameters = {} if include_all_versions is not None: query_parameters['includeAllVersions'] = self._serialize.query('include_all_versions', include_all_versions, 'bool') if include_urls is not None: query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') if is_listed is not None: query_parameters['isListed'] = self._serialize.query('is_listed', is_listed, 'bool') if is_release is not None: query_parameters['isRelease'] = self._serialize.query('is_release', is_release, 'bool') if include_deleted is not None: query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') if include_description is not None: query_parameters['includeDescription'] = self._serialize.query('include_description', include_description, 'bool') response = self._send(http_method='GET', location_id='7a20d846-c929-4acc-9ea2-0d5a7df1b197', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Package', response) def get_packages(self, feed_id, protocol_type=None, package_name_query=None, normalized_package_name=None, include_urls=None, include_all_versions=None, is_listed=None, get_top_package_versions=None, is_release=None, include_description=None, top=None, skip=None, include_deleted=None, is_cached=None, direct_upstream_id=None): """GetPackages. [Preview API] Get details about all of the packages in the feed. Use the various filters to include or exclude information from the result set. :param str feed_id: Name or Id of the feed. :param str protocol_type: One of the supported artifact package types. :param str package_name_query: Filter to packages that contain the provided string. Characters in the string must conform to the package name constraints. :param str normalized_package_name: [Obsolete] Used for legacy scenarios and may be removed in future versions. :param bool include_urls: True to return REST Urls with the response. Default is True. :param bool include_all_versions: True to return all versions of the package in the response. Default is false (latest version only). :param bool is_listed: Only applicable for NuGet packages, setting it for other package types will result in a 404. If false, delisted package versions will be returned. Use this to filter the response when includeAllVersions is set to true. Default is unset (do not return delisted packages). :param bool get_top_package_versions: Changes the behavior of $top and $skip to return all versions of each package up to $top. Must be used in conjunction with includeAllVersions=true :param bool is_release: Only applicable for Nuget packages. Use this to filter the response when includeAllVersions is set to true. Default is True (only return packages without prerelease versioning). :param bool include_description: Return the description for every version of each package in the response. Default is False. :param int top: Get the top N packages (or package versions where getTopPackageVersions=true) :param int skip: Skip the first N packages (or package versions where getTopPackageVersions=true) :param bool include_deleted: Return deleted or unpublished versions of packages in the response. Default is False. :param bool is_cached: [Obsolete] Used for legacy scenarios and may be removed in future versions. :param str direct_upstream_id: Filter results to return packages from a specific upstream. :rtype: [Package] """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') query_parameters = {} if protocol_type is not None: query_parameters['protocolType'] = self._serialize.query('protocol_type', protocol_type, 'str') if package_name_query is not None: query_parameters['packageNameQuery'] = self._serialize.query('package_name_query', package_name_query, 'str') if normalized_package_name is not None: query_parameters['normalizedPackageName'] = self._serialize.query('normalized_package_name', normalized_package_name, 'str') if include_urls is not None: query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') if include_all_versions is not None: query_parameters['includeAllVersions'] = self._serialize.query('include_all_versions', include_all_versions, 'bool') if is_listed is not None: query_parameters['isListed'] = self._serialize.query('is_listed', is_listed, 'bool') if get_top_package_versions is not None: query_parameters['getTopPackageVersions'] = self._serialize.query('get_top_package_versions', get_top_package_versions, 'bool') if is_release is not None: query_parameters['isRelease'] = self._serialize.query('is_release', is_release, 'bool') if include_description is not None: query_parameters['includeDescription'] = self._serialize.query('include_description', include_description, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if include_deleted is not None: query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') if is_cached is not None: query_parameters['isCached'] = self._serialize.query('is_cached', is_cached, 'bool') if direct_upstream_id is not None: query_parameters['directUpstreamId'] = self._serialize.query('direct_upstream_id', direct_upstream_id, 'str') response = self._send(http_method='GET', location_id='7a20d846-c929-4acc-9ea2-0d5a7df1b197', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Package]', self._unwrap_collection(response)) def get_feed_permissions(self, feed_id, include_ids=None, exclude_inherited_permissions=None, identity_descriptor=None): """GetFeedPermissions. [Preview API] Get the permissions for a feed. :param str feed_id: Name or Id of the feed. :param bool include_ids: True to include user Ids in the response. Default is false. :param bool exclude_inherited_permissions: True to only return explicitly set permissions on the feed. Default is false. :param str identity_descriptor: Filter permissions to the provided identity. :rtype: [FeedPermission] """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') query_parameters = {} if include_ids is not None: query_parameters['includeIds'] = self._serialize.query('include_ids', include_ids, 'bool') if exclude_inherited_permissions is not None: query_parameters['excludeInheritedPermissions'] = self._serialize.query('exclude_inherited_permissions', exclude_inherited_permissions, 'bool') if identity_descriptor is not None: query_parameters['identityDescriptor'] = self._serialize.query('identity_descriptor', identity_descriptor, 'str') response = self._send(http_method='GET', location_id='be8c1476-86a7-44ed-b19d-aec0e9275cd8', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[FeedPermission]', self._unwrap_collection(response)) def set_feed_permissions(self, feed_permission, feed_id): """SetFeedPermissions. [Preview API] Update the permissions on a feed. :param [FeedPermission] feed_permission: Permissions to set. :param str feed_id: Name or Id of the feed. :rtype: [FeedPermission] """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') content = self._serialize.body(feed_permission, '[FeedPermission]') response = self._send(http_method='PATCH', location_id='be8c1476-86a7-44ed-b19d-aec0e9275cd8', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('[FeedPermission]', self._unwrap_collection(response)) def get_package_version_provenance(self, feed_id, package_id, package_version_id): """GetPackageVersionProvenance. [Preview API] Gets provenance for a package version. :param str feed_id: Name or Id of the feed. :param str package_id: Id of the package (GUID Id, not name). :param str package_version_id: Id of the package version (GUID Id, not name). :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_id is not None: route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') if package_version_id is not None: route_values['packageVersionId'] = self._serialize.url('package_version_id', package_version_id, 'str') response = self._send(http_method='GET', location_id='0aaeabd4-85cd-4686-8a77-8d31c15690b8', version='5.0-preview.1', route_values=route_values) return self._deserialize('PackageVersionProvenance', response) def get_recycle_bin_package(self, feed_id, package_id, include_urls=None): """GetRecycleBinPackage. [Preview API] Get information about a package and all its versions within the recycle bin. :param str feed_id: Name or Id of the feed. :param str package_id: The package Id (GUID Id, not the package name). :param bool include_urls: True to return REST Urls with the response. Default is True. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_id is not None: route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') query_parameters = {} if include_urls is not None: query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') response = self._send(http_method='GET', location_id='2704e72c-f541-4141-99be-2004b50b05fa', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Package', response) def get_recycle_bin_packages(self, feed_id, protocol_type=None, package_name_query=None, include_urls=None, top=None, skip=None, include_all_versions=None): """GetRecycleBinPackages. [Preview API] Query for packages within the recycle bin. :param str feed_id: Name or Id of the feed. :param str protocol_type: Type of package (e.g. NuGet, npm, ...). :param str package_name_query: Filter to packages matching this name. :param bool include_urls: True to return REST Urls with the response. Default is True. :param int top: Get the top N packages. :param int skip: Skip the first N packages. :param bool include_all_versions: True to return all versions of the package in the response. Default is false (latest version only). :rtype: [Package] """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') query_parameters = {} if protocol_type is not None: query_parameters['protocolType'] = self._serialize.query('protocol_type', protocol_type, 'str') if package_name_query is not None: query_parameters['packageNameQuery'] = self._serialize.query('package_name_query', package_name_query, 'str') if include_urls is not None: query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if include_all_versions is not None: query_parameters['includeAllVersions'] = self._serialize.query('include_all_versions', include_all_versions, 'bool') response = self._send(http_method='GET', location_id='2704e72c-f541-4141-99be-2004b50b05fa', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Package]', self._unwrap_collection(response)) def get_recycle_bin_package_version(self, feed_id, package_id, package_version_id, include_urls=None): """GetRecycleBinPackageVersion. [Preview API] Get information about a package version within the recycle bin. :param str feed_id: Name or Id of the feed. :param str package_id: The package Id (GUID Id, not the package name). :param str package_version_id: The package version Id 9guid Id, not the version string). :param bool include_urls: True to return REST Urls with the response. Default is True. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_id is not None: route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') if package_version_id is not None: route_values['packageVersionId'] = self._serialize.url('package_version_id', package_version_id, 'str') query_parameters = {} if include_urls is not None: query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') response = self._send(http_method='GET', location_id='aceb4be7-8737-4820-834c-4c549e10fdc7', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('RecycleBinPackageVersion', response) def get_recycle_bin_package_versions(self, feed_id, package_id, include_urls=None): """GetRecycleBinPackageVersions. [Preview API] Get a list of package versions within the recycle bin. :param str feed_id: Name or Id of the feed. :param str package_id: The package Id (GUID Id, not the package name). :param bool include_urls: True to return REST Urls with the response. Default is True. :rtype: [RecycleBinPackageVersion] """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_id is not None: route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') query_parameters = {} if include_urls is not None: query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') response = self._send(http_method='GET', location_id='aceb4be7-8737-4820-834c-4c549e10fdc7', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[RecycleBinPackageVersion]', self._unwrap_collection(response)) def delete_feed_retention_policies(self, feed_id): """DeleteFeedRetentionPolicies. [Preview API] Delete the retention policy for a feed. :param str feed_id: Name or ID of the feed. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') self._send(http_method='DELETE', location_id='ed52a011-0112-45b5-9f9e-e14efffb3193', version='5.0-preview.1', route_values=route_values) def get_feed_retention_policies(self, feed_id): """GetFeedRetentionPolicies. [Preview API] Get the retention policy for a feed. :param str feed_id: Name or ID of the feed. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') response = self._send(http_method='GET', location_id='ed52a011-0112-45b5-9f9e-e14efffb3193', version='5.0-preview.1', route_values=route_values) return self._deserialize('FeedRetentionPolicy', response) def set_feed_retention_policies(self, policy, feed_id): """SetFeedRetentionPolicies. [Preview API] Set the retention policy for a feed. :param :class:` ` policy: Feed retention policy. :param str feed_id: Name or ID of the feed. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') content = self._serialize.body(policy, 'FeedRetentionPolicy') response = self._send(http_method='PUT', location_id='ed52a011-0112-45b5-9f9e-e14efffb3193', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('FeedRetentionPolicy', response) def get_package_version(self, feed_id, package_id, package_version_id, include_urls=None, is_listed=None, is_deleted=None): """GetPackageVersion. [Preview API] Get details about a specific package version. :param str feed_id: Name or Id of the feed. :param str package_id: Id of the package (GUID Id, not name). :param str package_version_id: Id of the package version (GUID Id, not name). :param bool include_urls: True to include urls for each version. Default is true. :param bool is_listed: Only applicable for NuGet packages. If false, delisted package versions will be returned. :param bool is_deleted: Return deleted or unpublished versions of packages in the response. Default is unset (do not return deleted versions). :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_id is not None: route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') if package_version_id is not None: route_values['packageVersionId'] = self._serialize.url('package_version_id', package_version_id, 'str') query_parameters = {} if include_urls is not None: query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') if is_listed is not None: query_parameters['isListed'] = self._serialize.query('is_listed', is_listed, 'bool') if is_deleted is not None: query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') response = self._send(http_method='GET', location_id='3b331909-6a86-44cc-b9ec-c1834c35498f', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PackageVersion', response) def get_package_versions(self, feed_id, package_id, include_urls=None, is_listed=None, is_deleted=None): """GetPackageVersions. [Preview API] Get a list of package versions, optionally filtering by state. :param str feed_id: Name or Id of the feed. :param str package_id: Id of the package (GUID Id, not name). :param bool include_urls: True to include urls for each version. Default is true. :param bool is_listed: Only applicable for NuGet packages. If false, delisted package versions will be returned. :param bool is_deleted: Return deleted or unpublished versions of packages in the response. Default is unset (do not return deleted versions). :rtype: [PackageVersion] """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_id is not None: route_values['packageId'] = self._serialize.url('package_id', package_id, 'str') query_parameters = {} if include_urls is not None: query_parameters['includeUrls'] = self._serialize.query('include_urls', include_urls, 'bool') if is_listed is not None: query_parameters['isListed'] = self._serialize.query('is_listed', is_listed, 'bool') if is_deleted is not None: query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') response = self._send(http_method='GET', location_id='3b331909-6a86-44cc-b9ec-c1834c35498f', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[PackageVersion]', self._unwrap_collection(response)) def create_feed_view(self, view, feed_id): """CreateFeedView. [Preview API] Create a new view on the referenced feed. :param :class:` ` view: View to be created. :param str feed_id: Name or Id of the feed. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') content = self._serialize.body(view, 'FeedView') response = self._send(http_method='POST', location_id='42a8502a-6785-41bc-8c16-89477d930877', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('FeedView', response) def delete_feed_view(self, feed_id, view_id): """DeleteFeedView. [Preview API] Delete a feed view. :param str feed_id: Name or Id of the feed. :param str view_id: Name or Id of the view. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if view_id is not None: route_values['viewId'] = self._serialize.url('view_id', view_id, 'str') self._send(http_method='DELETE', location_id='42a8502a-6785-41bc-8c16-89477d930877', version='5.0-preview.1', route_values=route_values) def get_feed_view(self, feed_id, view_id): """GetFeedView. [Preview API] Get a view by Id. :param str feed_id: Name or Id of the feed. :param str view_id: Name or Id of the view. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if view_id is not None: route_values['viewId'] = self._serialize.url('view_id', view_id, 'str') response = self._send(http_method='GET', location_id='42a8502a-6785-41bc-8c16-89477d930877', version='5.0-preview.1', route_values=route_values) return self._deserialize('FeedView', response) def get_feed_views(self, feed_id): """GetFeedViews. [Preview API] Get all views for a feed. :param str feed_id: Name or Id of the feed. :rtype: [FeedView] """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') response = self._send(http_method='GET', location_id='42a8502a-6785-41bc-8c16-89477d930877', version='5.0-preview.1', route_values=route_values) return self._deserialize('[FeedView]', self._unwrap_collection(response)) def update_feed_view(self, view, feed_id, view_id): """UpdateFeedView. [Preview API] Update a view. :param :class:` ` view: New settings to apply to the specified view. :param str feed_id: Name or Id of the feed. :param str view_id: Name or Id of the view. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if view_id is not None: route_values['viewId'] = self._serialize.url('view_id', view_id, 'str') content = self._serialize.body(view, 'FeedView') response = self._send(http_method='PATCH', location_id='42a8502a-6785-41bc-8c16-89477d930877', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('FeedView', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feed/models.py000066400000000000000000001467411360605530400316320ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class FeedBatchData(Model): """FeedBatchData. :param data: :type data: :class:`FeedBatchOperationData ` :param operation: :type operation: object """ _attribute_map = { 'data': {'key': 'data', 'type': 'FeedBatchOperationData'}, 'operation': {'key': 'operation', 'type': 'object'} } def __init__(self, data=None, operation=None): super(FeedBatchData, self).__init__() self.data = data self.operation = operation class FeedBatchOperationData(Model): """FeedBatchOperationData. """ _attribute_map = { } def __init__(self): super(FeedBatchOperationData, self).__init__() class FeedChange(Model): """FeedChange. :param change_type: The type of operation. :type change_type: object :param feed: The state of the feed after a after a create, update, or delete operation completed. :type feed: :class:`Feed ` :param feed_continuation_token: A token that identifies the next change in the log of changes. :type feed_continuation_token: long :param latest_package_continuation_token: A token that identifies the latest package change for this feed. This can be used to quickly determine if there have been any changes to packages in a specific feed. :type latest_package_continuation_token: long """ _attribute_map = { 'change_type': {'key': 'changeType', 'type': 'object'}, 'feed': {'key': 'feed', 'type': 'Feed'}, 'feed_continuation_token': {'key': 'feedContinuationToken', 'type': 'long'}, 'latest_package_continuation_token': {'key': 'latestPackageContinuationToken', 'type': 'long'} } def __init__(self, change_type=None, feed=None, feed_continuation_token=None, latest_package_continuation_token=None): super(FeedChange, self).__init__() self.change_type = change_type self.feed = feed self.feed_continuation_token = feed_continuation_token self.latest_package_continuation_token = latest_package_continuation_token class FeedChangesResponse(Model): """FeedChangesResponse. :param _links: :type _links: :class:`ReferenceLinks ` :param count: The number of changes in this set. :type count: int :param feed_changes: A container that encapsulates the state of the feed after a create, update, or delete. :type feed_changes: list of :class:`FeedChange ` :param next_feed_continuation_token: When iterating through the log of changes this value indicates the value that should be used for the next continuation token. :type next_feed_continuation_token: long """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'count': {'key': 'count', 'type': 'int'}, 'feed_changes': {'key': 'feedChanges', 'type': '[FeedChange]'}, 'next_feed_continuation_token': {'key': 'nextFeedContinuationToken', 'type': 'long'} } def __init__(self, _links=None, count=None, feed_changes=None, next_feed_continuation_token=None): super(FeedChangesResponse, self).__init__() self._links = _links self.count = count self.feed_changes = feed_changes self.next_feed_continuation_token = next_feed_continuation_token class FeedCore(Model): """FeedCore. :param allow_upstream_name_conflict: OBSOLETE: If set, the feed will allow upload of packages that exist on the upstream :type allow_upstream_name_conflict: bool :param capabilities: Supported capabilities of a feed. :type capabilities: object :param fully_qualified_id: This will either be the feed GUID or the feed GUID and view GUID depending on how the feed was accessed. :type fully_qualified_id: str :param fully_qualified_name: Full name of the view, in feed@view format. :type fully_qualified_name: str :param id: A GUID that uniquely identifies this feed. :type id: str :param is_read_only: If set, all packages in the feed are immutable. It is important to note that feed views are immutable; therefore, this flag will always be set for views. :type is_read_only: bool :param name: A name for the feed. feed names must follow these rules: Must not exceed 64 characters Must not contain whitespaces Must not start with an underscore or a period Must not end with a period Must not contain any of the following illegal characters: , |, /, \\, ?, :, &, $, *, \", #, [, ] ]]> :type name: str :param upstream_enabled: OBSOLETE: This should always be true. Setting to false will override all sources in UpstreamSources. :type upstream_enabled: bool :param upstream_sources: A list of sources that this feed will fetch packages from. An empty list indicates that this feed will not search any additional sources for packages. :type upstream_sources: list of :class:`UpstreamSource ` :param view: Definition of the view. :type view: :class:`FeedView ` :param view_id: View Id. :type view_id: str :param view_name: View name. :type view_name: str """ _attribute_map = { 'allow_upstream_name_conflict': {'key': 'allowUpstreamNameConflict', 'type': 'bool'}, 'capabilities': {'key': 'capabilities', 'type': 'object'}, 'fully_qualified_id': {'key': 'fullyQualifiedId', 'type': 'str'}, 'fully_qualified_name': {'key': 'fullyQualifiedName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'upstream_enabled': {'key': 'upstreamEnabled', 'type': 'bool'}, 'upstream_sources': {'key': 'upstreamSources', 'type': '[UpstreamSource]'}, 'view': {'key': 'view', 'type': 'FeedView'}, 'view_id': {'key': 'viewId', 'type': 'str'}, 'view_name': {'key': 'viewName', 'type': 'str'} } def __init__(self, allow_upstream_name_conflict=None, capabilities=None, fully_qualified_id=None, fully_qualified_name=None, id=None, is_read_only=None, name=None, upstream_enabled=None, upstream_sources=None, view=None, view_id=None, view_name=None): super(FeedCore, self).__init__() self.allow_upstream_name_conflict = allow_upstream_name_conflict self.capabilities = capabilities self.fully_qualified_id = fully_qualified_id self.fully_qualified_name = fully_qualified_name self.id = id self.is_read_only = is_read_only self.name = name self.upstream_enabled = upstream_enabled self.upstream_sources = upstream_sources self.view = view self.view_id = view_id self.view_name = view_name class FeedPermission(Model): """FeedPermission. :param display_name: Display name for the identity. :type display_name: str :param identity_descriptor: Identity associated with this role. :type identity_descriptor: :class:`str ` :param identity_id: Id of the identity associated with this role. :type identity_id: str :param role: The role for this identity on a feed. :type role: object """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'identity_descriptor': {'key': 'identityDescriptor', 'type': 'str'}, 'identity_id': {'key': 'identityId', 'type': 'str'}, 'role': {'key': 'role', 'type': 'object'} } def __init__(self, display_name=None, identity_descriptor=None, identity_id=None, role=None): super(FeedPermission, self).__init__() self.display_name = display_name self.identity_descriptor = identity_descriptor self.identity_id = identity_id self.role = role class FeedRetentionPolicy(Model): """FeedRetentionPolicy. :param age_limit_in_days: Used for legacy scenarios and may be removed in future versions. :type age_limit_in_days: int :param count_limit: Maximum versions to preserve per package and package type. :type count_limit: int """ _attribute_map = { 'age_limit_in_days': {'key': 'ageLimitInDays', 'type': 'int'}, 'count_limit': {'key': 'countLimit', 'type': 'int'} } def __init__(self, age_limit_in_days=None, count_limit=None): super(FeedRetentionPolicy, self).__init__() self.age_limit_in_days = age_limit_in_days self.count_limit = count_limit class FeedUpdate(Model): """FeedUpdate. :param allow_upstream_name_conflict: If set, the feed will allow upload of packages that exist on the upstream :type allow_upstream_name_conflict: bool :param badges_enabled: If set, this feed supports generation of package badges. :type badges_enabled: bool :param default_view_id: The view that the feed administrator has indicated is the default experience for readers. :type default_view_id: str :param description: A description for the feed. Descriptions must not exceed 255 characters. :type description: str :param hide_deleted_package_versions: If set, feed will hide all deleted/unpublished versions :type hide_deleted_package_versions: bool :param id: A GUID that uniquely identifies this feed. :type id: str :param name: A name for the feed. feed names must follow these rules: Must not exceed 64 characters Must not contain whitespaces Must not start with an underscore or a period Must not end with a period Must not contain any of the following illegal characters: , |, /, \\, ?, :, &, $, *, \", #, [, ] ]]> :type name: str :param upstream_enabled: OBSOLETE: If set, the feed can proxy packages from an upstream feed :type upstream_enabled: bool :param upstream_sources: A list of sources that this feed will fetch packages from. An empty list indicates that this feed will not search any additional sources for packages. :type upstream_sources: list of :class:`UpstreamSource ` """ _attribute_map = { 'allow_upstream_name_conflict': {'key': 'allowUpstreamNameConflict', 'type': 'bool'}, 'badges_enabled': {'key': 'badgesEnabled', 'type': 'bool'}, 'default_view_id': {'key': 'defaultViewId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'hide_deleted_package_versions': {'key': 'hideDeletedPackageVersions', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'upstream_enabled': {'key': 'upstreamEnabled', 'type': 'bool'}, 'upstream_sources': {'key': 'upstreamSources', 'type': '[UpstreamSource]'} } def __init__(self, allow_upstream_name_conflict=None, badges_enabled=None, default_view_id=None, description=None, hide_deleted_package_versions=None, id=None, name=None, upstream_enabled=None, upstream_sources=None): super(FeedUpdate, self).__init__() self.allow_upstream_name_conflict = allow_upstream_name_conflict self.badges_enabled = badges_enabled self.default_view_id = default_view_id self.description = description self.hide_deleted_package_versions = hide_deleted_package_versions self.id = id self.name = name self.upstream_enabled = upstream_enabled self.upstream_sources = upstream_sources class FeedView(Model): """FeedView. :param _links: Related REST links. :type _links: :class:`ReferenceLinks ` :param id: Id of the view. :type id: str :param name: Name of the view. :type name: str :param type: Type of view. :type type: object :param url: Url of the view. :type url: str :param visibility: Visibility status of the view. :type visibility: object """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'visibility': {'key': 'visibility', 'type': 'object'} } def __init__(self, _links=None, id=None, name=None, type=None, url=None, visibility=None): super(FeedView, self).__init__() self._links = _links self.id = id self.name = name self.type = type self.url = url self.visibility = visibility class GlobalPermission(Model): """GlobalPermission. :param identity_descriptor: Identity of the user with the provided Role. :type identity_descriptor: :class:`str ` :param role: Role associated with the Identity. :type role: object """ _attribute_map = { 'identity_descriptor': {'key': 'identityDescriptor', 'type': 'str'}, 'role': {'key': 'role', 'type': 'object'} } def __init__(self, identity_descriptor=None, role=None): super(GlobalPermission, self).__init__() self.identity_descriptor = identity_descriptor self.role = role class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class MinimalPackageVersion(Model): """MinimalPackageVersion. :param direct_upstream_source_id: Upstream source this package was ingested from. :type direct_upstream_source_id: str :param id: Id for the package. :type id: str :param is_cached_version: [Obsolete] Used for legacy scenarios and may be removed in future versions. :type is_cached_version: bool :param is_deleted: True if this package has been deleted. :type is_deleted: bool :param is_latest: True if this is the latest version of the package by package type sort order. :type is_latest: bool :param is_listed: (NuGet Only) True if this package is listed. :type is_listed: bool :param normalized_version: Normalized version using normalization rules specific to a package type. :type normalized_version: str :param package_description: Package description. :type package_description: str :param publish_date: UTC Date the package was published to the service. :type publish_date: datetime :param storage_id: Internal storage id. :type storage_id: str :param version: Display version. :type version: str :param views: List of views containing this package version. :type views: list of :class:`FeedView ` """ _attribute_map = { 'direct_upstream_source_id': {'key': 'directUpstreamSourceId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_cached_version': {'key': 'isCachedVersion', 'type': 'bool'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'is_latest': {'key': 'isLatest', 'type': 'bool'}, 'is_listed': {'key': 'isListed', 'type': 'bool'}, 'normalized_version': {'key': 'normalizedVersion', 'type': 'str'}, 'package_description': {'key': 'packageDescription', 'type': 'str'}, 'publish_date': {'key': 'publishDate', 'type': 'iso-8601'}, 'storage_id': {'key': 'storageId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'views': {'key': 'views', 'type': '[FeedView]'} } def __init__(self, direct_upstream_source_id=None, id=None, is_cached_version=None, is_deleted=None, is_latest=None, is_listed=None, normalized_version=None, package_description=None, publish_date=None, storage_id=None, version=None, views=None): super(MinimalPackageVersion, self).__init__() self.direct_upstream_source_id = direct_upstream_source_id self.id = id self.is_cached_version = is_cached_version self.is_deleted = is_deleted self.is_latest = is_latest self.is_listed = is_listed self.normalized_version = normalized_version self.package_description = package_description self.publish_date = publish_date self.storage_id = storage_id self.version = version self.views = views class Package(Model): """Package. :param _links: Related REST links. :type _links: :class:`ReferenceLinks ` :param id: Id of the package. :type id: str :param is_cached: Used for legacy scenarios and may be removed in future versions. :type is_cached: bool :param name: The display name of the package. :type name: str :param normalized_name: The normalized name representing the identity of this package within its package type. :type normalized_name: str :param protocol_type: Type of the package. :type protocol_type: str :param star_count: [Obsolete] - this field is unused and will be removed in a future release. :type star_count: int :param url: Url for this package. :type url: str :param versions: All versions for this package within its feed. :type versions: list of :class:`MinimalPackageVersion ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'str'}, 'is_cached': {'key': 'isCached', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'normalized_name': {'key': 'normalizedName', 'type': 'str'}, 'protocol_type': {'key': 'protocolType', 'type': 'str'}, 'star_count': {'key': 'starCount', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'}, 'versions': {'key': 'versions', 'type': '[MinimalPackageVersion]'} } def __init__(self, _links=None, id=None, is_cached=None, name=None, normalized_name=None, protocol_type=None, star_count=None, url=None, versions=None): super(Package, self).__init__() self._links = _links self.id = id self.is_cached = is_cached self.name = name self.normalized_name = normalized_name self.protocol_type = protocol_type self.star_count = star_count self.url = url self.versions = versions class PackageChange(Model): """PackageChange. :param package: Package that was changed. :type package: :class:`Package ` :param package_version_change: Change that was performed on a package version. :type package_version_change: :class:`PackageVersionChange ` """ _attribute_map = { 'package': {'key': 'package', 'type': 'Package'}, 'package_version_change': {'key': 'packageVersionChange', 'type': 'PackageVersionChange'} } def __init__(self, package=None, package_version_change=None): super(PackageChange, self).__init__() self.package = package self.package_version_change = package_version_change class PackageChangesResponse(Model): """PackageChangesResponse. :param _links: Related REST links. :type _links: :class:`ReferenceLinks ` :param count: Number of changes in this batch. :type count: int :param next_package_continuation_token: Token that should be used in future calls for this feed to retrieve new changes. :type next_package_continuation_token: long :param package_changes: List of changes. :type package_changes: list of :class:`PackageChange ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'count': {'key': 'count', 'type': 'int'}, 'next_package_continuation_token': {'key': 'nextPackageContinuationToken', 'type': 'long'}, 'package_changes': {'key': 'packageChanges', 'type': '[PackageChange]'} } def __init__(self, _links=None, count=None, next_package_continuation_token=None, package_changes=None): super(PackageChangesResponse, self).__init__() self._links = _links self.count = count self.next_package_continuation_token = next_package_continuation_token self.package_changes = package_changes class PackageDependency(Model): """PackageDependency. :param group: Dependency package group (an optional classification within some package types). :type group: str :param package_name: Dependency package name. :type package_name: str :param version_range: Dependency package version range. :type version_range: str """ _attribute_map = { 'group': {'key': 'group', 'type': 'str'}, 'package_name': {'key': 'packageName', 'type': 'str'}, 'version_range': {'key': 'versionRange', 'type': 'str'} } def __init__(self, group=None, package_name=None, version_range=None): super(PackageDependency, self).__init__() self.group = group self.package_name = package_name self.version_range = version_range class PackageDownloadMetricsQuery(Model): """PackageDownloadMetricsQuery. :param package_ids: List of package ids :type package_ids: list of str """ _attribute_map = { 'package_ids': {'key': 'packageIds', 'type': '[str]'} } def __init__(self, package_ids=None): super(PackageDownloadMetricsQuery, self).__init__() self.package_ids = package_ids class PackageFile(Model): """PackageFile. :param children: Hierarchical representation of files. :type children: list of :class:`PackageFile ` :param name: File name. :type name: str :param protocol_metadata: Extended data unique to a specific package type. :type protocol_metadata: :class:`ProtocolMetadata ` """ _attribute_map = { 'children': {'key': 'children', 'type': '[PackageFile]'}, 'name': {'key': 'name', 'type': 'str'}, 'protocol_metadata': {'key': 'protocolMetadata', 'type': 'ProtocolMetadata'} } def __init__(self, children=None, name=None, protocol_metadata=None): super(PackageFile, self).__init__() self.children = children self.name = name self.protocol_metadata = protocol_metadata class PackageIdMetrics(Model): """PackageIdMetrics. :param download_count: Total count of downloads per package id. :type download_count: float :param download_unique_users: Number of downloads per unique user per package id. :type download_unique_users: float :param last_downloaded: UTC date and time when package was last downloaded. :type last_downloaded: datetime :param package_id: Package id. :type package_id: str """ _attribute_map = { 'download_count': {'key': 'downloadCount', 'type': 'float'}, 'download_unique_users': {'key': 'downloadUniqueUsers', 'type': 'float'}, 'last_downloaded': {'key': 'lastDownloaded', 'type': 'iso-8601'}, 'package_id': {'key': 'packageId', 'type': 'str'} } def __init__(self, download_count=None, download_unique_users=None, last_downloaded=None, package_id=None): super(PackageIdMetrics, self).__init__() self.download_count = download_count self.download_unique_users = download_unique_users self.last_downloaded = last_downloaded self.package_id = package_id class PackageVersion(MinimalPackageVersion): """PackageVersion. :param direct_upstream_source_id: Upstream source this package was ingested from. :type direct_upstream_source_id: str :param id: Id for the package. :type id: str :param is_cached_version: [Obsolete] Used for legacy scenarios and may be removed in future versions. :type is_cached_version: bool :param is_deleted: True if this package has been deleted. :type is_deleted: bool :param is_latest: True if this is the latest version of the package by package type sort order. :type is_latest: bool :param is_listed: (NuGet Only) True if this package is listed. :type is_listed: bool :param normalized_version: Normalized version using normalization rules specific to a package type. :type normalized_version: str :param package_description: Package description. :type package_description: str :param publish_date: UTC Date the package was published to the service. :type publish_date: datetime :param storage_id: Internal storage id. :type storage_id: str :param version: Display version. :type version: str :param views: List of views containing this package version. :type views: list of :class:`FeedView ` :param _links: Related links :type _links: :class:`ReferenceLinks ` :param author: Package version author. :type author: str :param deleted_date: UTC date that this package version was deleted. :type deleted_date: datetime :param dependencies: List of dependencies for this package version. :type dependencies: list of :class:`PackageDependency ` :param description: Package version description. :type description: str :param files: Files associated with this package version, only relevant for multi-file package types. :type files: list of :class:`PackageFile ` :param other_versions: Other versions of this package. :type other_versions: list of :class:`MinimalPackageVersion ` :param protocol_metadata: Extended data specific to a package type. :type protocol_metadata: :class:`ProtocolMetadata ` :param source_chain: List of upstream sources through which a package version moved to land in this feed. :type source_chain: list of :class:`UpstreamSource ` :param summary: Package version summary. :type summary: str :param tags: Package version tags. :type tags: list of str :param url: Package version url. :type url: str """ _attribute_map = { 'direct_upstream_source_id': {'key': 'directUpstreamSourceId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_cached_version': {'key': 'isCachedVersion', 'type': 'bool'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'is_latest': {'key': 'isLatest', 'type': 'bool'}, 'is_listed': {'key': 'isListed', 'type': 'bool'}, 'normalized_version': {'key': 'normalizedVersion', 'type': 'str'}, 'package_description': {'key': 'packageDescription', 'type': 'str'}, 'publish_date': {'key': 'publishDate', 'type': 'iso-8601'}, 'storage_id': {'key': 'storageId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'views': {'key': 'views', 'type': '[FeedView]'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'str'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'dependencies': {'key': 'dependencies', 'type': '[PackageDependency]'}, 'description': {'key': 'description', 'type': 'str'}, 'files': {'key': 'files', 'type': '[PackageFile]'}, 'other_versions': {'key': 'otherVersions', 'type': '[MinimalPackageVersion]'}, 'protocol_metadata': {'key': 'protocolMetadata', 'type': 'ProtocolMetadata'}, 'source_chain': {'key': 'sourceChain', 'type': '[UpstreamSource]'}, 'summary': {'key': 'summary', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, direct_upstream_source_id=None, id=None, is_cached_version=None, is_deleted=None, is_latest=None, is_listed=None, normalized_version=None, package_description=None, publish_date=None, storage_id=None, version=None, views=None, _links=None, author=None, deleted_date=None, dependencies=None, description=None, files=None, other_versions=None, protocol_metadata=None, source_chain=None, summary=None, tags=None, url=None): super(PackageVersion, self).__init__(direct_upstream_source_id=direct_upstream_source_id, id=id, is_cached_version=is_cached_version, is_deleted=is_deleted, is_latest=is_latest, is_listed=is_listed, normalized_version=normalized_version, package_description=package_description, publish_date=publish_date, storage_id=storage_id, version=version, views=views) self._links = _links self.author = author self.deleted_date = deleted_date self.dependencies = dependencies self.description = description self.files = files self.other_versions = other_versions self.protocol_metadata = protocol_metadata self.source_chain = source_chain self.summary = summary self.tags = tags self.url = url class PackageVersionChange(Model): """PackageVersionChange. :param change_type: The type of change that was performed. :type change_type: object :param continuation_token: Token marker for this change, allowing the caller to send this value back to the service and receive changes beyond this one. :type continuation_token: long :param package_version: Package version that was changed. :type package_version: :class:`PackageVersion ` """ _attribute_map = { 'change_type': {'key': 'changeType', 'type': 'object'}, 'continuation_token': {'key': 'continuationToken', 'type': 'long'}, 'package_version': {'key': 'packageVersion', 'type': 'PackageVersion'} } def __init__(self, change_type=None, continuation_token=None, package_version=None): super(PackageVersionChange, self).__init__() self.change_type = change_type self.continuation_token = continuation_token self.package_version = package_version class PackageVersionDownloadMetricsQuery(Model): """PackageVersionDownloadMetricsQuery. :param package_version_ids: List of package version ids :type package_version_ids: list of str """ _attribute_map = { 'package_version_ids': {'key': 'packageVersionIds', 'type': '[str]'} } def __init__(self, package_version_ids=None): super(PackageVersionDownloadMetricsQuery, self).__init__() self.package_version_ids = package_version_ids class PackageVersionMetrics(Model): """PackageVersionMetrics. :param download_count: Total count of downloads per package version id. :type download_count: float :param download_unique_users: Number of downloads per unique user per package version id. :type download_unique_users: float :param last_downloaded: UTC date and time when package version was last downloaded. :type last_downloaded: datetime :param package_id: Package id. :type package_id: str :param package_version_id: Package version id. :type package_version_id: str """ _attribute_map = { 'download_count': {'key': 'downloadCount', 'type': 'float'}, 'download_unique_users': {'key': 'downloadUniqueUsers', 'type': 'float'}, 'last_downloaded': {'key': 'lastDownloaded', 'type': 'iso-8601'}, 'package_id': {'key': 'packageId', 'type': 'str'}, 'package_version_id': {'key': 'packageVersionId', 'type': 'str'} } def __init__(self, download_count=None, download_unique_users=None, last_downloaded=None, package_id=None, package_version_id=None): super(PackageVersionMetrics, self).__init__() self.download_count = download_count self.download_unique_users = download_unique_users self.last_downloaded = last_downloaded self.package_id = package_id self.package_version_id = package_version_id class PackageVersionProvenance(Model): """PackageVersionProvenance. :param feed_id: Name or Id of the feed. :type feed_id: str :param package_id: Id of the package (GUID Id, not name). :type package_id: str :param package_version_id: Id of the package version (GUID Id, not name). :type package_version_id: str :param provenance: Provenance information for this package version. :type provenance: :class:`Provenance ` """ _attribute_map = { 'feed_id': {'key': 'feedId', 'type': 'str'}, 'package_id': {'key': 'packageId', 'type': 'str'}, 'package_version_id': {'key': 'packageVersionId', 'type': 'str'}, 'provenance': {'key': 'provenance', 'type': 'Provenance'} } def __init__(self, feed_id=None, package_id=None, package_version_id=None, provenance=None): super(PackageVersionProvenance, self).__init__() self.feed_id = feed_id self.package_id = package_id self.package_version_id = package_version_id self.provenance = provenance class ProtocolMetadata(Model): """ProtocolMetadata. :param data: Extended metadata for a specific package type, formatted to the associated schema version definition. :type data: object :param schema_version: Schema version. :type schema_version: int """ _attribute_map = { 'data': {'key': 'data', 'type': 'object'}, 'schema_version': {'key': 'schemaVersion', 'type': 'int'} } def __init__(self, data=None, schema_version=None): super(ProtocolMetadata, self).__init__() self.data = data self.schema_version = schema_version class Provenance(Model): """Provenance. :param data: Other provenance data. :type data: dict :param provenance_source: Type of provenance source, for example "InternalBuild", "InternalRelease" :type provenance_source: str :param publisher_user_identity: Identity of user that published the package :type publisher_user_identity: str :param user_agent: HTTP User-Agent used when pushing the package. :type user_agent: str """ _attribute_map = { 'data': {'key': 'data', 'type': '{str}'}, 'provenance_source': {'key': 'provenanceSource', 'type': 'str'}, 'publisher_user_identity': {'key': 'publisherUserIdentity', 'type': 'str'}, 'user_agent': {'key': 'userAgent', 'type': 'str'} } def __init__(self, data=None, provenance_source=None, publisher_user_identity=None, user_agent=None): super(Provenance, self).__init__() self.data = data self.provenance_source = provenance_source self.publisher_user_identity = publisher_user_identity self.user_agent = user_agent class RecycleBinPackageVersion(PackageVersion): """RecycleBinPackageVersion. :param direct_upstream_source_id: Upstream source this package was ingested from. :type direct_upstream_source_id: str :param id: Id for the package. :type id: str :param is_cached_version: [Obsolete] Used for legacy scenarios and may be removed in future versions. :type is_cached_version: bool :param is_deleted: True if this package has been deleted. :type is_deleted: bool :param is_latest: True if this is the latest version of the package by package type sort order. :type is_latest: bool :param is_listed: (NuGet Only) True if this package is listed. :type is_listed: bool :param normalized_version: Normalized version using normalization rules specific to a package type. :type normalized_version: str :param package_description: Package description. :type package_description: str :param publish_date: UTC Date the package was published to the service. :type publish_date: datetime :param storage_id: Internal storage id. :type storage_id: str :param version: Display version. :type version: str :param views: List of views containing this package version. :type views: list of :class:`FeedView ` :param _links: Related links :type _links: :class:`ReferenceLinks ` :param author: Package version author. :type author: str :param deleted_date: UTC date that this package version was deleted. :type deleted_date: datetime :param dependencies: List of dependencies for this package version. :type dependencies: list of :class:`PackageDependency ` :param description: Package version description. :type description: str :param files: Files associated with this package version, only relevant for multi-file package types. :type files: list of :class:`PackageFile ` :param other_versions: Other versions of this package. :type other_versions: list of :class:`MinimalPackageVersion ` :param protocol_metadata: Extended data specific to a package type. :type protocol_metadata: :class:`ProtocolMetadata ` :param source_chain: List of upstream sources through which a package version moved to land in this feed. :type source_chain: list of :class:`UpstreamSource ` :param summary: Package version summary. :type summary: str :param tags: Package version tags. :type tags: list of str :param url: Package version url. :type url: str :param scheduled_permanent_delete_date: UTC date on which the package will automatically be removed from the recycle bin and permanently deleted. :type scheduled_permanent_delete_date: datetime """ _attribute_map = { 'direct_upstream_source_id': {'key': 'directUpstreamSourceId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_cached_version': {'key': 'isCachedVersion', 'type': 'bool'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'is_latest': {'key': 'isLatest', 'type': 'bool'}, 'is_listed': {'key': 'isListed', 'type': 'bool'}, 'normalized_version': {'key': 'normalizedVersion', 'type': 'str'}, 'package_description': {'key': 'packageDescription', 'type': 'str'}, 'publish_date': {'key': 'publishDate', 'type': 'iso-8601'}, 'storage_id': {'key': 'storageId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'views': {'key': 'views', 'type': '[FeedView]'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'str'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'dependencies': {'key': 'dependencies', 'type': '[PackageDependency]'}, 'description': {'key': 'description', 'type': 'str'}, 'files': {'key': 'files', 'type': '[PackageFile]'}, 'other_versions': {'key': 'otherVersions', 'type': '[MinimalPackageVersion]'}, 'protocol_metadata': {'key': 'protocolMetadata', 'type': 'ProtocolMetadata'}, 'source_chain': {'key': 'sourceChain', 'type': '[UpstreamSource]'}, 'summary': {'key': 'summary', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'url': {'key': 'url', 'type': 'str'}, 'scheduled_permanent_delete_date': {'key': 'scheduledPermanentDeleteDate', 'type': 'iso-8601'} } def __init__(self, direct_upstream_source_id=None, id=None, is_cached_version=None, is_deleted=None, is_latest=None, is_listed=None, normalized_version=None, package_description=None, publish_date=None, storage_id=None, version=None, views=None, _links=None, author=None, deleted_date=None, dependencies=None, description=None, files=None, other_versions=None, protocol_metadata=None, source_chain=None, summary=None, tags=None, url=None, scheduled_permanent_delete_date=None): super(RecycleBinPackageVersion, self).__init__(direct_upstream_source_id=direct_upstream_source_id, id=id, is_cached_version=is_cached_version, is_deleted=is_deleted, is_latest=is_latest, is_listed=is_listed, normalized_version=normalized_version, package_description=package_description, publish_date=publish_date, storage_id=storage_id, version=version, views=views, _links=_links, author=author, deleted_date=deleted_date, dependencies=dependencies, description=description, files=files, other_versions=other_versions, protocol_metadata=protocol_metadata, source_chain=source_chain, summary=summary, tags=tags, url=url) self.scheduled_permanent_delete_date = scheduled_permanent_delete_date class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class UpstreamSource(Model): """UpstreamSource. :param deleted_date: UTC date that this upstream was deleted. :type deleted_date: datetime :param id: Identity of the upstream source. :type id: str :param internal_upstream_collection_id: For an internal upstream type, track the Azure DevOps organization that contains it. :type internal_upstream_collection_id: str :param internal_upstream_feed_id: For an internal upstream type, track the feed id being referenced. :type internal_upstream_feed_id: str :param internal_upstream_view_id: For an internal upstream type, track the view of the feed being referenced. :type internal_upstream_view_id: str :param location: Locator for connecting to the upstream source. :type location: str :param name: Display name. :type name: str :param protocol: Package type associated with the upstream source. :type protocol: str :param upstream_source_type: Source type, such as Public or Internal. :type upstream_source_type: object """ _attribute_map = { 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'internal_upstream_collection_id': {'key': 'internalUpstreamCollectionId', 'type': 'str'}, 'internal_upstream_feed_id': {'key': 'internalUpstreamFeedId', 'type': 'str'}, 'internal_upstream_view_id': {'key': 'internalUpstreamViewId', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'protocol': {'key': 'protocol', 'type': 'str'}, 'upstream_source_type': {'key': 'upstreamSourceType', 'type': 'object'} } def __init__(self, deleted_date=None, id=None, internal_upstream_collection_id=None, internal_upstream_feed_id=None, internal_upstream_view_id=None, location=None, name=None, protocol=None, upstream_source_type=None): super(UpstreamSource, self).__init__() self.deleted_date = deleted_date self.id = id self.internal_upstream_collection_id = internal_upstream_collection_id self.internal_upstream_feed_id = internal_upstream_feed_id self.internal_upstream_view_id = internal_upstream_view_id self.location = location self.name = name self.protocol = protocol self.upstream_source_type = upstream_source_type class Feed(FeedCore): """Feed. :param allow_upstream_name_conflict: OBSOLETE: If set, the feed will allow upload of packages that exist on the upstream :type allow_upstream_name_conflict: bool :param capabilities: Supported capabilities of a feed. :type capabilities: object :param fully_qualified_id: This will either be the feed GUID or the feed GUID and view GUID depending on how the feed was accessed. :type fully_qualified_id: str :param fully_qualified_name: Full name of the view, in feed@view format. :type fully_qualified_name: str :param id: A GUID that uniquely identifies this feed. :type id: str :param is_read_only: If set, all packages in the feed are immutable. It is important to note that feed views are immutable; therefore, this flag will always be set for views. :type is_read_only: bool :param name: A name for the feed. feed names must follow these rules: Must not exceed 64 characters Must not contain whitespaces Must not start with an underscore or a period Must not end with a period Must not contain any of the following illegal characters: , |, /, \\, ?, :, &, $, *, \", #, [, ] ]]> :type name: str :param upstream_enabled: OBSOLETE: This should always be true. Setting to false will override all sources in UpstreamSources. :type upstream_enabled: bool :param upstream_sources: A list of sources that this feed will fetch packages from. An empty list indicates that this feed will not search any additional sources for packages. :type upstream_sources: list of :class:`UpstreamSource ` :param view: Definition of the view. :type view: :class:`FeedView ` :param view_id: View Id. :type view_id: str :param view_name: View name. :type view_name: str :param _links: Related REST links. :type _links: :class:`ReferenceLinks ` :param badges_enabled: If set, this feed supports generation of package badges. :type badges_enabled: bool :param default_view_id: The view that the feed administrator has indicated is the default experience for readers. :type default_view_id: str :param deleted_date: The date that this feed was deleted. :type deleted_date: datetime :param description: A description for the feed. Descriptions must not exceed 255 characters. :type description: str :param hide_deleted_package_versions: If set, the feed will hide all deleted/unpublished versions :type hide_deleted_package_versions: bool :param permissions: Explicit permissions for the feed. :type permissions: list of :class:`FeedPermission ` :param upstream_enabled_changed_date: If set, time that the UpstreamEnabled property was changed. Will be null if UpstreamEnabled was never changed after Feed creation. :type upstream_enabled_changed_date: datetime :param url: The URL of the base feed in GUID form. :type url: str """ _attribute_map = { 'allow_upstream_name_conflict': {'key': 'allowUpstreamNameConflict', 'type': 'bool'}, 'capabilities': {'key': 'capabilities', 'type': 'object'}, 'fully_qualified_id': {'key': 'fullyQualifiedId', 'type': 'str'}, 'fully_qualified_name': {'key': 'fullyQualifiedName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'upstream_enabled': {'key': 'upstreamEnabled', 'type': 'bool'}, 'upstream_sources': {'key': 'upstreamSources', 'type': '[UpstreamSource]'}, 'view': {'key': 'view', 'type': 'FeedView'}, 'view_id': {'key': 'viewId', 'type': 'str'}, 'view_name': {'key': 'viewName', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'badges_enabled': {'key': 'badgesEnabled', 'type': 'bool'}, 'default_view_id': {'key': 'defaultViewId', 'type': 'str'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'hide_deleted_package_versions': {'key': 'hideDeletedPackageVersions', 'type': 'bool'}, 'permissions': {'key': 'permissions', 'type': '[FeedPermission]'}, 'upstream_enabled_changed_date': {'key': 'upstreamEnabledChangedDate', 'type': 'iso-8601'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, allow_upstream_name_conflict=None, capabilities=None, fully_qualified_id=None, fully_qualified_name=None, id=None, is_read_only=None, name=None, upstream_enabled=None, upstream_sources=None, view=None, view_id=None, view_name=None, _links=None, badges_enabled=None, default_view_id=None, deleted_date=None, description=None, hide_deleted_package_versions=None, permissions=None, upstream_enabled_changed_date=None, url=None): super(Feed, self).__init__(allow_upstream_name_conflict=allow_upstream_name_conflict, capabilities=capabilities, fully_qualified_id=fully_qualified_id, fully_qualified_name=fully_qualified_name, id=id, is_read_only=is_read_only, name=name, upstream_enabled=upstream_enabled, upstream_sources=upstream_sources, view=view, view_id=view_id, view_name=view_name) self._links = _links self.badges_enabled = badges_enabled self.default_view_id = default_view_id self.deleted_date = deleted_date self.description = description self.hide_deleted_package_versions = hide_deleted_package_versions self.permissions = permissions self.upstream_enabled_changed_date = upstream_enabled_changed_date self.url = url __all__ = [ 'FeedBatchData', 'FeedBatchOperationData', 'FeedChange', 'FeedChangesResponse', 'FeedCore', 'FeedPermission', 'FeedRetentionPolicy', 'FeedUpdate', 'FeedView', 'GlobalPermission', 'JsonPatchOperation', 'MinimalPackageVersion', 'Package', 'PackageChange', 'PackageChangesResponse', 'PackageDependency', 'PackageDownloadMetricsQuery', 'PackageFile', 'PackageIdMetrics', 'PackageVersion', 'PackageVersionChange', 'PackageVersionDownloadMetricsQuery', 'PackageVersionMetrics', 'PackageVersionProvenance', 'ProtocolMetadata', 'Provenance', 'RecycleBinPackageVersion', 'ReferenceLinks', 'UpstreamSource', 'Feed', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feed_token/000077500000000000000000000000001360605530400311605ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feed_token/__init__.py000066400000000000000000000012021360605530400332640ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .feed_token_client import FeedTokenClient __all__ = [ 'FeedTokenClient' ] feed_token_client.py000066400000000000000000000041341360605530400351160ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/feed_token# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client class FeedTokenClient(Client): """FeedToken :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(FeedTokenClient, self).__init__(base_url, creds) self._serialize = Serializer() self._deserialize = Deserializer() resource_area_identifier = 'cdeb6c7d-6b25-4d6f-b664-c2e3ede202e8' def get_personal_access_token(self, feed_name=None, token_type=None): """GetPersonalAccessToken. [Preview API] Get a time-limited session token representing the current user, with permissions scoped to the read/write of Artifacts. :param str feed_name: :param str token_type: Type of token to retrieve (e.g. 'SelfDescribing', 'Compact'). :rtype: object """ route_values = {} if feed_name is not None: route_values['feedName'] = self._serialize.url('feed_name', feed_name, 'str') query_parameters = {} if token_type is not None: query_parameters['tokenType'] = self._serialize.query('token_type', token_type, 'str') response = self._send(http_method='GET', location_id='dfdb7ad7-3d8e-4907-911e-19b4a8330550', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/file_container/000077500000000000000000000000001360605530400320365ustar00rootroot00000000000000__init__.py000066400000000000000000000013221360605530400340660ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/file_container# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .file_container_client import FileContainerClient __all__ = [ 'FileContainer', 'FileContainerItem', 'FileContainerClient' ] file_container_client.py000066400000000000000000000150361360605530400366550ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/file_container# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class FileContainerClient(Client): """FileContainer :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(FileContainerClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def create_items(self, items, container_id, scope=None): """CreateItems. [Preview API] Creates the specified items in in the referenced container. :param :class:` ` items: :param int container_id: :param str scope: A guid representing the scope of the container. This is often the project id. :rtype: [FileContainerItem] """ route_values = {} if container_id is not None: route_values['containerId'] = self._serialize.url('container_id', container_id, 'int') query_parameters = {} if scope is not None: query_parameters['scope'] = self._serialize.query('scope', scope, 'str') content = self._serialize.body(items, 'VssJsonCollectionWrapper') response = self._send(http_method='POST', location_id='e4f5c81e-e250-447b-9fef-bd48471bea5e', version='5.0-preview.4', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[FileContainerItem]', self._unwrap_collection(response)) def delete_item(self, container_id, item_path, scope=None): """DeleteItem. [Preview API] Deletes the specified items in a container. :param long container_id: Container Id. :param str item_path: Path to delete. :param str scope: A guid representing the scope of the container. This is often the project id. """ route_values = {} if container_id is not None: route_values['containerId'] = self._serialize.url('container_id', container_id, 'long') query_parameters = {} if item_path is not None: query_parameters['itemPath'] = self._serialize.query('item_path', item_path, 'str') if scope is not None: query_parameters['scope'] = self._serialize.query('scope', scope, 'str') self._send(http_method='DELETE', location_id='e4f5c81e-e250-447b-9fef-bd48471bea5e', version='5.0-preview.4', route_values=route_values, query_parameters=query_parameters) def get_containers(self, scope=None, artifact_uris=None): """GetContainers. [Preview API] Gets containers filtered by a comma separated list of artifact uris within the same scope, if not specified returns all containers :param str scope: A guid representing the scope of the container. This is often the project id. :param str artifact_uris: :rtype: [FileContainer] """ query_parameters = {} if scope is not None: query_parameters['scope'] = self._serialize.query('scope', scope, 'str') if artifact_uris is not None: query_parameters['artifactUris'] = self._serialize.query('artifact_uris', artifact_uris, 'str') response = self._send(http_method='GET', location_id='e4f5c81e-e250-447b-9fef-bd48471bea5e', version='5.0-preview.4', query_parameters=query_parameters) return self._deserialize('[FileContainer]', self._unwrap_collection(response)) def get_items(self, container_id, scope=None, item_path=None, metadata=None, format=None, download_file_name=None, include_download_tickets=None, is_shallow=None): """GetItems. [Preview API] :param long container_id: :param str scope: :param str item_path: :param bool metadata: :param str format: :param str download_file_name: :param bool include_download_tickets: :param bool is_shallow: :rtype: [FileContainerItem] """ route_values = {} if container_id is not None: route_values['containerId'] = self._serialize.url('container_id', container_id, 'long') query_parameters = {} if scope is not None: query_parameters['scope'] = self._serialize.query('scope', scope, 'str') if item_path is not None: query_parameters['itemPath'] = self._serialize.query('item_path', item_path, 'str') if metadata is not None: query_parameters['metadata'] = self._serialize.query('metadata', metadata, 'bool') if format is not None: query_parameters['$format'] = self._serialize.query('format', format, 'str') if download_file_name is not None: query_parameters['downloadFileName'] = self._serialize.query('download_file_name', download_file_name, 'str') if include_download_tickets is not None: query_parameters['includeDownloadTickets'] = self._serialize.query('include_download_tickets', include_download_tickets, 'bool') if is_shallow is not None: query_parameters['isShallow'] = self._serialize.query('is_shallow', is_shallow, 'bool') response = self._send(http_method='GET', location_id='e4f5c81e-e250-447b-9fef-bd48471bea5e', version='5.0-preview.4', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[FileContainerItem]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/file_container/models.py000066400000000000000000000161451360605530400337020ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class FileContainer(Model): """FileContainer. :param artifact_uri: Uri of the artifact associated with the container. :type artifact_uri: str :param content_location: Download Url for the content of this item. :type content_location: str :param created_by: Owner. :type created_by: str :param date_created: Creation date. :type date_created: datetime :param description: Description. :type description: str :param id: Id. :type id: long :param item_location: Location of the item resource. :type item_location: str :param locator_path: ItemStore Locator for this container. :type locator_path: str :param name: Name. :type name: str :param options: Options the container can have. :type options: object :param scope_identifier: Project Id. :type scope_identifier: str :param security_token: Security token of the artifact associated with the container. :type security_token: str :param signing_key_id: Identifier of the optional encryption key. :type signing_key_id: str :param size: Total size of the files in bytes. :type size: long """ _attribute_map = { 'artifact_uri': {'key': 'artifactUri', 'type': 'str'}, 'content_location': {'key': 'contentLocation', 'type': 'str'}, 'created_by': {'key': 'createdBy', 'type': 'str'}, 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'long'}, 'item_location': {'key': 'itemLocation', 'type': 'str'}, 'locator_path': {'key': 'locatorPath', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'options': {'key': 'options', 'type': 'object'}, 'scope_identifier': {'key': 'scopeIdentifier', 'type': 'str'}, 'security_token': {'key': 'securityToken', 'type': 'str'}, 'signing_key_id': {'key': 'signingKeyId', 'type': 'str'}, 'size': {'key': 'size', 'type': 'long'} } def __init__(self, artifact_uri=None, content_location=None, created_by=None, date_created=None, description=None, id=None, item_location=None, locator_path=None, name=None, options=None, scope_identifier=None, security_token=None, signing_key_id=None, size=None): super(FileContainer, self).__init__() self.artifact_uri = artifact_uri self.content_location = content_location self.created_by = created_by self.date_created = date_created self.description = description self.id = id self.item_location = item_location self.locator_path = locator_path self.name = name self.options = options self.scope_identifier = scope_identifier self.security_token = security_token self.signing_key_id = signing_key_id self.size = size class FileContainerItem(Model): """FileContainerItem. :param container_id: Container Id. :type container_id: long :param content_id: :type content_id: str :param content_location: Download Url for the content of this item. :type content_location: str :param created_by: Creator. :type created_by: str :param date_created: Creation date. :type date_created: datetime :param date_last_modified: Last modified date. :type date_last_modified: datetime :param file_encoding: Encoding of the file. Zero if not a file. :type file_encoding: int :param file_hash: Hash value of the file. Null if not a file. :type file_hash: str :param file_id: Id of the file content. :type file_id: int :param file_length: Length of the file. Zero if not of a file. :type file_length: long :param file_type: Type of the file. Zero if not a file. :type file_type: int :param item_location: Location of the item resource. :type item_location: str :param item_type: Type of the item: Folder, File or String. :type item_type: object :param last_modified_by: Modifier. :type last_modified_by: str :param path: Unique path that identifies the item. :type path: str :param scope_identifier: Project Id. :type scope_identifier: str :param status: Status of the item: Created or Pending Upload. :type status: object :param ticket: :type ticket: str """ _attribute_map = { 'container_id': {'key': 'containerId', 'type': 'long'}, 'content_id': {'key': 'contentId', 'type': 'str'}, 'content_location': {'key': 'contentLocation', 'type': 'str'}, 'created_by': {'key': 'createdBy', 'type': 'str'}, 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, 'date_last_modified': {'key': 'dateLastModified', 'type': 'iso-8601'}, 'file_encoding': {'key': 'fileEncoding', 'type': 'int'}, 'file_hash': {'key': 'fileHash', 'type': 'str'}, 'file_id': {'key': 'fileId', 'type': 'int'}, 'file_length': {'key': 'fileLength', 'type': 'long'}, 'file_type': {'key': 'fileType', 'type': 'int'}, 'item_location': {'key': 'itemLocation', 'type': 'str'}, 'item_type': {'key': 'itemType', 'type': 'object'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'scope_identifier': {'key': 'scopeIdentifier', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'ticket': {'key': 'ticket', 'type': 'str'} } def __init__(self, container_id=None, content_id=None, content_location=None, created_by=None, date_created=None, date_last_modified=None, file_encoding=None, file_hash=None, file_id=None, file_length=None, file_type=None, item_location=None, item_type=None, last_modified_by=None, path=None, scope_identifier=None, status=None, ticket=None): super(FileContainerItem, self).__init__() self.container_id = container_id self.content_id = content_id self.content_location = content_location self.created_by = created_by self.date_created = date_created self.date_last_modified = date_last_modified self.file_encoding = file_encoding self.file_hash = file_hash self.file_id = file_id self.file_length = file_length self.file_type = file_type self.item_location = item_location self.item_type = item_type self.last_modified_by = last_modified_by self.path = path self.scope_identifier = scope_identifier self.status = status self.ticket = ticket __all__ = [ 'FileContainer', 'FileContainerItem', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/gallery/000077500000000000000000000000001360605530400305145ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/gallery/__init__.py000066400000000000000000000040121360605530400326220ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .gallery_client import GalleryClient __all__ = [ 'AcquisitionOperation', 'AcquisitionOptions', 'Answers', 'AssetDetails', 'AzurePublisher', 'AzureRestApiRequestModel', 'CategoriesResult', 'CategoryLanguageTitle', 'Concern', 'EventCounts', 'ExtensionAcquisitionRequest', 'ExtensionBadge', 'ExtensionCategory', 'ExtensionDailyStat', 'ExtensionDailyStats', 'ExtensionDraft', 'ExtensionDraftAsset', 'ExtensionDraftPatch', 'ExtensionEvent', 'ExtensionEvents', 'ExtensionFile', 'ExtensionFilterResult', 'ExtensionFilterResultMetadata', 'ExtensionPackage', 'ExtensionPayload', 'ExtensionQuery', 'ExtensionQueryResult', 'ExtensionShare', 'ExtensionStatistic', 'ExtensionStatisticUpdate', 'ExtensionVersion', 'FilterCriteria', 'InstallationTarget', 'MetadataItem', 'NotificationsData', 'ProductCategoriesResult', 'ProductCategory', 'PublishedExtension', 'Publisher', 'PublisherBase', 'PublisherFacts', 'PublisherFilterResult', 'PublisherQuery', 'PublisherQueryResult', 'QnAItem', 'QueryFilter', 'Question', 'QuestionsResult', 'RatingCountPerRating', 'ReferenceLinks', 'Response', 'Review', 'ReviewPatch', 'ReviewReply', 'ReviewsResult', 'ReviewSummary', 'UnpackagedExtensionData', 'UserIdentityRef', 'UserReportedConcern', 'GalleryClient' ] gallery_client.py000066400000000000000000002767661360605530400340340ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/gallery# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class GalleryClient(Client): """Gallery :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(GalleryClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '69d21c00-f135-441b-b5ce-3626378e0819' def share_extension_by_id(self, extension_id, account_name): """ShareExtensionById. [Preview API] :param str extension_id: :param str account_name: """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') if account_name is not None: route_values['accountName'] = self._serialize.url('account_name', account_name, 'str') self._send(http_method='POST', location_id='1f19631b-a0b4-4a03-89c2-d79785d24360', version='5.0-preview.1', route_values=route_values) def unshare_extension_by_id(self, extension_id, account_name): """UnshareExtensionById. [Preview API] :param str extension_id: :param str account_name: """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') if account_name is not None: route_values['accountName'] = self._serialize.url('account_name', account_name, 'str') self._send(http_method='DELETE', location_id='1f19631b-a0b4-4a03-89c2-d79785d24360', version='5.0-preview.1', route_values=route_values) def share_extension(self, publisher_name, extension_name, account_name): """ShareExtension. [Preview API] :param str publisher_name: :param str extension_name: :param str account_name: """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if account_name is not None: route_values['accountName'] = self._serialize.url('account_name', account_name, 'str') self._send(http_method='POST', location_id='a1e66d8f-f5de-4d16-8309-91a4e015ee46', version='5.0-preview.1', route_values=route_values) def unshare_extension(self, publisher_name, extension_name, account_name): """UnshareExtension. [Preview API] :param str publisher_name: :param str extension_name: :param str account_name: """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if account_name is not None: route_values['accountName'] = self._serialize.url('account_name', account_name, 'str') self._send(http_method='DELETE', location_id='a1e66d8f-f5de-4d16-8309-91a4e015ee46', version='5.0-preview.1', route_values=route_values) def get_acquisition_options(self, item_id, installation_target, test_commerce=None, is_free_or_trial_install=None): """GetAcquisitionOptions. [Preview API] :param str item_id: :param str installation_target: :param bool test_commerce: :param bool is_free_or_trial_install: :rtype: :class:` ` """ route_values = {} if item_id is not None: route_values['itemId'] = self._serialize.url('item_id', item_id, 'str') query_parameters = {} if installation_target is not None: query_parameters['installationTarget'] = self._serialize.query('installation_target', installation_target, 'str') if test_commerce is not None: query_parameters['testCommerce'] = self._serialize.query('test_commerce', test_commerce, 'bool') if is_free_or_trial_install is not None: query_parameters['isFreeOrTrialInstall'] = self._serialize.query('is_free_or_trial_install', is_free_or_trial_install, 'bool') response = self._send(http_method='GET', location_id='9d0a0105-075e-4760-aa15-8bcf54d1bd7d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('AcquisitionOptions', response) def request_acquisition(self, acquisition_request): """RequestAcquisition. [Preview API] :param :class:` ` acquisition_request: :rtype: :class:` ` """ content = self._serialize.body(acquisition_request, 'ExtensionAcquisitionRequest') response = self._send(http_method='POST', location_id='3adb1f2d-e328-446e-be73-9f6d98071c45', version='5.0-preview.1', content=content) return self._deserialize('ExtensionAcquisitionRequest', response) def get_asset_by_name(self, publisher_name, extension_name, version, asset_type, account_token=None, accept_default=None, account_token_header=None, **kwargs): """GetAssetByName. [Preview API] :param str publisher_name: :param str extension_name: :param str version: :param str asset_type: :param str account_token: :param bool accept_default: :param String account_token_header: Header to pass the account token :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') if asset_type is not None: route_values['assetType'] = self._serialize.url('asset_type', asset_type, 'str') query_parameters = {} if account_token is not None: query_parameters['accountToken'] = self._serialize.query('account_token', account_token, 'str') if accept_default is not None: query_parameters['acceptDefault'] = self._serialize.query('accept_default', accept_default, 'bool') additional_headers = {} if account_token_header is not None: additional_headers['X-Market-AccountToken'] = account_token_header response = self._send(http_method='GET', location_id='7529171f-a002-4180-93ba-685f358a0482', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_asset(self, extension_id, version, asset_type, account_token=None, accept_default=None, account_token_header=None, **kwargs): """GetAsset. [Preview API] :param str extension_id: :param str version: :param str asset_type: :param str account_token: :param bool accept_default: :param String account_token_header: Header to pass the account token :rtype: object """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') if asset_type is not None: route_values['assetType'] = self._serialize.url('asset_type', asset_type, 'str') query_parameters = {} if account_token is not None: query_parameters['accountToken'] = self._serialize.query('account_token', account_token, 'str') if accept_default is not None: query_parameters['acceptDefault'] = self._serialize.query('accept_default', accept_default, 'bool') additional_headers = {} if account_token_header is not None: additional_headers['X-Market-AccountToken'] = account_token_header response = self._send(http_method='GET', location_id='5d545f3d-ef47-488b-8be3-f5ee1517856c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_asset_authenticated(self, publisher_name, extension_name, version, asset_type, account_token=None, account_token_header=None, **kwargs): """GetAssetAuthenticated. [Preview API] :param str publisher_name: :param str extension_name: :param str version: :param str asset_type: :param str account_token: :param String account_token_header: Header to pass the account token :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') if asset_type is not None: route_values['assetType'] = self._serialize.url('asset_type', asset_type, 'str') query_parameters = {} if account_token is not None: query_parameters['accountToken'] = self._serialize.query('account_token', account_token, 'str') additional_headers = {} if account_token_header is not None: additional_headers['X-Market-AccountToken'] = account_token_header response = self._send(http_method='GET', location_id='506aff36-2622-4f70-8063-77cce6366d20', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def associate_azure_publisher(self, publisher_name, azure_publisher_id): """AssociateAzurePublisher. [Preview API] :param str publisher_name: :param str azure_publisher_id: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') query_parameters = {} if azure_publisher_id is not None: query_parameters['azurePublisherId'] = self._serialize.query('azure_publisher_id', azure_publisher_id, 'str') response = self._send(http_method='PUT', location_id='efd202a6-9d87-4ebc-9229-d2b8ae2fdb6d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('AzurePublisher', response) def query_associated_azure_publisher(self, publisher_name): """QueryAssociatedAzurePublisher. [Preview API] :param str publisher_name: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') response = self._send(http_method='GET', location_id='efd202a6-9d87-4ebc-9229-d2b8ae2fdb6d', version='5.0-preview.1', route_values=route_values) return self._deserialize('AzurePublisher', response) def get_categories(self, languages=None): """GetCategories. [Preview API] :param str languages: :rtype: [str] """ query_parameters = {} if languages is not None: query_parameters['languages'] = self._serialize.query('languages', languages, 'str') response = self._send(http_method='GET', location_id='e0a5a71e-3ac3-43a0-ae7d-0bb5c3046a2a', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def get_category_details(self, category_name, languages=None, product=None): """GetCategoryDetails. [Preview API] :param str category_name: :param str languages: :param str product: :rtype: :class:` ` """ route_values = {} if category_name is not None: route_values['categoryName'] = self._serialize.url('category_name', category_name, 'str') query_parameters = {} if languages is not None: query_parameters['languages'] = self._serialize.query('languages', languages, 'str') if product is not None: query_parameters['product'] = self._serialize.query('product', product, 'str') response = self._send(http_method='GET', location_id='75d3c04d-84d2-4973-acd2-22627587dabc', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('CategoriesResult', response) def get_category_tree(self, product, category_id, lcid=None, source=None, product_version=None, skus=None, sub_skus=None): """GetCategoryTree. [Preview API] :param str product: :param str category_id: :param int lcid: :param str source: :param str product_version: :param str skus: :param str sub_skus: :rtype: :class:` ` """ route_values = {} if product is not None: route_values['product'] = self._serialize.url('product', product, 'str') if category_id is not None: route_values['categoryId'] = self._serialize.url('category_id', category_id, 'str') query_parameters = {} if lcid is not None: query_parameters['lcid'] = self._serialize.query('lcid', lcid, 'int') if source is not None: query_parameters['source'] = self._serialize.query('source', source, 'str') if product_version is not None: query_parameters['productVersion'] = self._serialize.query('product_version', product_version, 'str') if skus is not None: query_parameters['skus'] = self._serialize.query('skus', skus, 'str') if sub_skus is not None: query_parameters['subSkus'] = self._serialize.query('sub_skus', sub_skus, 'str') response = self._send(http_method='GET', location_id='1102bb42-82b0-4955-8d8a-435d6b4cedd3', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ProductCategory', response) def get_root_categories(self, product, lcid=None, source=None, product_version=None, skus=None, sub_skus=None): """GetRootCategories. [Preview API] :param str product: :param int lcid: :param str source: :param str product_version: :param str skus: :param str sub_skus: :rtype: :class:` ` """ route_values = {} if product is not None: route_values['product'] = self._serialize.url('product', product, 'str') query_parameters = {} if lcid is not None: query_parameters['lcid'] = self._serialize.query('lcid', lcid, 'int') if source is not None: query_parameters['source'] = self._serialize.query('source', source, 'str') if product_version is not None: query_parameters['productVersion'] = self._serialize.query('product_version', product_version, 'str') if skus is not None: query_parameters['skus'] = self._serialize.query('skus', skus, 'str') if sub_skus is not None: query_parameters['subSkus'] = self._serialize.query('sub_skus', sub_skus, 'str') response = self._send(http_method='GET', location_id='31fba831-35b2-46f6-a641-d05de5a877d8', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ProductCategoriesResult', response) def get_certificate(self, publisher_name, extension_name, version=None, **kwargs): """GetCertificate. [Preview API] :param str publisher_name: :param str extension_name: :param str version: :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') response = self._send(http_method='GET', location_id='e905ad6a-3f1f-4d08-9f6d-7d357ff8b7d0', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_content_verification_log(self, publisher_name, extension_name, **kwargs): """GetContentVerificationLog. [Preview API] :param str publisher_name: :param str extension_name: :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') response = self._send(http_method='GET', location_id='c0f1c7c4-3557-4ffb-b774-1e48c4865e99', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def create_draft_for_edit_extension(self, publisher_name, extension_name): """CreateDraftForEditExtension. [Preview API] :param str publisher_name: :param str extension_name: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') response = self._send(http_method='POST', location_id='02b33873-4e61-496e-83a2-59d1df46b7d8', version='5.0-preview.1', route_values=route_values) return self._deserialize('ExtensionDraft', response) def perform_edit_extension_draft_operation(self, draft_patch, publisher_name, extension_name, draft_id): """PerformEditExtensionDraftOperation. [Preview API] :param :class:` ` draft_patch: :param str publisher_name: :param str extension_name: :param str draft_id: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if draft_id is not None: route_values['draftId'] = self._serialize.url('draft_id', draft_id, 'str') content = self._serialize.body(draft_patch, 'ExtensionDraftPatch') response = self._send(http_method='PATCH', location_id='02b33873-4e61-496e-83a2-59d1df46b7d8', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('ExtensionDraft', response) def update_payload_in_draft_for_edit_extension(self, upload_stream, publisher_name, extension_name, draft_id, file_name=None, **kwargs): """UpdatePayloadInDraftForEditExtension. [Preview API] :param object upload_stream: Stream to upload :param str publisher_name: :param str extension_name: :param str draft_id: :param String file_name: Header to pass the filename of the uploaded data :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if draft_id is not None: route_values['draftId'] = self._serialize.url('draft_id', draft_id, 'str') additional_headers = {} if file_name is not None: additional_headers['X-Market-UploadFileName'] = file_name if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='02b33873-4e61-496e-83a2-59d1df46b7d8', version='5.0-preview.1', route_values=route_values, additional_headers=additional_headers, content=content, media_type='application/octet-stream') return self._deserialize('ExtensionDraft', response) def add_asset_for_edit_extension_draft(self, upload_stream, publisher_name, extension_name, draft_id, asset_type, **kwargs): """AddAssetForEditExtensionDraft. [Preview API] :param object upload_stream: Stream to upload :param str publisher_name: :param str extension_name: :param str draft_id: :param str asset_type: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if draft_id is not None: route_values['draftId'] = self._serialize.url('draft_id', draft_id, 'str') if asset_type is not None: route_values['assetType'] = self._serialize.url('asset_type', asset_type, 'str') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='f1db9c47-6619-4998-a7e5-d7f9f41a4617', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/octet-stream') return self._deserialize('ExtensionDraftAsset', response) def create_draft_for_new_extension(self, upload_stream, publisher_name, product, file_name=None, **kwargs): """CreateDraftForNewExtension. [Preview API] :param object upload_stream: Stream to upload :param str publisher_name: :param String product: Header to pass the product type of the payload file :param String file_name: Header to pass the filename of the uploaded data :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') additional_headers = {} if product is not None: additional_headers['X-Market-UploadFileProduct'] = product if file_name is not None: additional_headers['X-Market-UploadFileName'] = file_name if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='b3ab127d-ebb9-4d22-b611-4e09593c8d79', version='5.0-preview.1', route_values=route_values, additional_headers=additional_headers, content=content, media_type='application/octet-stream') return self._deserialize('ExtensionDraft', response) def perform_new_extension_draft_operation(self, draft_patch, publisher_name, draft_id): """PerformNewExtensionDraftOperation. [Preview API] :param :class:` ` draft_patch: :param str publisher_name: :param str draft_id: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if draft_id is not None: route_values['draftId'] = self._serialize.url('draft_id', draft_id, 'str') content = self._serialize.body(draft_patch, 'ExtensionDraftPatch') response = self._send(http_method='PATCH', location_id='b3ab127d-ebb9-4d22-b611-4e09593c8d79', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('ExtensionDraft', response) def update_payload_in_draft_for_new_extension(self, upload_stream, publisher_name, draft_id, file_name=None, **kwargs): """UpdatePayloadInDraftForNewExtension. [Preview API] :param object upload_stream: Stream to upload :param str publisher_name: :param str draft_id: :param String file_name: Header to pass the filename of the uploaded data :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if draft_id is not None: route_values['draftId'] = self._serialize.url('draft_id', draft_id, 'str') additional_headers = {} if file_name is not None: additional_headers['X-Market-UploadFileName'] = file_name if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='b3ab127d-ebb9-4d22-b611-4e09593c8d79', version='5.0-preview.1', route_values=route_values, additional_headers=additional_headers, content=content, media_type='application/octet-stream') return self._deserialize('ExtensionDraft', response) def add_asset_for_new_extension_draft(self, upload_stream, publisher_name, draft_id, asset_type, **kwargs): """AddAssetForNewExtensionDraft. [Preview API] :param object upload_stream: Stream to upload :param str publisher_name: :param str draft_id: :param str asset_type: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if draft_id is not None: route_values['draftId'] = self._serialize.url('draft_id', draft_id, 'str') if asset_type is not None: route_values['assetType'] = self._serialize.url('asset_type', asset_type, 'str') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/octet-stream') return self._deserialize('ExtensionDraftAsset', response) def get_asset_from_edit_extension_draft(self, publisher_name, draft_id, asset_type, extension_name, **kwargs): """GetAssetFromEditExtensionDraft. [Preview API] :param str publisher_name: :param str draft_id: :param str asset_type: :param str extension_name: :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if draft_id is not None: route_values['draftId'] = self._serialize.url('draft_id', draft_id, 'str') if asset_type is not None: route_values['assetType'] = self._serialize.url('asset_type', asset_type, 'str') query_parameters = {} if extension_name is not None: query_parameters['extensionName'] = self._serialize.query('extension_name', extension_name, 'str') response = self._send(http_method='GET', location_id='88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_asset_from_new_extension_draft(self, publisher_name, draft_id, asset_type, **kwargs): """GetAssetFromNewExtensionDraft. [Preview API] :param str publisher_name: :param str draft_id: :param str asset_type: :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if draft_id is not None: route_values['draftId'] = self._serialize.url('draft_id', draft_id, 'str') if asset_type is not None: route_values['assetType'] = self._serialize.url('asset_type', asset_type, 'str') response = self._send(http_method='GET', location_id='88c0b1c8-b4f1-498a-9b2a-8446ef9f32e7', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_extension_events(self, publisher_name, extension_name, count=None, after_date=None, include=None, include_property=None): """GetExtensionEvents. [Preview API] Get install/uninstall events of an extension. If both count and afterDate parameters are specified, count takes precedence. :param str publisher_name: Name of the publisher :param str extension_name: Name of the extension :param int count: Count of events to fetch, applies to each event type. :param datetime after_date: Fetch events that occurred on or after this date :param str include: Filter options. Supported values: install, uninstall, review, acquisition, sales. Default is to fetch all types of events :param str include_property: Event properties to include. Currently only 'lastContactDetails' is supported for uninstall events :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if count is not None: query_parameters['count'] = self._serialize.query('count', count, 'int') if after_date is not None: query_parameters['afterDate'] = self._serialize.query('after_date', after_date, 'iso-8601') if include is not None: query_parameters['include'] = self._serialize.query('include', include, 'str') if include_property is not None: query_parameters['includeProperty'] = self._serialize.query('include_property', include_property, 'str') response = self._send(http_method='GET', location_id='3d13c499-2168-4d06-bef4-14aba185dcd5', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ExtensionEvents', response) def publish_extension_events(self, extension_events): """PublishExtensionEvents. [Preview API] API endpoint to publish extension install/uninstall events. This is meant to be invoked by EMS only for sending us data related to install/uninstall of an extension. :param [ExtensionEvents] extension_events: """ content = self._serialize.body(extension_events, '[ExtensionEvents]') self._send(http_method='POST', location_id='0bf2bd3a-70e0-4d5d-8bf7-bd4a9c2ab6e7', version='5.0-preview.1', content=content) def query_extensions(self, extension_query, account_token=None, account_token_header=None): """QueryExtensions. [Preview API] :param :class:` ` extension_query: :param str account_token: :param String account_token_header: Header to pass the account token :rtype: :class:` ` """ query_parameters = {} if account_token is not None: query_parameters['accountToken'] = self._serialize.query('account_token', account_token, 'str') additional_headers = {} if account_token_header is not None: additional_headers['X-Market-AccountToken'] = account_token_header content = self._serialize.body(extension_query, 'ExtensionQuery') response = self._send(http_method='POST', location_id='eb9d5ee1-6d43-456b-b80e-8a96fbc014b6', version='5.0-preview.1', query_parameters=query_parameters, additional_headers=additional_headers, content=content) return self._deserialize('ExtensionQueryResult', response) def create_extension(self, upload_stream, **kwargs): """CreateExtension. [Preview API] :param object upload_stream: Stream to upload :rtype: :class:` ` """ if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='a41192c8-9525-4b58-bc86-179fa549d80d', version='5.0-preview.2', content=content, media_type='application/octet-stream') return self._deserialize('PublishedExtension', response) def delete_extension_by_id(self, extension_id, version=None): """DeleteExtensionById. [Preview API] :param str extension_id: :param str version: """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') query_parameters = {} if version is not None: query_parameters['version'] = self._serialize.query('version', version, 'str') self._send(http_method='DELETE', location_id='a41192c8-9525-4b58-bc86-179fa549d80d', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) def get_extension_by_id(self, extension_id, version=None, flags=None): """GetExtensionById. [Preview API] :param str extension_id: :param str version: :param str flags: :rtype: :class:` ` """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') query_parameters = {} if version is not None: query_parameters['version'] = self._serialize.query('version', version, 'str') if flags is not None: query_parameters['flags'] = self._serialize.query('flags', flags, 'str') response = self._send(http_method='GET', location_id='a41192c8-9525-4b58-bc86-179fa549d80d', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PublishedExtension', response) def update_extension_by_id(self, extension_id): """UpdateExtensionById. [Preview API] :param str extension_id: :rtype: :class:` ` """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') response = self._send(http_method='PUT', location_id='a41192c8-9525-4b58-bc86-179fa549d80d', version='5.0-preview.2', route_values=route_values) return self._deserialize('PublishedExtension', response) def create_extension_with_publisher(self, upload_stream, publisher_name, **kwargs): """CreateExtensionWithPublisher. [Preview API] :param object upload_stream: Stream to upload :param str publisher_name: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='e11ea35a-16fe-4b80-ab11-c4cab88a0966', version='5.0-preview.2', route_values=route_values, content=content, media_type='application/octet-stream') return self._deserialize('PublishedExtension', response) def delete_extension(self, publisher_name, extension_name, version=None): """DeleteExtension. [Preview API] :param str publisher_name: :param str extension_name: :param str version: """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if version is not None: query_parameters['version'] = self._serialize.query('version', version, 'str') self._send(http_method='DELETE', location_id='e11ea35a-16fe-4b80-ab11-c4cab88a0966', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) def get_extension(self, publisher_name, extension_name, version=None, flags=None, account_token=None, account_token_header=None): """GetExtension. [Preview API] :param str publisher_name: :param str extension_name: :param str version: :param str flags: :param str account_token: :param String account_token_header: Header to pass the account token :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if version is not None: query_parameters['version'] = self._serialize.query('version', version, 'str') if flags is not None: query_parameters['flags'] = self._serialize.query('flags', flags, 'str') if account_token is not None: query_parameters['accountToken'] = self._serialize.query('account_token', account_token, 'str') additional_headers = {} if account_token_header is not None: additional_headers['X-Market-AccountToken'] = account_token_header response = self._send(http_method='GET', location_id='e11ea35a-16fe-4b80-ab11-c4cab88a0966', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers) return self._deserialize('PublishedExtension', response) def update_extension(self, upload_stream, publisher_name, extension_name, bypass_scope_check=None, **kwargs): """UpdateExtension. [Preview API] REST endpoint to update an extension. :param object upload_stream: Stream to upload :param str publisher_name: Name of the publisher :param str extension_name: Name of the extension :param bool bypass_scope_check: This parameter decides if the scope change check needs to be invoked or not :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if bypass_scope_check is not None: query_parameters['bypassScopeCheck'] = self._serialize.query('bypass_scope_check', bypass_scope_check, 'bool') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='e11ea35a-16fe-4b80-ab11-c4cab88a0966', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/octet-stream') return self._deserialize('PublishedExtension', response) def update_extension_properties(self, publisher_name, extension_name, flags): """UpdateExtensionProperties. [Preview API] :param str publisher_name: :param str extension_name: :param str flags: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if flags is not None: query_parameters['flags'] = self._serialize.query('flags', flags, 'str') response = self._send(http_method='PATCH', location_id='e11ea35a-16fe-4b80-ab11-c4cab88a0966', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PublishedExtension', response) def share_extension_with_host(self, publisher_name, extension_name, host_type, host_name): """ShareExtensionWithHost. [Preview API] :param str publisher_name: :param str extension_name: :param str host_type: :param str host_name: """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if host_type is not None: route_values['hostType'] = self._serialize.url('host_type', host_type, 'str') if host_name is not None: route_values['hostName'] = self._serialize.url('host_name', host_name, 'str') self._send(http_method='POST', location_id='328a3af8-d124-46e9-9483-01690cd415b9', version='5.0-preview.1', route_values=route_values) def unshare_extension_with_host(self, publisher_name, extension_name, host_type, host_name): """UnshareExtensionWithHost. [Preview API] :param str publisher_name: :param str extension_name: :param str host_type: :param str host_name: """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if host_type is not None: route_values['hostType'] = self._serialize.url('host_type', host_type, 'str') if host_name is not None: route_values['hostName'] = self._serialize.url('host_name', host_name, 'str') self._send(http_method='DELETE', location_id='328a3af8-d124-46e9-9483-01690cd415b9', version='5.0-preview.1', route_values=route_values) def extension_validator(self, azure_rest_api_request_model): """ExtensionValidator. [Preview API] :param :class:` ` azure_rest_api_request_model: """ content = self._serialize.body(azure_rest_api_request_model, 'AzureRestApiRequestModel') self._send(http_method='POST', location_id='05e8a5e1-8c59-4c2c-8856-0ff087d1a844', version='5.0-preview.1', content=content) def send_notifications(self, notification_data): """SendNotifications. [Preview API] Send Notification :param :class:` ` notification_data: Denoting the data needed to send notification """ content = self._serialize.body(notification_data, 'NotificationsData') self._send(http_method='POST', location_id='eab39817-413c-4602-a49f-07ad00844980', version='5.0-preview.1', content=content) def get_package(self, publisher_name, extension_name, version, account_token=None, accept_default=None, account_token_header=None, **kwargs): """GetPackage. [Preview API] This endpoint gets hit when you download a VSTS extension from the Web UI :param str publisher_name: :param str extension_name: :param str version: :param str account_token: :param bool accept_default: :param String account_token_header: Header to pass the account token :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') query_parameters = {} if account_token is not None: query_parameters['accountToken'] = self._serialize.query('account_token', account_token, 'str') if accept_default is not None: query_parameters['acceptDefault'] = self._serialize.query('accept_default', accept_default, 'bool') additional_headers = {} if account_token_header is not None: additional_headers['X-Market-AccountToken'] = account_token_header response = self._send(http_method='GET', location_id='7cb576f8-1cae-4c4b-b7b1-e4af5759e965', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_asset_with_token(self, publisher_name, extension_name, version, asset_type, asset_token=None, account_token=None, accept_default=None, account_token_header=None, **kwargs): """GetAssetWithToken. [Preview API] :param str publisher_name: :param str extension_name: :param str version: :param str asset_type: :param str asset_token: :param str account_token: :param bool accept_default: :param String account_token_header: Header to pass the account token :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') if asset_type is not None: route_values['assetType'] = self._serialize.url('asset_type', asset_type, 'str') if asset_token is not None: route_values['assetToken'] = self._serialize.url('asset_token', asset_token, 'str') query_parameters = {} if account_token is not None: query_parameters['accountToken'] = self._serialize.query('account_token', account_token, 'str') if accept_default is not None: query_parameters['acceptDefault'] = self._serialize.query('accept_default', accept_default, 'bool') additional_headers = {} if account_token_header is not None: additional_headers['X-Market-AccountToken'] = account_token_header response = self._send(http_method='GET', location_id='364415a1-0077-4a41-a7a0-06edd4497492', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def delete_publisher_asset(self, publisher_name, asset_type=None): """DeletePublisherAsset. [Preview API] Delete publisher asset like logo :param str publisher_name: Internal name of the publisher :param str asset_type: Type of asset. Default value is 'logo'. """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') query_parameters = {} if asset_type is not None: query_parameters['assetType'] = self._serialize.query('asset_type', asset_type, 'str') self._send(http_method='DELETE', location_id='21143299-34f9-4c62-8ca8-53da691192f9', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) def get_publisher_asset(self, publisher_name, asset_type=None, **kwargs): """GetPublisherAsset. [Preview API] Get publisher asset like logo as a stream :param str publisher_name: Internal name of the publisher :param str asset_type: Type of asset. Default value is 'logo'. :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') query_parameters = {} if asset_type is not None: query_parameters['assetType'] = self._serialize.query('asset_type', asset_type, 'str') response = self._send(http_method='GET', location_id='21143299-34f9-4c62-8ca8-53da691192f9', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def update_publisher_asset(self, upload_stream, publisher_name, asset_type=None, file_name=None, **kwargs): """UpdatePublisherAsset. [Preview API] Update publisher asset like logo. It accepts asset file as an octet stream and file name is passed in header values. :param object upload_stream: Stream to upload :param str publisher_name: Internal name of the publisher :param str asset_type: Type of asset. Default value is 'logo'. :param String file_name: Header to pass the filename of the uploaded data :rtype: {str} """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') query_parameters = {} if asset_type is not None: query_parameters['assetType'] = self._serialize.query('asset_type', asset_type, 'str') additional_headers = {} if file_name is not None: additional_headers['X-Market-UploadFileName'] = file_name if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='21143299-34f9-4c62-8ca8-53da691192f9', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers, content=content, media_type='application/octet-stream') return self._deserialize('{str}', self._unwrap_collection(response)) def query_publishers(self, publisher_query): """QueryPublishers. [Preview API] :param :class:` ` publisher_query: :rtype: :class:` ` """ content = self._serialize.body(publisher_query, 'PublisherQuery') response = self._send(http_method='POST', location_id='2ad6ee0a-b53f-4034-9d1d-d009fda1212e', version='5.0-preview.1', content=content) return self._deserialize('PublisherQueryResult', response) def create_publisher(self, publisher): """CreatePublisher. [Preview API] :param :class:` ` publisher: :rtype: :class:` ` """ content = self._serialize.body(publisher, 'Publisher') response = self._send(http_method='POST', location_id='4ddec66a-e4f6-4f5d-999e-9e77710d7ff4', version='5.0-preview.1', content=content) return self._deserialize('Publisher', response) def delete_publisher(self, publisher_name): """DeletePublisher. [Preview API] :param str publisher_name: """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') self._send(http_method='DELETE', location_id='4ddec66a-e4f6-4f5d-999e-9e77710d7ff4', version='5.0-preview.1', route_values=route_values) def get_publisher(self, publisher_name, flags=None): """GetPublisher. [Preview API] :param str publisher_name: :param int flags: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') query_parameters = {} if flags is not None: query_parameters['flags'] = self._serialize.query('flags', flags, 'int') response = self._send(http_method='GET', location_id='4ddec66a-e4f6-4f5d-999e-9e77710d7ff4', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Publisher', response) def update_publisher(self, publisher, publisher_name): """UpdatePublisher. [Preview API] :param :class:` ` publisher: :param str publisher_name: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') content = self._serialize.body(publisher, 'Publisher') response = self._send(http_method='PUT', location_id='4ddec66a-e4f6-4f5d-999e-9e77710d7ff4', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Publisher', response) def get_questions(self, publisher_name, extension_name, count=None, page=None, after_date=None): """GetQuestions. [Preview API] Returns a list of questions with their responses associated with an extension. :param str publisher_name: Name of the publisher who published the extension. :param str extension_name: Name of the extension. :param int count: Number of questions to retrieve (defaults to 10). :param int page: Page number from which set of questions are to be retrieved. :param datetime after_date: If provided, results questions are returned which were posted after this date :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if count is not None: query_parameters['count'] = self._serialize.query('count', count, 'int') if page is not None: query_parameters['page'] = self._serialize.query('page', page, 'int') if after_date is not None: query_parameters['afterDate'] = self._serialize.query('after_date', after_date, 'iso-8601') response = self._send(http_method='GET', location_id='c010d03d-812c-4ade-ae07-c1862475eda5', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('QuestionsResult', response) def report_question(self, concern, pub_name, ext_name, question_id): """ReportQuestion. [Preview API] Flags a concern with an existing question for an extension. :param :class:` ` concern: User reported concern with a question for the extension. :param str pub_name: Name of the publisher who published the extension. :param str ext_name: Name of the extension. :param long question_id: Identifier of the question to be updated for the extension. :rtype: :class:` ` """ route_values = {} if pub_name is not None: route_values['pubName'] = self._serialize.url('pub_name', pub_name, 'str') if ext_name is not None: route_values['extName'] = self._serialize.url('ext_name', ext_name, 'str') if question_id is not None: route_values['questionId'] = self._serialize.url('question_id', question_id, 'long') content = self._serialize.body(concern, 'Concern') response = self._send(http_method='POST', location_id='784910cd-254a-494d-898b-0728549b2f10', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Concern', response) def create_question(self, question, publisher_name, extension_name): """CreateQuestion. [Preview API] Creates a new question for an extension. :param :class:` ` question: Question to be created for the extension. :param str publisher_name: Name of the publisher who published the extension. :param str extension_name: Name of the extension. :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') content = self._serialize.body(question, 'Question') response = self._send(http_method='POST', location_id='6d1d9741-eca8-4701-a3a5-235afc82dfa4', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Question', response) def delete_question(self, publisher_name, extension_name, question_id): """DeleteQuestion. [Preview API] Deletes an existing question and all its associated responses for an extension. (soft delete) :param str publisher_name: Name of the publisher who published the extension. :param str extension_name: Name of the extension. :param long question_id: Identifier of the question to be deleted for the extension. """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if question_id is not None: route_values['questionId'] = self._serialize.url('question_id', question_id, 'long') self._send(http_method='DELETE', location_id='6d1d9741-eca8-4701-a3a5-235afc82dfa4', version='5.0-preview.1', route_values=route_values) def update_question(self, question, publisher_name, extension_name, question_id): """UpdateQuestion. [Preview API] Updates an existing question for an extension. :param :class:` ` question: Updated question to be set for the extension. :param str publisher_name: Name of the publisher who published the extension. :param str extension_name: Name of the extension. :param long question_id: Identifier of the question to be updated for the extension. :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if question_id is not None: route_values['questionId'] = self._serialize.url('question_id', question_id, 'long') content = self._serialize.body(question, 'Question') response = self._send(http_method='PATCH', location_id='6d1d9741-eca8-4701-a3a5-235afc82dfa4', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Question', response) def create_response(self, response, publisher_name, extension_name, question_id): """CreateResponse. [Preview API] Creates a new response for a given question for an extension. :param :class:` ` response: Response to be created for the extension. :param str publisher_name: Name of the publisher who published the extension. :param str extension_name: Name of the extension. :param long question_id: Identifier of the question for which response is to be created for the extension. :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if question_id is not None: route_values['questionId'] = self._serialize.url('question_id', question_id, 'long') content = self._serialize.body(response, 'Response') response = self._send(http_method='POST', location_id='7f8ae5e0-46b0-438f-b2e8-13e8513517bd', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Response', response) def delete_response(self, publisher_name, extension_name, question_id, response_id): """DeleteResponse. [Preview API] Deletes a response for an extension. (soft delete) :param str publisher_name: Name of the publisher who published the extension. :param str extension_name: Name of the extension. :param long question_id: Identifies the question whose response is to be deleted. :param long response_id: Identifies the response to be deleted. """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if question_id is not None: route_values['questionId'] = self._serialize.url('question_id', question_id, 'long') if response_id is not None: route_values['responseId'] = self._serialize.url('response_id', response_id, 'long') self._send(http_method='DELETE', location_id='7f8ae5e0-46b0-438f-b2e8-13e8513517bd', version='5.0-preview.1', route_values=route_values) def update_response(self, response, publisher_name, extension_name, question_id, response_id): """UpdateResponse. [Preview API] Updates an existing response for a given question for an extension. :param :class:` ` response: Updated response to be set for the extension. :param str publisher_name: Name of the publisher who published the extension. :param str extension_name: Name of the extension. :param long question_id: Identifier of the question for which response is to be updated for the extension. :param long response_id: Identifier of the response which has to be updated. :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if question_id is not None: route_values['questionId'] = self._serialize.url('question_id', question_id, 'long') if response_id is not None: route_values['responseId'] = self._serialize.url('response_id', response_id, 'long') content = self._serialize.body(response, 'Response') response = self._send(http_method='PATCH', location_id='7f8ae5e0-46b0-438f-b2e8-13e8513517bd', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Response', response) def get_extension_reports(self, publisher_name, extension_name, days=None, count=None, after_date=None): """GetExtensionReports. [Preview API] Returns extension reports :param str publisher_name: Name of the publisher who published the extension :param str extension_name: Name of the extension :param int days: Last n days report. If afterDate and days are specified, days will take priority :param int count: Number of events to be returned :param datetime after_date: Use if you want to fetch events newer than the specified date :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if days is not None: query_parameters['days'] = self._serialize.query('days', days, 'int') if count is not None: query_parameters['count'] = self._serialize.query('count', count, 'int') if after_date is not None: query_parameters['afterDate'] = self._serialize.query('after_date', after_date, 'iso-8601') response = self._send(http_method='GET', location_id='79e0c74f-157f-437e-845f-74fbb4121d4c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def get_reviews(self, publisher_name, extension_name, count=None, filter_options=None, before_date=None, after_date=None): """GetReviews. [Preview API] Returns a list of reviews associated with an extension :param str publisher_name: Name of the publisher who published the extension :param str extension_name: Name of the extension :param int count: Number of reviews to retrieve (defaults to 5) :param str filter_options: FilterOptions to filter out empty reviews etcetera, defaults to none :param datetime before_date: Use if you want to fetch reviews older than the specified date, defaults to null :param datetime after_date: Use if you want to fetch reviews newer than the specified date, defaults to null :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if count is not None: query_parameters['count'] = self._serialize.query('count', count, 'int') if filter_options is not None: query_parameters['filterOptions'] = self._serialize.query('filter_options', filter_options, 'str') if before_date is not None: query_parameters['beforeDate'] = self._serialize.query('before_date', before_date, 'iso-8601') if after_date is not None: query_parameters['afterDate'] = self._serialize.query('after_date', after_date, 'iso-8601') response = self._send(http_method='GET', location_id='5b3f819f-f247-42ad-8c00-dd9ab9ab246d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReviewsResult', response) def get_reviews_summary(self, pub_name, ext_name, before_date=None, after_date=None): """GetReviewsSummary. [Preview API] Returns a summary of the reviews :param str pub_name: Name of the publisher who published the extension :param str ext_name: Name of the extension :param datetime before_date: Use if you want to fetch summary of reviews older than the specified date, defaults to null :param datetime after_date: Use if you want to fetch summary of reviews newer than the specified date, defaults to null :rtype: :class:` ` """ route_values = {} if pub_name is not None: route_values['pubName'] = self._serialize.url('pub_name', pub_name, 'str') if ext_name is not None: route_values['extName'] = self._serialize.url('ext_name', ext_name, 'str') query_parameters = {} if before_date is not None: query_parameters['beforeDate'] = self._serialize.query('before_date', before_date, 'iso-8601') if after_date is not None: query_parameters['afterDate'] = self._serialize.query('after_date', after_date, 'iso-8601') response = self._send(http_method='GET', location_id='b7b44e21-209e-48f0-ae78-04727fc37d77', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReviewSummary', response) def create_review(self, review, pub_name, ext_name): """CreateReview. [Preview API] Creates a new review for an extension :param :class:` ` review: Review to be created for the extension :param str pub_name: Name of the publisher who published the extension :param str ext_name: Name of the extension :rtype: :class:` ` """ route_values = {} if pub_name is not None: route_values['pubName'] = self._serialize.url('pub_name', pub_name, 'str') if ext_name is not None: route_values['extName'] = self._serialize.url('ext_name', ext_name, 'str') content = self._serialize.body(review, 'Review') response = self._send(http_method='POST', location_id='e6e85b9d-aa70-40e6-aa28-d0fbf40b91a3', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Review', response) def delete_review(self, pub_name, ext_name, review_id): """DeleteReview. [Preview API] Deletes a review :param str pub_name: Name of the pubilsher who published the extension :param str ext_name: Name of the extension :param long review_id: Id of the review which needs to be updated """ route_values = {} if pub_name is not None: route_values['pubName'] = self._serialize.url('pub_name', pub_name, 'str') if ext_name is not None: route_values['extName'] = self._serialize.url('ext_name', ext_name, 'str') if review_id is not None: route_values['reviewId'] = self._serialize.url('review_id', review_id, 'long') self._send(http_method='DELETE', location_id='e6e85b9d-aa70-40e6-aa28-d0fbf40b91a3', version='5.0-preview.1', route_values=route_values) def update_review(self, review_patch, pub_name, ext_name, review_id): """UpdateReview. [Preview API] Updates or Flags a review :param :class:` ` review_patch: ReviewPatch object which contains the changes to be applied to the review :param str pub_name: Name of the pubilsher who published the extension :param str ext_name: Name of the extension :param long review_id: Id of the review which needs to be updated :rtype: :class:` ` """ route_values = {} if pub_name is not None: route_values['pubName'] = self._serialize.url('pub_name', pub_name, 'str') if ext_name is not None: route_values['extName'] = self._serialize.url('ext_name', ext_name, 'str') if review_id is not None: route_values['reviewId'] = self._serialize.url('review_id', review_id, 'long') content = self._serialize.body(review_patch, 'ReviewPatch') response = self._send(http_method='PATCH', location_id='e6e85b9d-aa70-40e6-aa28-d0fbf40b91a3', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('ReviewPatch', response) def create_category(self, category): """CreateCategory. [Preview API] :param :class:` ` category: :rtype: :class:` ` """ content = self._serialize.body(category, 'ExtensionCategory') response = self._send(http_method='POST', location_id='476531a3-7024-4516-a76a-ed64d3008ad6', version='5.0-preview.1', content=content) return self._deserialize('ExtensionCategory', response) def get_gallery_user_settings(self, user_scope, key=None): """GetGalleryUserSettings. [Preview API] Get all setting entries for the given user/all-users scope :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. :param str key: Optional key under which to filter all the entries :rtype: {object} """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') if key is not None: route_values['key'] = self._serialize.url('key', key, 'str') response = self._send(http_method='GET', location_id='9b75ece3-7960-401c-848b-148ac01ca350', version='5.0-preview.1', route_values=route_values) return self._deserialize('{object}', self._unwrap_collection(response)) def set_gallery_user_settings(self, entries, user_scope): """SetGalleryUserSettings. [Preview API] Set all setting entries for the given user/all-users scope :param {object} entries: A key-value pair of all settings that need to be set :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') content = self._serialize.body(entries, '{object}') self._send(http_method='PATCH', location_id='9b75ece3-7960-401c-848b-148ac01ca350', version='5.0-preview.1', route_values=route_values, content=content) def generate_key(self, key_type, expire_current_seconds=None): """GenerateKey. [Preview API] :param str key_type: :param int expire_current_seconds: """ route_values = {} if key_type is not None: route_values['keyType'] = self._serialize.url('key_type', key_type, 'str') query_parameters = {} if expire_current_seconds is not None: query_parameters['expireCurrentSeconds'] = self._serialize.query('expire_current_seconds', expire_current_seconds, 'int') self._send(http_method='POST', location_id='92ed5cf4-c38b-465a-9059-2f2fb7c624b5', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) def get_signing_key(self, key_type): """GetSigningKey. [Preview API] :param str key_type: :rtype: str """ route_values = {} if key_type is not None: route_values['keyType'] = self._serialize.url('key_type', key_type, 'str') response = self._send(http_method='GET', location_id='92ed5cf4-c38b-465a-9059-2f2fb7c624b5', version='5.0-preview.1', route_values=route_values) return self._deserialize('str', response) def update_extension_statistics(self, extension_statistics_update, publisher_name, extension_name): """UpdateExtensionStatistics. [Preview API] :param :class:` ` extension_statistics_update: :param str publisher_name: :param str extension_name: """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') content = self._serialize.body(extension_statistics_update, 'ExtensionStatisticUpdate') self._send(http_method='PATCH', location_id='a0ea3204-11e9-422d-a9ca-45851cc41400', version='5.0-preview.1', route_values=route_values, content=content) def get_extension_daily_stats(self, publisher_name, extension_name, days=None, aggregate=None, after_date=None): """GetExtensionDailyStats. [Preview API] :param str publisher_name: :param str extension_name: :param int days: :param str aggregate: :param datetime after_date: :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') query_parameters = {} if days is not None: query_parameters['days'] = self._serialize.query('days', days, 'int') if aggregate is not None: query_parameters['aggregate'] = self._serialize.query('aggregate', aggregate, 'str') if after_date is not None: query_parameters['afterDate'] = self._serialize.query('after_date', after_date, 'iso-8601') response = self._send(http_method='GET', location_id='ae06047e-51c5-4fb4-ab65-7be488544416', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ExtensionDailyStats', response) def get_extension_daily_stats_anonymous(self, publisher_name, extension_name, version): """GetExtensionDailyStatsAnonymous. [Preview API] This route/location id only supports HTTP POST anonymously, so that the page view daily stat can be incremented from Marketplace client. Trying to call GET on this route should result in an exception. Without this explicit implementation, calling GET on this public route invokes the above GET implementation GetExtensionDailyStats. :param str publisher_name: Name of the publisher :param str extension_name: Name of the extension :param str version: Version of the extension :rtype: :class:` ` """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') response = self._send(http_method='GET', location_id='4fa7adb6-ca65-4075-a232-5f28323288ea', version='5.0-preview.1', route_values=route_values) return self._deserialize('ExtensionDailyStats', response) def increment_extension_daily_stat(self, publisher_name, extension_name, version, stat_type): """IncrementExtensionDailyStat. [Preview API] Increments a daily statistic associated with the extension :param str publisher_name: Name of the publisher :param str extension_name: Name of the extension :param str version: Version of the extension :param str stat_type: Type of stat to increment """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') query_parameters = {} if stat_type is not None: query_parameters['statType'] = self._serialize.query('stat_type', stat_type, 'str') self._send(http_method='POST', location_id='4fa7adb6-ca65-4075-a232-5f28323288ea', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) def get_verification_log(self, publisher_name, extension_name, version, **kwargs): """GetVerificationLog. [Preview API] :param str publisher_name: :param str extension_name: :param str version: :rtype: object """ route_values = {} if publisher_name is not None: route_values['publisherName'] = self._serialize.url('publisher_name', publisher_name, 'str') if extension_name is not None: route_values['extensionName'] = self._serialize.url('extension_name', extension_name, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') response = self._send(http_method='GET', location_id='c5523abe-b843-437f-875b-5833064efe4d', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/gallery/models.py000066400000000000000000002131721360605530400323570ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AcquisitionOperation(Model): """AcquisitionOperation. :param operation_state: State of the the AcquisitionOperation for the current user :type operation_state: object :param operation_type: AcquisitionOperationType: install, request, buy, etc... :type operation_type: object :param reason: Optional reason to justify current state. Typically used with Disallow state. :type reason: str """ _attribute_map = { 'operation_state': {'key': 'operationState', 'type': 'object'}, 'operation_type': {'key': 'operationType', 'type': 'object'}, 'reason': {'key': 'reason', 'type': 'str'} } def __init__(self, operation_state=None, operation_type=None, reason=None): super(AcquisitionOperation, self).__init__() self.operation_state = operation_state self.operation_type = operation_type self.reason = reason class AcquisitionOptions(Model): """AcquisitionOptions. :param default_operation: Default Operation for the ItemId in this target :type default_operation: :class:`AcquisitionOperation ` :param item_id: The item id that this options refer to :type item_id: str :param operations: Operations allowed for the ItemId in this target :type operations: list of :class:`AcquisitionOperation ` :param target: The target that this options refer to :type target: str """ _attribute_map = { 'default_operation': {'key': 'defaultOperation', 'type': 'AcquisitionOperation'}, 'item_id': {'key': 'itemId', 'type': 'str'}, 'operations': {'key': 'operations', 'type': '[AcquisitionOperation]'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, default_operation=None, item_id=None, operations=None, target=None): super(AcquisitionOptions, self).__init__() self.default_operation = default_operation self.item_id = item_id self.operations = operations self.target = target class Answers(Model): """Answers. :param vs_marketplace_extension_name: Gets or sets the vs marketplace extension name :type vs_marketplace_extension_name: str :param vs_marketplace_publisher_name: Gets or sets the vs marketplace publsiher name :type vs_marketplace_publisher_name: str """ _attribute_map = { 'vs_marketplace_extension_name': {'key': 'vsMarketplaceExtensionName', 'type': 'str'}, 'vs_marketplace_publisher_name': {'key': 'vsMarketplacePublisherName', 'type': 'str'} } def __init__(self, vs_marketplace_extension_name=None, vs_marketplace_publisher_name=None): super(Answers, self).__init__() self.vs_marketplace_extension_name = vs_marketplace_extension_name self.vs_marketplace_publisher_name = vs_marketplace_publisher_name class AssetDetails(Model): """AssetDetails. :param answers: Gets or sets the Answers, which contains vs marketplace extension name and publisher name :type answers: :class:`Answers ` :param publisher_natural_identifier: Gets or sets the VS publisher Id :type publisher_natural_identifier: str """ _attribute_map = { 'answers': {'key': 'answers', 'type': 'Answers'}, 'publisher_natural_identifier': {'key': 'publisherNaturalIdentifier', 'type': 'str'} } def __init__(self, answers=None, publisher_natural_identifier=None): super(AssetDetails, self).__init__() self.answers = answers self.publisher_natural_identifier = publisher_natural_identifier class AzurePublisher(Model): """AzurePublisher. :param azure_publisher_id: :type azure_publisher_id: str :param publisher_name: :type publisher_name: str """ _attribute_map = { 'azure_publisher_id': {'key': 'azurePublisherId', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'} } def __init__(self, azure_publisher_id=None, publisher_name=None): super(AzurePublisher, self).__init__() self.azure_publisher_id = azure_publisher_id self.publisher_name = publisher_name class AzureRestApiRequestModel(Model): """AzureRestApiRequestModel. :param asset_details: Gets or sets the Asset details :type asset_details: :class:`AssetDetails ` :param asset_id: Gets or sets the asset id :type asset_id: str :param asset_version: Gets or sets the asset version :type asset_version: long :param customer_support_email: Gets or sets the customer support email :type customer_support_email: str :param integration_contact_email: Gets or sets the integration contact email :type integration_contact_email: str :param operation: Gets or sets the asset version :type operation: str :param plan_id: Gets or sets the plan identifier if any. :type plan_id: str :param publisher_id: Gets or sets the publisher id :type publisher_id: str :param type: Gets or sets the resource type :type type: str """ _attribute_map = { 'asset_details': {'key': 'assetDetails', 'type': 'AssetDetails'}, 'asset_id': {'key': 'assetId', 'type': 'str'}, 'asset_version': {'key': 'assetVersion', 'type': 'long'}, 'customer_support_email': {'key': 'customerSupportEmail', 'type': 'str'}, 'integration_contact_email': {'key': 'integrationContactEmail', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'str'}, 'plan_id': {'key': 'planId', 'type': 'str'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, asset_details=None, asset_id=None, asset_version=None, customer_support_email=None, integration_contact_email=None, operation=None, plan_id=None, publisher_id=None, type=None): super(AzureRestApiRequestModel, self).__init__() self.asset_details = asset_details self.asset_id = asset_id self.asset_version = asset_version self.customer_support_email = customer_support_email self.integration_contact_email = integration_contact_email self.operation = operation self.plan_id = plan_id self.publisher_id = publisher_id self.type = type class CategoriesResult(Model): """CategoriesResult. :param categories: :type categories: list of :class:`ExtensionCategory ` """ _attribute_map = { 'categories': {'key': 'categories', 'type': '[ExtensionCategory]'} } def __init__(self, categories=None): super(CategoriesResult, self).__init__() self.categories = categories class CategoryLanguageTitle(Model): """CategoryLanguageTitle. :param lang: The language for which the title is applicable :type lang: str :param lcid: The language culture id of the lang parameter :type lcid: int :param title: Actual title to be shown on the UI :type title: str """ _attribute_map = { 'lang': {'key': 'lang', 'type': 'str'}, 'lcid': {'key': 'lcid', 'type': 'int'}, 'title': {'key': 'title', 'type': 'str'} } def __init__(self, lang=None, lcid=None, title=None): super(CategoryLanguageTitle, self).__init__() self.lang = lang self.lcid = lcid self.title = title class EventCounts(Model): """EventCounts. :param average_rating: Average rating on the day for extension :type average_rating: int :param buy_count: Number of times the extension was bought in hosted scenario (applies only to VSTS extensions) :type buy_count: int :param connected_buy_count: Number of times the extension was bought in connected scenario (applies only to VSTS extensions) :type connected_buy_count: int :param connected_install_count: Number of times the extension was installed in connected scenario (applies only to VSTS extensions) :type connected_install_count: int :param install_count: Number of times the extension was installed :type install_count: long :param try_count: Number of times the extension was installed as a trial (applies only to VSTS extensions) :type try_count: int :param uninstall_count: Number of times the extension was uninstalled (applies only to VSTS extensions) :type uninstall_count: int :param web_download_count: Number of times the extension was downloaded (applies to VSTS extensions and VSCode marketplace click installs) :type web_download_count: long :param web_page_views: Number of detail page views :type web_page_views: long """ _attribute_map = { 'average_rating': {'key': 'averageRating', 'type': 'int'}, 'buy_count': {'key': 'buyCount', 'type': 'int'}, 'connected_buy_count': {'key': 'connectedBuyCount', 'type': 'int'}, 'connected_install_count': {'key': 'connectedInstallCount', 'type': 'int'}, 'install_count': {'key': 'installCount', 'type': 'long'}, 'try_count': {'key': 'tryCount', 'type': 'int'}, 'uninstall_count': {'key': 'uninstallCount', 'type': 'int'}, 'web_download_count': {'key': 'webDownloadCount', 'type': 'long'}, 'web_page_views': {'key': 'webPageViews', 'type': 'long'} } def __init__(self, average_rating=None, buy_count=None, connected_buy_count=None, connected_install_count=None, install_count=None, try_count=None, uninstall_count=None, web_download_count=None, web_page_views=None): super(EventCounts, self).__init__() self.average_rating = average_rating self.buy_count = buy_count self.connected_buy_count = connected_buy_count self.connected_install_count = connected_install_count self.install_count = install_count self.try_count = try_count self.uninstall_count = uninstall_count self.web_download_count = web_download_count self.web_page_views = web_page_views class ExtensionAcquisitionRequest(Model): """ExtensionAcquisitionRequest. :param assignment_type: How the item is being assigned :type assignment_type: object :param billing_id: The id of the subscription used for purchase :type billing_id: str :param item_id: The marketplace id (publisherName.extensionName) for the item :type item_id: str :param operation_type: The type of operation, such as install, request, purchase :type operation_type: object :param properties: Additional properties which can be added to the request. :type properties: :class:`object ` :param quantity: How many licenses should be purchased :type quantity: int :param targets: A list of target guids where the item should be acquired (installed, requested, etc.), such as account id :type targets: list of str """ _attribute_map = { 'assignment_type': {'key': 'assignmentType', 'type': 'object'}, 'billing_id': {'key': 'billingId', 'type': 'str'}, 'item_id': {'key': 'itemId', 'type': 'str'}, 'operation_type': {'key': 'operationType', 'type': 'object'}, 'properties': {'key': 'properties', 'type': 'object'}, 'quantity': {'key': 'quantity', 'type': 'int'}, 'targets': {'key': 'targets', 'type': '[str]'} } def __init__(self, assignment_type=None, billing_id=None, item_id=None, operation_type=None, properties=None, quantity=None, targets=None): super(ExtensionAcquisitionRequest, self).__init__() self.assignment_type = assignment_type self.billing_id = billing_id self.item_id = item_id self.operation_type = operation_type self.properties = properties self.quantity = quantity self.targets = targets class ExtensionBadge(Model): """ExtensionBadge. :param description: :type description: str :param img_uri: :type img_uri: str :param link: :type link: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'img_uri': {'key': 'imgUri', 'type': 'str'}, 'link': {'key': 'link', 'type': 'str'} } def __init__(self, description=None, img_uri=None, link=None): super(ExtensionBadge, self).__init__() self.description = description self.img_uri = img_uri self.link = link class ExtensionCategory(Model): """ExtensionCategory. :param associated_products: The name of the products with which this category is associated to. :type associated_products: list of str :param category_id: :type category_id: int :param category_name: This is the internal name for a category :type category_name: str :param language: This parameter is obsolete. Refer to LanguageTitles for langauge specific titles :type language: str :param language_titles: The list of all the titles of this category in various languages :type language_titles: list of :class:`CategoryLanguageTitle ` :param parent_category_name: This is the internal name of the parent if this is associated with a parent :type parent_category_name: str """ _attribute_map = { 'associated_products': {'key': 'associatedProducts', 'type': '[str]'}, 'category_id': {'key': 'categoryId', 'type': 'int'}, 'category_name': {'key': 'categoryName', 'type': 'str'}, 'language': {'key': 'language', 'type': 'str'}, 'language_titles': {'key': 'languageTitles', 'type': '[CategoryLanguageTitle]'}, 'parent_category_name': {'key': 'parentCategoryName', 'type': 'str'} } def __init__(self, associated_products=None, category_id=None, category_name=None, language=None, language_titles=None, parent_category_name=None): super(ExtensionCategory, self).__init__() self.associated_products = associated_products self.category_id = category_id self.category_name = category_name self.language = language self.language_titles = language_titles self.parent_category_name = parent_category_name class ExtensionDailyStat(Model): """ExtensionDailyStat. :param counts: Stores the event counts :type counts: :class:`EventCounts ` :param extended_stats: Generic key/value pair to store extended statistics. Used for sending paid extension stats like Upgrade, Downgrade, Cancel trend etc. :type extended_stats: dict :param statistic_date: Timestamp of this data point :type statistic_date: datetime :param version: Version of the extension :type version: str """ _attribute_map = { 'counts': {'key': 'counts', 'type': 'EventCounts'}, 'extended_stats': {'key': 'extendedStats', 'type': '{object}'}, 'statistic_date': {'key': 'statisticDate', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, counts=None, extended_stats=None, statistic_date=None, version=None): super(ExtensionDailyStat, self).__init__() self.counts = counts self.extended_stats = extended_stats self.statistic_date = statistic_date self.version = version class ExtensionDailyStats(Model): """ExtensionDailyStats. :param daily_stats: List of extension statistics data points :type daily_stats: list of :class:`ExtensionDailyStat ` :param extension_id: Id of the extension, this will never be sent back to the client. For internal use only. :type extension_id: str :param extension_name: Name of the extension :type extension_name: str :param publisher_name: Name of the publisher :type publisher_name: str :param stat_count: Count of stats :type stat_count: int """ _attribute_map = { 'daily_stats': {'key': 'dailyStats', 'type': '[ExtensionDailyStat]'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'stat_count': {'key': 'statCount', 'type': 'int'} } def __init__(self, daily_stats=None, extension_id=None, extension_name=None, publisher_name=None, stat_count=None): super(ExtensionDailyStats, self).__init__() self.daily_stats = daily_stats self.extension_id = extension_id self.extension_name = extension_name self.publisher_name = publisher_name self.stat_count = stat_count class ExtensionDraft(Model): """ExtensionDraft. :param assets: :type assets: list of :class:`ExtensionDraftAsset ` :param created_date: :type created_date: datetime :param draft_state: :type draft_state: object :param extension_name: :type extension_name: str :param id: :type id: str :param last_updated: :type last_updated: datetime :param payload: :type payload: :class:`ExtensionPayload ` :param product: :type product: str :param publisher_name: :type publisher_name: str :param validation_errors: :type validation_errors: list of { key: str; value: str } :param validation_warnings: :type validation_warnings: list of { key: str; value: str } """ _attribute_map = { 'assets': {'key': 'assets', 'type': '[ExtensionDraftAsset]'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'draft_state': {'key': 'draftState', 'type': 'object'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'payload': {'key': 'payload', 'type': 'ExtensionPayload'}, 'product': {'key': 'product', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'validation_errors': {'key': 'validationErrors', 'type': '[{ key: str; value: str }]'}, 'validation_warnings': {'key': 'validationWarnings', 'type': '[{ key: str; value: str }]'} } def __init__(self, assets=None, created_date=None, draft_state=None, extension_name=None, id=None, last_updated=None, payload=None, product=None, publisher_name=None, validation_errors=None, validation_warnings=None): super(ExtensionDraft, self).__init__() self.assets = assets self.created_date = created_date self.draft_state = draft_state self.extension_name = extension_name self.id = id self.last_updated = last_updated self.payload = payload self.product = product self.publisher_name = publisher_name self.validation_errors = validation_errors self.validation_warnings = validation_warnings class ExtensionDraftPatch(Model): """ExtensionDraftPatch. :param extension_data: :type extension_data: :class:`UnpackagedExtensionData ` :param operation: :type operation: object """ _attribute_map = { 'extension_data': {'key': 'extensionData', 'type': 'UnpackagedExtensionData'}, 'operation': {'key': 'operation', 'type': 'object'} } def __init__(self, extension_data=None, operation=None): super(ExtensionDraftPatch, self).__init__() self.extension_data = extension_data self.operation = operation class ExtensionEvent(Model): """ExtensionEvent. :param id: Id which identifies each data point uniquely :type id: long :param properties: :type properties: :class:`object ` :param statistic_date: Timestamp of when the event occurred :type statistic_date: datetime :param version: Version of the extension :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'long'}, 'properties': {'key': 'properties', 'type': 'object'}, 'statistic_date': {'key': 'statisticDate', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, properties=None, statistic_date=None, version=None): super(ExtensionEvent, self).__init__() self.id = id self.properties = properties self.statistic_date = statistic_date self.version = version class ExtensionEvents(Model): """ExtensionEvents. :param events: Generic container for events data. The dictionary key denotes the type of event and the list contains properties related to that event :type events: dict :param extension_id: Id of the extension, this will never be sent back to the client. This field will mainly be used when EMS calls into Gallery REST API to update install/uninstall events for various extensions in one go. :type extension_id: str :param extension_name: Name of the extension :type extension_name: str :param publisher_name: Name of the publisher :type publisher_name: str """ _attribute_map = { 'events': {'key': 'events', 'type': '{[ExtensionEvent]}'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'} } def __init__(self, events=None, extension_id=None, extension_name=None, publisher_name=None): super(ExtensionEvents, self).__init__() self.events = events self.extension_id = extension_id self.extension_name = extension_name self.publisher_name = publisher_name class ExtensionFile(Model): """ExtensionFile. :param asset_type: :type asset_type: str :param language: :type language: str :param source: :type source: str """ _attribute_map = { 'asset_type': {'key': 'assetType', 'type': 'str'}, 'language': {'key': 'language', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'} } def __init__(self, asset_type=None, language=None, source=None): super(ExtensionFile, self).__init__() self.asset_type = asset_type self.language = language self.source = source class ExtensionFilterResult(Model): """ExtensionFilterResult. :param extensions: This is the set of appplications that matched the query filter supplied. :type extensions: list of :class:`PublishedExtension ` :param paging_token: The PagingToken is returned from a request when more records exist that match the result than were requested or could be returned. A follow-up query with this paging token can be used to retrieve more results. :type paging_token: str :param result_metadata: This is the additional optional metadata for the given result. E.g. Total count of results which is useful in case of paged results :type result_metadata: list of :class:`ExtensionFilterResultMetadata ` """ _attribute_map = { 'extensions': {'key': 'extensions', 'type': '[PublishedExtension]'}, 'paging_token': {'key': 'pagingToken', 'type': 'str'}, 'result_metadata': {'key': 'resultMetadata', 'type': '[ExtensionFilterResultMetadata]'} } def __init__(self, extensions=None, paging_token=None, result_metadata=None): super(ExtensionFilterResult, self).__init__() self.extensions = extensions self.paging_token = paging_token self.result_metadata = result_metadata class ExtensionFilterResultMetadata(Model): """ExtensionFilterResultMetadata. :param metadata_items: The metadata items for the category :type metadata_items: list of :class:`MetadataItem ` :param metadata_type: Defines the category of metadata items :type metadata_type: str """ _attribute_map = { 'metadata_items': {'key': 'metadataItems', 'type': '[MetadataItem]'}, 'metadata_type': {'key': 'metadataType', 'type': 'str'} } def __init__(self, metadata_items=None, metadata_type=None): super(ExtensionFilterResultMetadata, self).__init__() self.metadata_items = metadata_items self.metadata_type = metadata_type class ExtensionPackage(Model): """ExtensionPackage. :param extension_manifest: Base 64 encoded extension package :type extension_manifest: str """ _attribute_map = { 'extension_manifest': {'key': 'extensionManifest', 'type': 'str'} } def __init__(self, extension_manifest=None): super(ExtensionPackage, self).__init__() self.extension_manifest = extension_manifest class ExtensionPayload(Model): """ExtensionPayload. :param description: :type description: str :param display_name: :type display_name: str :param file_name: :type file_name: str :param installation_targets: :type installation_targets: list of :class:`InstallationTarget ` :param is_preview: :type is_preview: bool :param is_signed_by_microsoft: :type is_signed_by_microsoft: bool :param is_valid: :type is_valid: bool :param metadata: :type metadata: list of { key: str; value: str } :param type: :type type: object """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'file_name': {'key': 'fileName', 'type': 'str'}, 'installation_targets': {'key': 'installationTargets', 'type': '[InstallationTarget]'}, 'is_preview': {'key': 'isPreview', 'type': 'bool'}, 'is_signed_by_microsoft': {'key': 'isSignedByMicrosoft', 'type': 'bool'}, 'is_valid': {'key': 'isValid', 'type': 'bool'}, 'metadata': {'key': 'metadata', 'type': '[{ key: str; value: str }]'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, description=None, display_name=None, file_name=None, installation_targets=None, is_preview=None, is_signed_by_microsoft=None, is_valid=None, metadata=None, type=None): super(ExtensionPayload, self).__init__() self.description = description self.display_name = display_name self.file_name = file_name self.installation_targets = installation_targets self.is_preview = is_preview self.is_signed_by_microsoft = is_signed_by_microsoft self.is_valid = is_valid self.metadata = metadata self.type = type class ExtensionQuery(Model): """ExtensionQuery. :param asset_types: When retrieving extensions with a query; frequently the caller only needs a small subset of the assets. The caller may specify a list of asset types that should be returned if the extension contains it. All other assets will not be returned. :type asset_types: list of str :param filters: Each filter is a unique query and will have matching set of extensions returned from the request. Each result will have the same index in the resulting array that the filter had in the incoming query. :type filters: list of :class:`QueryFilter ` :param flags: The Flags are used to deterine which set of information the caller would like returned for the matched extensions. :type flags: object """ _attribute_map = { 'asset_types': {'key': 'assetTypes', 'type': '[str]'}, 'filters': {'key': 'filters', 'type': '[QueryFilter]'}, 'flags': {'key': 'flags', 'type': 'object'} } def __init__(self, asset_types=None, filters=None, flags=None): super(ExtensionQuery, self).__init__() self.asset_types = asset_types self.filters = filters self.flags = flags class ExtensionQueryResult(Model): """ExtensionQueryResult. :param results: For each filter supplied in the query, a filter result will be returned in the query result. :type results: list of :class:`ExtensionFilterResult ` """ _attribute_map = { 'results': {'key': 'results', 'type': '[ExtensionFilterResult]'} } def __init__(self, results=None): super(ExtensionQueryResult, self).__init__() self.results = results class ExtensionShare(Model): """ExtensionShare. :param id: :type id: str :param is_org: :type is_org: bool :param name: :type name: str :param type: :type type: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'is_org': {'key': 'isOrg', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, id=None, is_org=None, name=None, type=None): super(ExtensionShare, self).__init__() self.id = id self.is_org = is_org self.name = name self.type = type class ExtensionStatistic(Model): """ExtensionStatistic. :param statistic_name: :type statistic_name: str :param value: :type value: float """ _attribute_map = { 'statistic_name': {'key': 'statisticName', 'type': 'str'}, 'value': {'key': 'value', 'type': 'float'} } def __init__(self, statistic_name=None, value=None): super(ExtensionStatistic, self).__init__() self.statistic_name = statistic_name self.value = value class ExtensionStatisticUpdate(Model): """ExtensionStatisticUpdate. :param extension_name: :type extension_name: str :param operation: :type operation: object :param publisher_name: :type publisher_name: str :param statistic: :type statistic: :class:`ExtensionStatistic ` """ _attribute_map = { 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'object'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'statistic': {'key': 'statistic', 'type': 'ExtensionStatistic'} } def __init__(self, extension_name=None, operation=None, publisher_name=None, statistic=None): super(ExtensionStatisticUpdate, self).__init__() self.extension_name = extension_name self.operation = operation self.publisher_name = publisher_name self.statistic = statistic class ExtensionVersion(Model): """ExtensionVersion. :param asset_uri: :type asset_uri: str :param badges: :type badges: list of :class:`ExtensionBadge ` :param fallback_asset_uri: :type fallback_asset_uri: str :param files: :type files: list of :class:`ExtensionFile ` :param flags: :type flags: object :param last_updated: :type last_updated: datetime :param properties: :type properties: list of { key: str; value: str } :param validation_result_message: :type validation_result_message: str :param version: :type version: str :param version_description: :type version_description: str """ _attribute_map = { 'asset_uri': {'key': 'assetUri', 'type': 'str'}, 'badges': {'key': 'badges', 'type': '[ExtensionBadge]'}, 'fallback_asset_uri': {'key': 'fallbackAssetUri', 'type': 'str'}, 'files': {'key': 'files', 'type': '[ExtensionFile]'}, 'flags': {'key': 'flags', 'type': 'object'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'properties': {'key': 'properties', 'type': '[{ key: str; value: str }]'}, 'validation_result_message': {'key': 'validationResultMessage', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'version_description': {'key': 'versionDescription', 'type': 'str'} } def __init__(self, asset_uri=None, badges=None, fallback_asset_uri=None, files=None, flags=None, last_updated=None, properties=None, validation_result_message=None, version=None, version_description=None): super(ExtensionVersion, self).__init__() self.asset_uri = asset_uri self.badges = badges self.fallback_asset_uri = fallback_asset_uri self.files = files self.flags = flags self.last_updated = last_updated self.properties = properties self.validation_result_message = validation_result_message self.version = version self.version_description = version_description class FilterCriteria(Model): """FilterCriteria. :param filter_type: :type filter_type: int :param value: The value used in the match based on the filter type. :type value: str """ _attribute_map = { 'filter_type': {'key': 'filterType', 'type': 'int'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, filter_type=None, value=None): super(FilterCriteria, self).__init__() self.filter_type = filter_type self.value = value class InstallationTarget(Model): """InstallationTarget. :param target: :type target: str :param target_version: :type target_version: str """ _attribute_map = { 'target': {'key': 'target', 'type': 'str'}, 'target_version': {'key': 'targetVersion', 'type': 'str'} } def __init__(self, target=None, target_version=None): super(InstallationTarget, self).__init__() self.target = target self.target_version = target_version class MetadataItem(Model): """MetadataItem. :param count: The count of the metadata item :type count: int :param name: The name of the metadata item :type name: str """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, count=None, name=None): super(MetadataItem, self).__init__() self.count = count self.name = name class NotificationsData(Model): """NotificationsData. :param data: Notification data needed :type data: dict :param identities: List of users who should get the notification :type identities: dict :param type: Type of Mail Notification.Can be Qna , review or CustomerContact :type type: object """ _attribute_map = { 'data': {'key': 'data', 'type': '{object}'}, 'identities': {'key': 'identities', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, data=None, identities=None, type=None): super(NotificationsData, self).__init__() self.data = data self.identities = identities self.type = type class ProductCategoriesResult(Model): """ProductCategoriesResult. :param categories: :type categories: list of :class:`ProductCategory ` """ _attribute_map = { 'categories': {'key': 'categories', 'type': '[ProductCategory]'} } def __init__(self, categories=None): super(ProductCategoriesResult, self).__init__() self.categories = categories class ProductCategory(Model): """ProductCategory. :param children: :type children: list of :class:`ProductCategory ` :param has_children: Indicator whether this is a leaf or there are children under this category :type has_children: bool :param id: Individual Guid of the Category :type id: str :param title: Category Title in the requested language :type title: str """ _attribute_map = { 'children': {'key': 'children', 'type': '[ProductCategory]'}, 'has_children': {'key': 'hasChildren', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'} } def __init__(self, children=None, has_children=None, id=None, title=None): super(ProductCategory, self).__init__() self.children = children self.has_children = has_children self.id = id self.title = title class PublishedExtension(Model): """PublishedExtension. :param categories: :type categories: list of str :param deployment_type: :type deployment_type: object :param display_name: :type display_name: str :param extension_id: :type extension_id: str :param extension_name: :type extension_name: str :param flags: :type flags: object :param installation_targets: :type installation_targets: list of :class:`InstallationTarget ` :param last_updated: :type last_updated: datetime :param long_description: :type long_description: str :param published_date: Date on which the extension was first uploaded. :type published_date: datetime :param publisher: :type publisher: :class:`PublisherFacts ` :param release_date: Date on which the extension first went public. :type release_date: datetime :param shared_with: :type shared_with: list of :class:`ExtensionShare ` :param short_description: :type short_description: str :param statistics: :type statistics: list of :class:`ExtensionStatistic ` :param tags: :type tags: list of str :param versions: :type versions: list of :class:`ExtensionVersion ` """ _attribute_map = { 'categories': {'key': 'categories', 'type': '[str]'}, 'deployment_type': {'key': 'deploymentType', 'type': 'object'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'flags': {'key': 'flags', 'type': 'object'}, 'installation_targets': {'key': 'installationTargets', 'type': '[InstallationTarget]'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'long_description': {'key': 'longDescription', 'type': 'str'}, 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, 'publisher': {'key': 'publisher', 'type': 'PublisherFacts'}, 'release_date': {'key': 'releaseDate', 'type': 'iso-8601'}, 'shared_with': {'key': 'sharedWith', 'type': '[ExtensionShare]'}, 'short_description': {'key': 'shortDescription', 'type': 'str'}, 'statistics': {'key': 'statistics', 'type': '[ExtensionStatistic]'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'versions': {'key': 'versions', 'type': '[ExtensionVersion]'} } def __init__(self, categories=None, deployment_type=None, display_name=None, extension_id=None, extension_name=None, flags=None, installation_targets=None, last_updated=None, long_description=None, published_date=None, publisher=None, release_date=None, shared_with=None, short_description=None, statistics=None, tags=None, versions=None): super(PublishedExtension, self).__init__() self.categories = categories self.deployment_type = deployment_type self.display_name = display_name self.extension_id = extension_id self.extension_name = extension_name self.flags = flags self.installation_targets = installation_targets self.last_updated = last_updated self.long_description = long_description self.published_date = published_date self.publisher = publisher self.release_date = release_date self.shared_with = shared_with self.short_description = short_description self.statistics = statistics self.tags = tags self.versions = versions class PublisherBase(Model): """PublisherBase. :param display_name: :type display_name: str :param email_address: :type email_address: list of str :param extensions: :type extensions: list of :class:`PublishedExtension ` :param flags: :type flags: object :param last_updated: :type last_updated: datetime :param long_description: :type long_description: str :param publisher_id: :type publisher_id: str :param publisher_name: :type publisher_name: str :param short_description: :type short_description: str :param state: :type state: object """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'email_address': {'key': 'emailAddress', 'type': '[str]'}, 'extensions': {'key': 'extensions', 'type': '[PublishedExtension]'}, 'flags': {'key': 'flags', 'type': 'object'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'long_description': {'key': 'longDescription', 'type': 'str'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'short_description': {'key': 'shortDescription', 'type': 'str'}, 'state': {'key': 'state', 'type': 'object'} } def __init__(self, display_name=None, email_address=None, extensions=None, flags=None, last_updated=None, long_description=None, publisher_id=None, publisher_name=None, short_description=None, state=None): super(PublisherBase, self).__init__() self.display_name = display_name self.email_address = email_address self.extensions = extensions self.flags = flags self.last_updated = last_updated self.long_description = long_description self.publisher_id = publisher_id self.publisher_name = publisher_name self.short_description = short_description self.state = state class PublisherFacts(Model): """PublisherFacts. :param display_name: :type display_name: str :param flags: :type flags: object :param publisher_id: :type publisher_id: str :param publisher_name: :type publisher_name: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'flags': {'key': 'flags', 'type': 'object'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'} } def __init__(self, display_name=None, flags=None, publisher_id=None, publisher_name=None): super(PublisherFacts, self).__init__() self.display_name = display_name self.flags = flags self.publisher_id = publisher_id self.publisher_name = publisher_name class PublisherFilterResult(Model): """PublisherFilterResult. :param publishers: This is the set of appplications that matched the query filter supplied. :type publishers: list of :class:`Publisher ` """ _attribute_map = { 'publishers': {'key': 'publishers', 'type': '[Publisher]'} } def __init__(self, publishers=None): super(PublisherFilterResult, self).__init__() self.publishers = publishers class PublisherQuery(Model): """PublisherQuery. :param filters: Each filter is a unique query and will have matching set of publishers returned from the request. Each result will have the same index in the resulting array that the filter had in the incoming query. :type filters: list of :class:`QueryFilter ` :param flags: The Flags are used to deterine which set of information the caller would like returned for the matched publishers. :type flags: object """ _attribute_map = { 'filters': {'key': 'filters', 'type': '[QueryFilter]'}, 'flags': {'key': 'flags', 'type': 'object'} } def __init__(self, filters=None, flags=None): super(PublisherQuery, self).__init__() self.filters = filters self.flags = flags class PublisherQueryResult(Model): """PublisherQueryResult. :param results: For each filter supplied in the query, a filter result will be returned in the query result. :type results: list of :class:`PublisherFilterResult ` """ _attribute_map = { 'results': {'key': 'results', 'type': '[PublisherFilterResult]'} } def __init__(self, results=None): super(PublisherQueryResult, self).__init__() self.results = results class QnAItem(Model): """QnAItem. :param created_date: Time when the review was first created :type created_date: datetime :param id: Unique identifier of a QnA item :type id: long :param status: Get status of item :type status: object :param text: Text description of the QnA item :type text: str :param updated_date: Time when the review was edited/updated :type updated_date: datetime :param user: User details for the item. :type user: :class:`UserIdentityRef ` """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'long'}, 'status': {'key': 'status', 'type': 'object'}, 'text': {'key': 'text', 'type': 'str'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'user': {'key': 'user', 'type': 'UserIdentityRef'} } def __init__(self, created_date=None, id=None, status=None, text=None, updated_date=None, user=None): super(QnAItem, self).__init__() self.created_date = created_date self.id = id self.status = status self.text = text self.updated_date = updated_date self.user = user class QueryFilter(Model): """QueryFilter. :param criteria: The filter values define the set of values in this query. They are applied based on the QueryFilterType. :type criteria: list of :class:`FilterCriteria ` :param direction: The PagingDirection is applied to a paging token if one exists. If not the direction is ignored, and Forward from the start of the resultset is used. Direction should be left out of the request unless a paging token is used to help prevent future issues. :type direction: object :param page_number: The page number requested by the user. If not provided 1 is assumed by default. :type page_number: int :param page_size: The page size defines the number of results the caller wants for this filter. The count can't exceed the overall query size limits. :type page_size: int :param paging_token: The paging token is a distinct type of filter and the other filter fields are ignored. The paging token represents the continuation of a previously executed query. The information about where in the result and what fields are being filtered are embeded in the token. :type paging_token: str :param sort_by: Defines the type of sorting to be applied on the results. The page slice is cut of the sorted results only. :type sort_by: int :param sort_order: Defines the order of sorting, 1 for Ascending, 2 for Descending, else default ordering based on the SortBy value :type sort_order: int """ _attribute_map = { 'criteria': {'key': 'criteria', 'type': '[FilterCriteria]'}, 'direction': {'key': 'direction', 'type': 'object'}, 'page_number': {'key': 'pageNumber', 'type': 'int'}, 'page_size': {'key': 'pageSize', 'type': 'int'}, 'paging_token': {'key': 'pagingToken', 'type': 'str'}, 'sort_by': {'key': 'sortBy', 'type': 'int'}, 'sort_order': {'key': 'sortOrder', 'type': 'int'} } def __init__(self, criteria=None, direction=None, page_number=None, page_size=None, paging_token=None, sort_by=None, sort_order=None): super(QueryFilter, self).__init__() self.criteria = criteria self.direction = direction self.page_number = page_number self.page_size = page_size self.paging_token = paging_token self.sort_by = sort_by self.sort_order = sort_order class Question(QnAItem): """Question. :param created_date: Time when the review was first created :type created_date: datetime :param id: Unique identifier of a QnA item :type id: long :param status: Get status of item :type status: object :param text: Text description of the QnA item :type text: str :param updated_date: Time when the review was edited/updated :type updated_date: datetime :param user: User details for the item. :type user: :class:`UserIdentityRef ` :param responses: List of answers in for the question / thread :type responses: list of :class:`Response ` """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'long'}, 'status': {'key': 'status', 'type': 'object'}, 'text': {'key': 'text', 'type': 'str'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'user': {'key': 'user', 'type': 'UserIdentityRef'}, 'responses': {'key': 'responses', 'type': '[Response]'} } def __init__(self, created_date=None, id=None, status=None, text=None, updated_date=None, user=None, responses=None): super(Question, self).__init__(created_date=created_date, id=id, status=status, text=text, updated_date=updated_date, user=user) self.responses = responses class QuestionsResult(Model): """QuestionsResult. :param has_more_questions: Flag indicating if there are more QnA threads to be shown (for paging) :type has_more_questions: bool :param questions: List of the QnA threads :type questions: list of :class:`Question ` """ _attribute_map = { 'has_more_questions': {'key': 'hasMoreQuestions', 'type': 'bool'}, 'questions': {'key': 'questions', 'type': '[Question]'} } def __init__(self, has_more_questions=None, questions=None): super(QuestionsResult, self).__init__() self.has_more_questions = has_more_questions self.questions = questions class RatingCountPerRating(Model): """RatingCountPerRating. :param rating: Rating value :type rating: str :param rating_count: Count of total ratings :type rating_count: long """ _attribute_map = { 'rating': {'key': 'rating', 'type': 'str'}, 'rating_count': {'key': 'ratingCount', 'type': 'long'} } def __init__(self, rating=None, rating_count=None): super(RatingCountPerRating, self).__init__() self.rating = rating self.rating_count = rating_count class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class Response(QnAItem): """Response. :param created_date: Time when the review was first created :type created_date: datetime :param id: Unique identifier of a QnA item :type id: long :param status: Get status of item :type status: object :param text: Text description of the QnA item :type text: str :param updated_date: Time when the review was edited/updated :type updated_date: datetime :param user: User details for the item. :type user: :class:`UserIdentityRef ` """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'long'}, 'status': {'key': 'status', 'type': 'object'}, 'text': {'key': 'text', 'type': 'str'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'user': {'key': 'user', 'type': 'UserIdentityRef'}, } def __init__(self, created_date=None, id=None, status=None, text=None, updated_date=None, user=None): super(Response, self).__init__(created_date=created_date, id=id, status=status, text=text, updated_date=updated_date, user=user) class Review(Model): """Review. :param admin_reply: Admin Reply, if any, for this review :type admin_reply: :class:`ReviewReply ` :param id: Unique identifier of a review item :type id: long :param is_deleted: Flag for soft deletion :type is_deleted: bool :param is_ignored: :type is_ignored: bool :param product_version: Version of the product for which review was submitted :type product_version: str :param rating: Rating procided by the user :type rating: str :param reply: Reply, if any, for this review :type reply: :class:`ReviewReply ` :param text: Text description of the review :type text: str :param title: Title of the review :type title: str :param updated_date: Time when the review was edited/updated :type updated_date: datetime :param user_display_name: Name of the user :type user_display_name: str :param user_id: Id of the user who submitted the review :type user_id: str """ _attribute_map = { 'admin_reply': {'key': 'adminReply', 'type': 'ReviewReply'}, 'id': {'key': 'id', 'type': 'long'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'is_ignored': {'key': 'isIgnored', 'type': 'bool'}, 'product_version': {'key': 'productVersion', 'type': 'str'}, 'rating': {'key': 'rating', 'type': 'str'}, 'reply': {'key': 'reply', 'type': 'ReviewReply'}, 'text': {'key': 'text', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'user_display_name': {'key': 'userDisplayName', 'type': 'str'}, 'user_id': {'key': 'userId', 'type': 'str'} } def __init__(self, admin_reply=None, id=None, is_deleted=None, is_ignored=None, product_version=None, rating=None, reply=None, text=None, title=None, updated_date=None, user_display_name=None, user_id=None): super(Review, self).__init__() self.admin_reply = admin_reply self.id = id self.is_deleted = is_deleted self.is_ignored = is_ignored self.product_version = product_version self.rating = rating self.reply = reply self.text = text self.title = title self.updated_date = updated_date self.user_display_name = user_display_name self.user_id = user_id class ReviewPatch(Model): """ReviewPatch. :param operation: Denotes the patch operation type :type operation: object :param reported_concern: Use when patch operation is FlagReview :type reported_concern: :class:`UserReportedConcern ` :param review_item: Use when patch operation is EditReview :type review_item: :class:`Review ` """ _attribute_map = { 'operation': {'key': 'operation', 'type': 'object'}, 'reported_concern': {'key': 'reportedConcern', 'type': 'UserReportedConcern'}, 'review_item': {'key': 'reviewItem', 'type': 'Review'} } def __init__(self, operation=None, reported_concern=None, review_item=None): super(ReviewPatch, self).__init__() self.operation = operation self.reported_concern = reported_concern self.review_item = review_item class ReviewReply(Model): """ReviewReply. :param id: Id of the reply :type id: long :param is_deleted: Flag for soft deletion :type is_deleted: bool :param product_version: Version of the product when the reply was submitted or updated :type product_version: str :param reply_text: Content of the reply :type reply_text: str :param review_id: Id of the review, to which this reply belongs :type review_id: long :param title: Title of the reply :type title: str :param updated_date: Date the reply was submitted or updated :type updated_date: datetime :param user_id: Id of the user who left the reply :type user_id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'long'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'product_version': {'key': 'productVersion', 'type': 'str'}, 'reply_text': {'key': 'replyText', 'type': 'str'}, 'review_id': {'key': 'reviewId', 'type': 'long'}, 'title': {'key': 'title', 'type': 'str'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'user_id': {'key': 'userId', 'type': 'str'} } def __init__(self, id=None, is_deleted=None, product_version=None, reply_text=None, review_id=None, title=None, updated_date=None, user_id=None): super(ReviewReply, self).__init__() self.id = id self.is_deleted = is_deleted self.product_version = product_version self.reply_text = reply_text self.review_id = review_id self.title = title self.updated_date = updated_date self.user_id = user_id class ReviewsResult(Model): """ReviewsResult. :param has_more_reviews: Flag indicating if there are more reviews to be shown (for paging) :type has_more_reviews: bool :param reviews: List of reviews :type reviews: list of :class:`Review ` :param total_review_count: Count of total review items :type total_review_count: long """ _attribute_map = { 'has_more_reviews': {'key': 'hasMoreReviews', 'type': 'bool'}, 'reviews': {'key': 'reviews', 'type': '[Review]'}, 'total_review_count': {'key': 'totalReviewCount', 'type': 'long'} } def __init__(self, has_more_reviews=None, reviews=None, total_review_count=None): super(ReviewsResult, self).__init__() self.has_more_reviews = has_more_reviews self.reviews = reviews self.total_review_count = total_review_count class ReviewSummary(Model): """ReviewSummary. :param average_rating: Average Rating :type average_rating: int :param rating_count: Count of total ratings :type rating_count: long :param rating_split: Split of count accross rating :type rating_split: list of :class:`RatingCountPerRating ` """ _attribute_map = { 'average_rating': {'key': 'averageRating', 'type': 'int'}, 'rating_count': {'key': 'ratingCount', 'type': 'long'}, 'rating_split': {'key': 'ratingSplit', 'type': '[RatingCountPerRating]'} } def __init__(self, average_rating=None, rating_count=None, rating_split=None): super(ReviewSummary, self).__init__() self.average_rating = average_rating self.rating_count = rating_count self.rating_split = rating_split class UnpackagedExtensionData(Model): """UnpackagedExtensionData. :param categories: :type categories: list of str :param description: :type description: str :param display_name: :type display_name: str :param draft_id: :type draft_id: str :param extension_name: :type extension_name: str :param installation_targets: :type installation_targets: list of :class:`InstallationTarget ` :param is_converted_to_markdown: :type is_converted_to_markdown: bool :param is_preview: :type is_preview: bool :param pricing_category: :type pricing_category: str :param product: :type product: str :param publisher_name: :type publisher_name: str :param qn_aEnabled: :type qn_aEnabled: bool :param referral_url: :type referral_url: str :param repository_url: :type repository_url: str :param tags: :type tags: list of str :param version: :type version: str :param vsix_id: :type vsix_id: str """ _attribute_map = { 'categories': {'key': 'categories', 'type': '[str]'}, 'description': {'key': 'description', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'draft_id': {'key': 'draftId', 'type': 'str'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'installation_targets': {'key': 'installationTargets', 'type': '[InstallationTarget]'}, 'is_converted_to_markdown': {'key': 'isConvertedToMarkdown', 'type': 'bool'}, 'is_preview': {'key': 'isPreview', 'type': 'bool'}, 'pricing_category': {'key': 'pricingCategory', 'type': 'str'}, 'product': {'key': 'product', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'qn_aEnabled': {'key': 'qnAEnabled', 'type': 'bool'}, 'referral_url': {'key': 'referralUrl', 'type': 'str'}, 'repository_url': {'key': 'repositoryUrl', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'version': {'key': 'version', 'type': 'str'}, 'vsix_id': {'key': 'vsixId', 'type': 'str'} } def __init__(self, categories=None, description=None, display_name=None, draft_id=None, extension_name=None, installation_targets=None, is_converted_to_markdown=None, is_preview=None, pricing_category=None, product=None, publisher_name=None, qn_aEnabled=None, referral_url=None, repository_url=None, tags=None, version=None, vsix_id=None): super(UnpackagedExtensionData, self).__init__() self.categories = categories self.description = description self.display_name = display_name self.draft_id = draft_id self.extension_name = extension_name self.installation_targets = installation_targets self.is_converted_to_markdown = is_converted_to_markdown self.is_preview = is_preview self.pricing_category = pricing_category self.product = product self.publisher_name = publisher_name self.qn_aEnabled = qn_aEnabled self.referral_url = referral_url self.repository_url = repository_url self.tags = tags self.version = version self.vsix_id = vsix_id class UserIdentityRef(Model): """UserIdentityRef. :param display_name: User display name :type display_name: str :param id: User VSID :type id: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'} } def __init__(self, display_name=None, id=None): super(UserIdentityRef, self).__init__() self.display_name = display_name self.id = id class UserReportedConcern(Model): """UserReportedConcern. :param category: Category of the concern :type category: object :param concern_text: User comment associated with the report :type concern_text: str :param review_id: Id of the review which was reported :type review_id: long :param submitted_date: Date the report was submitted :type submitted_date: datetime :param user_id: Id of the user who reported a review :type user_id: str """ _attribute_map = { 'category': {'key': 'category', 'type': 'object'}, 'concern_text': {'key': 'concernText', 'type': 'str'}, 'review_id': {'key': 'reviewId', 'type': 'long'}, 'submitted_date': {'key': 'submittedDate', 'type': 'iso-8601'}, 'user_id': {'key': 'userId', 'type': 'str'} } def __init__(self, category=None, concern_text=None, review_id=None, submitted_date=None, user_id=None): super(UserReportedConcern, self).__init__() self.category = category self.concern_text = concern_text self.review_id = review_id self.submitted_date = submitted_date self.user_id = user_id class Concern(QnAItem): """Concern. :param created_date: Time when the review was first created :type created_date: datetime :param id: Unique identifier of a QnA item :type id: long :param status: Get status of item :type status: object :param text: Text description of the QnA item :type text: str :param updated_date: Time when the review was edited/updated :type updated_date: datetime :param user: User details for the item. :type user: :class:`UserIdentityRef ` :param category: Category of the concern :type category: object """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'long'}, 'status': {'key': 'status', 'type': 'object'}, 'text': {'key': 'text', 'type': 'str'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'user': {'key': 'user', 'type': 'UserIdentityRef'}, 'category': {'key': 'category', 'type': 'object'} } def __init__(self, created_date=None, id=None, status=None, text=None, updated_date=None, user=None, category=None): super(Concern, self).__init__(created_date=created_date, id=id, status=status, text=text, updated_date=updated_date, user=user) self.category = category class ExtensionDraftAsset(ExtensionFile): """ExtensionDraftAsset. :param asset_type: :type asset_type: str :param language: :type language: str :param source: :type source: str """ _attribute_map = { 'asset_type': {'key': 'assetType', 'type': 'str'}, 'language': {'key': 'language', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'}, } def __init__(self, asset_type=None, language=None, source=None): super(ExtensionDraftAsset, self).__init__(asset_type=asset_type, language=language, source=source) class Publisher(PublisherBase): """Publisher. :param display_name: :type display_name: str :param email_address: :type email_address: list of str :param extensions: :type extensions: list of :class:`PublishedExtension ` :param flags: :type flags: object :param last_updated: :type last_updated: datetime :param long_description: :type long_description: str :param publisher_id: :type publisher_id: str :param publisher_name: :type publisher_name: str :param short_description: :type short_description: str :param state: :type state: object :param _links: :type _links: :class:`ReferenceLinks ` """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'email_address': {'key': 'emailAddress', 'type': '[str]'}, 'extensions': {'key': 'extensions', 'type': '[PublishedExtension]'}, 'flags': {'key': 'flags', 'type': 'object'}, 'last_updated': {'key': 'lastUpdated', 'type': 'iso-8601'}, 'long_description': {'key': 'longDescription', 'type': 'str'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_name': {'key': 'publisherName', 'type': 'str'}, 'short_description': {'key': 'shortDescription', 'type': 'str'}, 'state': {'key': 'state', 'type': 'object'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'} } def __init__(self, display_name=None, email_address=None, extensions=None, flags=None, last_updated=None, long_description=None, publisher_id=None, publisher_name=None, short_description=None, state=None, _links=None): super(Publisher, self).__init__(display_name=display_name, email_address=email_address, extensions=extensions, flags=flags, last_updated=last_updated, long_description=long_description, publisher_id=publisher_id, publisher_name=publisher_name, short_description=short_description, state=state) self._links = _links __all__ = [ 'AcquisitionOperation', 'AcquisitionOptions', 'Answers', 'AssetDetails', 'AzurePublisher', 'AzureRestApiRequestModel', 'CategoriesResult', 'CategoryLanguageTitle', 'EventCounts', 'ExtensionAcquisitionRequest', 'ExtensionBadge', 'ExtensionCategory', 'ExtensionDailyStat', 'ExtensionDailyStats', 'ExtensionDraft', 'ExtensionDraftPatch', 'ExtensionEvent', 'ExtensionEvents', 'ExtensionFile', 'ExtensionFilterResult', 'ExtensionFilterResultMetadata', 'ExtensionPackage', 'ExtensionPayload', 'ExtensionQuery', 'ExtensionQueryResult', 'ExtensionShare', 'ExtensionStatistic', 'ExtensionStatisticUpdate', 'ExtensionVersion', 'FilterCriteria', 'InstallationTarget', 'MetadataItem', 'NotificationsData', 'ProductCategoriesResult', 'ProductCategory', 'PublishedExtension', 'PublisherBase', 'PublisherFacts', 'PublisherFilterResult', 'PublisherQuery', 'PublisherQueryResult', 'QnAItem', 'QueryFilter', 'Question', 'QuestionsResult', 'RatingCountPerRating', 'ReferenceLinks', 'Response', 'Review', 'ReviewPatch', 'ReviewReply', 'ReviewsResult', 'ReviewSummary', 'UnpackagedExtensionData', 'UserIdentityRef', 'UserReportedConcern', 'Concern', 'ExtensionDraftAsset', 'Publisher', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/git/000077500000000000000000000000001360605530400276405ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/git/__init__.py000066400000000000000000000065221360605530400317560ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .git_client import GitClient __all__ = [ 'Attachment', 'Change', 'Comment', 'CommentIterationContext', 'CommentPosition', 'CommentThread', 'CommentThreadContext', 'CommentTrackingCriteria', 'FileContentMetadata', 'FileDiff', 'FileDiffParams', 'FileDiffsCriteria', 'GitAnnotatedTag', 'GitAsyncRefOperation', 'GitAsyncRefOperationDetail', 'GitAsyncRefOperationParameters', 'GitAsyncRefOperationSource', 'GitBaseVersionDescriptor', 'GitBlobRef', 'GitBranchStats', 'GitCherryPick', 'GitCommit', 'GitCommitChanges', 'GitCommitDiffs', 'GitCommitRef', 'GitConflict', 'GitConflictUpdateResult', 'GitDeletedRepository', 'GitFilePathsCollection', 'GitForkOperationStatusDetail', 'GitForkRef', 'GitForkSyncRequest', 'GitForkSyncRequestParameters', 'GitImportGitSource', 'GitImportRequest', 'GitImportRequestParameters', 'GitImportStatusDetail', 'GitImportTfvcSource', 'GitItem', 'GitItemDescriptor', 'GitItemRequestData', 'GitMerge', 'GitMergeOperationStatusDetail', 'GitMergeOriginRef', 'GitMergeParameters', 'GitObject', 'GitPullRequest', 'GitPullRequestChange', 'GitPullRequestCommentThread', 'GitPullRequestCommentThreadContext', 'GitPullRequestCompletionOptions', 'GitPullRequestIteration', 'GitPullRequestIterationChanges', 'GitPullRequestMergeOptions', 'GitPullRequestQuery', 'GitPullRequestQueryInput', 'GitPullRequestSearchCriteria', 'GitPullRequestStatus', 'GitPush', 'GitPushRef', 'GitPushSearchCriteria', 'GitQueryBranchStatsCriteria', 'GitQueryCommitsCriteria', 'GitRecycleBinRepositoryDetails', 'GitRef', 'GitRefFavorite', 'GitRefUpdate', 'GitRefUpdateResult', 'GitRepository', 'GitRepositoryCreateOptions', 'GitRepositoryRef', 'GitRepositoryStats', 'GitRevert', 'GitStatus', 'GitStatusContext', 'GitSuggestion', 'GitTargetVersionDescriptor', 'GitTemplate', 'GitTreeDiff', 'GitTreeDiffEntry', 'GitTreeDiffResponse', 'GitTreeEntryRef', 'GitTreeRef', 'GitUserDate', 'GitVersionDescriptor', 'GlobalGitRepositoryKey', 'GraphSubjectBase', 'IdentityRef', 'IdentityRefWithVote', 'ImportRepositoryValidation', 'ItemContent', 'ItemModel', 'JsonPatchOperation', 'LineDiffBlock', 'PolicyConfiguration', 'PolicyConfigurationRef', 'PolicyTypeRef', 'ReferenceLinks', 'ResourceRef', 'ShareNotificationContext', 'SourceToTargetRef', 'TeamProjectCollectionReference', 'TeamProjectReference', 'VersionedPolicyConfigurationRef', 'VstsInfo', 'WebApiCreateTagRequestData', 'WebApiTagDefinition', 'GitClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/git/git_client.py000066400000000000000000000031661360605530400323410ustar00rootroot00000000000000# coding=utf-8 from msrest.universal_http import ClientRequest from .git_client_base import GitClientBase class GitClient(GitClientBase): """Git :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(GitClient, self).__init__(base_url, creds) def get_vsts_info(self, relative_remote_url): url = self._client.format_url(relative_remote_url.rstrip('/') + '/vsts/info') request = ClientRequest(method='GET', url=url) headers = {'Accept': 'application/json'} if self._suppress_fedauth_redirect: headers['X-TFS-FedAuthRedirect'] = 'Suppress' if self._force_msa_pass_through: headers['X-VSS-ForceMsaPassThrough'] = 'true' response = self._send_request(request, headers) return self._deserialize('VstsInfo', response) @staticmethod def get_vsts_info_by_remote_url(remote_url, credentials, suppress_fedauth_redirect=True, force_msa_pass_through=True): request = ClientRequest(method='GET', url=remote_url.rstrip('/') + '/vsts/info') headers = {'Accept': 'application/json'} if suppress_fedauth_redirect: headers['X-TFS-FedAuthRedirect'] = 'Suppress' if force_msa_pass_through: headers['X-VSS-ForceMsaPassThrough'] = 'true' git_client = GitClient(base_url=remote_url, creds=credentials) response = git_client._send_request(request, headers) return git_client._deserialize('VstsInfo', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/git/git_client_base.py000066400000000000000000005762571360605530400333530ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class GitClientBase(Client): """Git :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(GitClientBase, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '4e080c62-fa21-4fbc-8fef-2a10a2b38049' def create_annotated_tag(self, tag_object, project, repository_id): """CreateAnnotatedTag. [Preview API] Create an annotated tag. :param :class:` ` tag_object: Object containing details of tag to be created. :param str project: Project ID or project name :param str repository_id: ID or name of the repository. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(tag_object, 'GitAnnotatedTag') response = self._send(http_method='POST', location_id='5e8a8081-3851-4626-b677-9891cc04102e', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('GitAnnotatedTag', response) def get_annotated_tag(self, project, repository_id, object_id): """GetAnnotatedTag. [Preview API] Get an annotated tag. :param str project: Project ID or project name :param str repository_id: ID or name of the repository. :param str object_id: ObjectId (Sha1Id) of tag to get. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if object_id is not None: route_values['objectId'] = self._serialize.url('object_id', object_id, 'str') response = self._send(http_method='GET', location_id='5e8a8081-3851-4626-b677-9891cc04102e', version='5.0-preview.1', route_values=route_values) return self._deserialize('GitAnnotatedTag', response) def get_blob(self, repository_id, sha1, project=None, download=None, file_name=None, resolve_lfs=None): """GetBlob. Get a single blob. :param str repository_id: The name or ID of the repository. :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint. :param str project: Project ID or project name :param bool download: If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip :param str file_name: Provide a fileName to use for a download. :param bool resolve_lfs: If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitBlobRef', response) def get_blob_content(self, repository_id, sha1, project=None, download=None, file_name=None, resolve_lfs=None, **kwargs): """GetBlobContent. Get a single blob. :param str repository_id: The name or ID of the repository. :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint. :param str project: Project ID or project name :param bool download: If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip :param str file_name: Provide a fileName to use for a download. :param bool resolve_lfs: If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_blobs_zip(self, blob_ids, repository_id, project=None, filename=None, **kwargs): """GetBlobsZip. Gets one or more blobs in a zip file download. :param [str] blob_ids: Blob IDs (SHA1 hashes) to be returned in the zip file. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param str filename: :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if filename is not None: query_parameters['filename'] = self._serialize.query('filename', filename, 'str') content = self._serialize.body(blob_ids, '[str]') response = self._send(http_method='POST', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_blob_zip(self, repository_id, sha1, project=None, download=None, file_name=None, resolve_lfs=None, **kwargs): """GetBlobZip. Get a single blob. :param str repository_id: The name or ID of the repository. :param str sha1: SHA1 hash of the file. You can get the SHA1 of a file using the "Git/Items/Get Item" endpoint. :param str project: Project ID or project name :param bool download: If true, prompt for a download rather than rendering in a browser. Note: this value defaults to true if $format is zip :param str file_name: Provide a fileName to use for a download. :param bool resolve_lfs: If true, try to resolve a blob to its LFS contents, if it's an LFS pointer file. Only compatible with octet-stream Accept headers or $format types :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='7b28e929-2c99-405d-9c5c-6167a06e6816', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_branch(self, repository_id, name, project=None, base_version_descriptor=None): """GetBranch. Retrieve statistics about a single branch. :param str repository_id: The name or ID of the repository. :param str name: Name of the branch. :param str project: Project ID or project name :param :class:` ` base_version_descriptor: Identifies the commit or branch to use as the base. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if base_version_descriptor is not None: if base_version_descriptor.version_type is not None: query_parameters['baseVersionDescriptor.versionType'] = base_version_descriptor.version_type if base_version_descriptor.version is not None: query_parameters['baseVersionDescriptor.version'] = base_version_descriptor.version if base_version_descriptor.version_options is not None: query_parameters['baseVersionDescriptor.versionOptions'] = base_version_descriptor.version_options response = self._send(http_method='GET', location_id='d5b216de-d8d5-4d32-ae76-51df755b16d3', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitBranchStats', response) def get_branches(self, repository_id, project=None, base_version_descriptor=None): """GetBranches. Retrieve statistics about all branches within a repository. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param :class:` ` base_version_descriptor: Identifies the commit or branch to use as the base. :rtype: [GitBranchStats] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if base_version_descriptor is not None: if base_version_descriptor.version_type is not None: query_parameters['baseVersionDescriptor.versionType'] = base_version_descriptor.version_type if base_version_descriptor.version is not None: query_parameters['baseVersionDescriptor.version'] = base_version_descriptor.version if base_version_descriptor.version_options is not None: query_parameters['baseVersionDescriptor.versionOptions'] = base_version_descriptor.version_options response = self._send(http_method='GET', location_id='d5b216de-d8d5-4d32-ae76-51df755b16d3', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitBranchStats]', self._unwrap_collection(response)) def get_changes(self, commit_id, repository_id, project=None, top=None, skip=None): """GetChanges. Retrieve changes for a particular commit. :param str commit_id: The id of the commit. :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. :param str project: Project ID or project name :param int top: The maximum number of changes to return. :param int skip: The number of changes to skip. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if commit_id is not None: route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='5bf884f5-3e07-42e9-afb8-1b872267bf16', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitCommitChanges', response) def create_cherry_pick(self, cherry_pick_to_create, project, repository_id): """CreateCherryPick. [Preview API] Cherry pick a specific commit or commits that are associated to a pull request into a new branch. :param :class:` ` cherry_pick_to_create: :param str project: Project ID or project name :param str repository_id: ID of the repository. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(cherry_pick_to_create, 'GitAsyncRefOperationParameters') response = self._send(http_method='POST', location_id='033bad68-9a14-43d1-90e0-59cb8856fef6', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('GitCherryPick', response) def get_cherry_pick(self, project, cherry_pick_id, repository_id): """GetCherryPick. [Preview API] Retrieve information about a cherry pick by cherry pick Id. :param str project: Project ID or project name :param int cherry_pick_id: ID of the cherry pick. :param str repository_id: ID of the repository. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if cherry_pick_id is not None: route_values['cherryPickId'] = self._serialize.url('cherry_pick_id', cherry_pick_id, 'int') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') response = self._send(http_method='GET', location_id='033bad68-9a14-43d1-90e0-59cb8856fef6', version='5.0-preview.1', route_values=route_values) return self._deserialize('GitCherryPick', response) def get_cherry_pick_for_ref_name(self, project, repository_id, ref_name): """GetCherryPickForRefName. [Preview API] Retrieve information about a cherry pick for a specific branch. :param str project: Project ID or project name :param str repository_id: ID of the repository. :param str ref_name: The GitAsyncRefOperationParameters generatedRefName used for the cherry pick operation. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if ref_name is not None: query_parameters['refName'] = self._serialize.query('ref_name', ref_name, 'str') response = self._send(http_method='GET', location_id='033bad68-9a14-43d1-90e0-59cb8856fef6', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitCherryPick', response) def get_commit_diffs(self, repository_id, project=None, diff_common_commit=None, top=None, skip=None, base_version_descriptor=None, target_version_descriptor=None): """GetCommitDiffs. Find the closest common commit (the merge base) between base and target commits, and get the diff between either the base and target commits or common and target commits. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param bool diff_common_commit: If true, diff between common and target commits. If false, diff between base and target commits. :param int top: Maximum number of changes to return. Defaults to 100. :param int skip: Number of changes to skip :param :class:` ` base_version_descriptor: Descriptor for base commit. :param :class:` ` target_version_descriptor: Descriptor for target commit. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if diff_common_commit is not None: query_parameters['diffCommonCommit'] = self._serialize.query('diff_common_commit', diff_common_commit, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if base_version_descriptor is not None: if base_version_descriptor.base_version_type is not None: query_parameters['baseVersionType'] = base_version_descriptor.base_version_type if base_version_descriptor.base_version is not None: query_parameters['baseVersion'] = base_version_descriptor.base_version if base_version_descriptor.base_version_options is not None: query_parameters['baseVersionOptions'] = base_version_descriptor.base_version_options if target_version_descriptor is not None: if target_version_descriptor.target_version_type is not None: query_parameters['targetVersionType'] = target_version_descriptor.target_version_type if target_version_descriptor.target_version is not None: query_parameters['targetVersion'] = target_version_descriptor.target_version if target_version_descriptor.target_version_options is not None: query_parameters['targetVersionOptions'] = target_version_descriptor.target_version_options response = self._send(http_method='GET', location_id='615588d5-c0c7-4b88-88f8-e625306446e8', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitCommitDiffs', response) def get_commit(self, commit_id, repository_id, project=None, change_count=None): """GetCommit. Retrieve a particular commit. :param str commit_id: The id of the commit. :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. :param str project: Project ID or project name :param int change_count: The number of changes to include in the result. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if commit_id is not None: route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if change_count is not None: query_parameters['changeCount'] = self._serialize.query('change_count', change_count, 'int') response = self._send(http_method='GET', location_id='c2570c3b-5b3f-41b8-98bf-5407bfde8d58', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitCommit', response) def get_commits(self, repository_id, search_criteria, project=None, skip=None, top=None): """GetCommits. Retrieve git commits for a project :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. :param :class:` ` search_criteria: :param str project: Project ID or project name :param int skip: :param int top: :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if search_criteria is not None: if search_criteria.ids is not None: query_parameters['searchCriteria.ids'] = search_criteria.ids if search_criteria.from_date is not None: query_parameters['searchCriteria.fromDate'] = search_criteria.from_date if search_criteria.to_date is not None: query_parameters['searchCriteria.toDate'] = search_criteria.to_date if search_criteria.item_version is not None: if search_criteria.item_version.version_type is not None: query_parameters['searchCriteria.itemVersion.versionType'] = search_criteria.item_version.version_type if search_criteria.item_version.version is not None: query_parameters['searchCriteria.itemVersion.version'] = search_criteria.item_version.version if search_criteria.item_version.version_options is not None: query_parameters['searchCriteria.itemVersion.versionOptions'] = search_criteria.item_version.version_options if search_criteria.compare_version is not None: if search_criteria.compare_version.version_type is not None: query_parameters['searchCriteria.compareVersion.versionType'] = search_criteria.compare_version.version_type if search_criteria.compare_version.version is not None: query_parameters['searchCriteria.compareVersion.version'] = search_criteria.compare_version.version if search_criteria.compare_version.version_options is not None: query_parameters['searchCriteria.compareVersion.versionOptions'] = search_criteria.compare_version.version_options if search_criteria.from_commit_id is not None: query_parameters['searchCriteria.fromCommitId'] = search_criteria.from_commit_id if search_criteria.to_commit_id is not None: query_parameters['searchCriteria.toCommitId'] = search_criteria.to_commit_id if search_criteria.user is not None: query_parameters['searchCriteria.user'] = search_criteria.user if search_criteria.author is not None: query_parameters['searchCriteria.author'] = search_criteria.author if search_criteria.item_path is not None: query_parameters['searchCriteria.itemPath'] = search_criteria.item_path if search_criteria.exclude_deletes is not None: query_parameters['searchCriteria.excludeDeletes'] = search_criteria.exclude_deletes if search_criteria.skip is not None: query_parameters['searchCriteria.$skip'] = search_criteria.skip if search_criteria.top is not None: query_parameters['searchCriteria.$top'] = search_criteria.top if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if search_criteria.include_work_items is not None: query_parameters['searchCriteria.includeWorkItems'] = search_criteria.include_work_items if search_criteria.include_user_image_url is not None: query_parameters['searchCriteria.includeUserImageUrl'] = search_criteria.include_user_image_url if search_criteria.include_push_data is not None: query_parameters['searchCriteria.includePushData'] = search_criteria.include_push_data if search_criteria.history_mode is not None: query_parameters['searchCriteria.historyMode'] = search_criteria.history_mode if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='c2570c3b-5b3f-41b8-98bf-5407bfde8d58', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_push_commits(self, repository_id, push_id, project=None, top=None, skip=None, include_links=None): """GetPushCommits. Retrieve a list of commits associated with a particular push. :param str repository_id: The id or friendly name of the repository. To use the friendly name, projectId must also be specified. :param int push_id: The id of the push. :param str project: Project ID or project name :param int top: The maximum number of commits to return ("get the top x commits"). :param int skip: The number of commits to skip. :param bool include_links: Set to false to avoid including REST Url links for resources. Defaults to true. :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if push_id is not None: query_parameters['pushId'] = self._serialize.query('push_id', push_id, 'int') if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['skip'] = self._serialize.query('skip', skip, 'int') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='c2570c3b-5b3f-41b8-98bf-5407bfde8d58', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_commits_batch(self, search_criteria, repository_id, project=None, skip=None, top=None, include_statuses=None): """GetCommitsBatch. Retrieve git commits for a project matching the search criteria :param :class:` ` search_criteria: Search options :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param int skip: Number of commits to skip. :param int top: Maximum number of commits to return. :param bool include_statuses: True to include additional commit status information. :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if include_statuses is not None: query_parameters['includeStatuses'] = self._serialize.query('include_statuses', include_statuses, 'bool') content = self._serialize.body(search_criteria, 'GitQueryCommitsCriteria') response = self._send(http_method='POST', location_id='6400dfb2-0bcb-462b-b992-5a57f8f1416c', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_deleted_repositories(self, project): """GetDeletedRepositories. [Preview API] Retrieve deleted git repositories. :param str project: Project ID or project name :rtype: [GitDeletedRepository] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='2b6869c4-cb25-42b5-b7a3-0d3e6be0a11a', version='5.0-preview.1', route_values=route_values) return self._deserialize('[GitDeletedRepository]', self._unwrap_collection(response)) def get_forks(self, repository_name_or_id, collection_id, project=None, include_links=None): """GetForks. [Preview API] Retrieve all forks of a repository in the collection. :param str repository_name_or_id: The name or ID of the repository. :param str collection_id: Team project collection ID. :param str project: Project ID or project name :param bool include_links: True to include links. :rtype: [GitRepositoryRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_name_or_id is not None: route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') if collection_id is not None: route_values['collectionId'] = self._serialize.url('collection_id', collection_id, 'str') query_parameters = {} if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='158c0340-bf6f-489c-9625-d572a1480d57', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitRepositoryRef]', self._unwrap_collection(response)) def create_fork_sync_request(self, sync_params, repository_name_or_id, project=None, include_links=None): """CreateForkSyncRequest. [Preview API] Request that another repository's refs be fetched into this one. :param :class:` ` sync_params: Source repository and ref mapping. :param str repository_name_or_id: The name or ID of the repository. :param str project: Project ID or project name :param bool include_links: True to include links :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_name_or_id is not None: route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') query_parameters = {} if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') content = self._serialize.body(sync_params, 'GitForkSyncRequestParameters') response = self._send(http_method='POST', location_id='1703f858-b9d1-46af-ab62-483e9e1055b5', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('GitForkSyncRequest', response) def get_fork_sync_request(self, repository_name_or_id, fork_sync_operation_id, project=None, include_links=None): """GetForkSyncRequest. [Preview API] Get a specific fork sync operation's details. :param str repository_name_or_id: The name or ID of the repository. :param int fork_sync_operation_id: OperationId of the sync request. :param str project: Project ID or project name :param bool include_links: True to include links. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_name_or_id is not None: route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') if fork_sync_operation_id is not None: route_values['forkSyncOperationId'] = self._serialize.url('fork_sync_operation_id', fork_sync_operation_id, 'int') query_parameters = {} if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='1703f858-b9d1-46af-ab62-483e9e1055b5', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitForkSyncRequest', response) def get_fork_sync_requests(self, repository_name_or_id, project=None, include_abandoned=None, include_links=None): """GetForkSyncRequests. [Preview API] Retrieve all requested fork sync operations on this repository. :param str repository_name_or_id: The name or ID of the repository. :param str project: Project ID or project name :param bool include_abandoned: True to include abandoned requests. :param bool include_links: True to include links. :rtype: [GitForkSyncRequest] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_name_or_id is not None: route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') query_parameters = {} if include_abandoned is not None: query_parameters['includeAbandoned'] = self._serialize.query('include_abandoned', include_abandoned, 'bool') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='1703f858-b9d1-46af-ab62-483e9e1055b5', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitForkSyncRequest]', self._unwrap_collection(response)) def create_import_request(self, import_request, project, repository_id): """CreateImportRequest. [Preview API] Create an import request. :param :class:` ` import_request: The import request to create. :param str project: Project ID or project name :param str repository_id: The name or ID of the repository. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(import_request, 'GitImportRequest') response = self._send(http_method='POST', location_id='01828ddc-3600-4a41-8633-99b3a73a0eb3', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('GitImportRequest', response) def get_import_request(self, project, repository_id, import_request_id): """GetImportRequest. [Preview API] Retrieve a particular import request. :param str project: Project ID or project name :param str repository_id: The name or ID of the repository. :param int import_request_id: The unique identifier for the import request. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if import_request_id is not None: route_values['importRequestId'] = self._serialize.url('import_request_id', import_request_id, 'int') response = self._send(http_method='GET', location_id='01828ddc-3600-4a41-8633-99b3a73a0eb3', version='5.0-preview.1', route_values=route_values) return self._deserialize('GitImportRequest', response) def query_import_requests(self, project, repository_id, include_abandoned=None): """QueryImportRequests. [Preview API] Retrieve import requests for a repository. :param str project: Project ID or project name :param str repository_id: The name or ID of the repository. :param bool include_abandoned: True to include abandoned import requests in the results. :rtype: [GitImportRequest] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if include_abandoned is not None: query_parameters['includeAbandoned'] = self._serialize.query('include_abandoned', include_abandoned, 'bool') response = self._send(http_method='GET', location_id='01828ddc-3600-4a41-8633-99b3a73a0eb3', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitImportRequest]', self._unwrap_collection(response)) def update_import_request(self, import_request_to_update, project, repository_id, import_request_id): """UpdateImportRequest. [Preview API] Retry or abandon a failed import request. :param :class:` ` import_request_to_update: The updated version of the import request. Currently, the only change allowed is setting the Status to Queued or Abandoned. :param str project: Project ID or project name :param str repository_id: The name or ID of the repository. :param int import_request_id: The unique identifier for the import request to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if import_request_id is not None: route_values['importRequestId'] = self._serialize.url('import_request_id', import_request_id, 'int') content = self._serialize.body(import_request_to_update, 'GitImportRequest') response = self._send(http_method='PATCH', location_id='01828ddc-3600-4a41-8633-99b3a73a0eb3', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('GitImportRequest', response) def get_item(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None): """GetItem. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str path: The item path. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the lastest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitItem', response) def get_item_content(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, **kwargs): """GetItemContent. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str path: The item path. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the lastest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_items(self, repository_id, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, include_links=None, version_descriptor=None): """GetItems. Get Item Metadata and/or Content for a collection of items. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the lastest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param bool include_links: Set to true to include links to items. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is null. :rtype: [GitItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitItem]', self._unwrap_collection(response)) def get_item_text(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, **kwargs): """GetItemText. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str path: The item path. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the lastest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_item_zip(self, repository_id, path, project=None, scope_path=None, recursion_level=None, include_content_metadata=None, latest_processed_change=None, download=None, version_descriptor=None, include_content=None, resolve_lfs=None, **kwargs): """GetItemZip. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content, which is always returned as a download. :param str repository_id: The name or ID of the repository. :param str path: The item path. :param str project: Project ID or project name :param str scope_path: The path scope. The default is null. :param str recursion_level: The recursion level of this request. The default is 'none', no recursion. :param bool include_content_metadata: Set to true to include content metadata. Default is false. :param bool latest_processed_change: Set to true to include the lastest changes. Default is false. :param bool download: Set to true to download the response as a file. Default is false. :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :param bool resolve_lfs: Set to true to resolve Git LFS pointer files to return actual content from Git LFS. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_content_metadata is not None: query_parameters['includeContentMetadata'] = self._serialize.query('include_content_metadata', include_content_metadata, 'bool') if latest_processed_change is not None: query_parameters['latestProcessedChange'] = self._serialize.query('latest_processed_change', latest_processed_change, 'bool') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') if resolve_lfs is not None: query_parameters['resolveLfs'] = self._serialize.query('resolve_lfs', resolve_lfs, 'bool') response = self._send(http_method='GET', location_id='fb93c0db-47ed-4a31-8c20-47552878fb44', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_items_batch(self, request_data, repository_id, project=None): """GetItemsBatch. Post for retrieving a creating a batch out of a set of items in a repo / project given a list of paths or a long path :param :class:` ` request_data: Request data attributes: ItemDescriptors, IncludeContentMetadata, LatestProcessedChange, IncludeLinks. ItemDescriptors: Collection of items to fetch, including path, version, and recursion level. IncludeContentMetadata: Whether to include metadata for all items LatestProcessedChange: Whether to include shallow ref to commit that last changed each item. IncludeLinks: Whether to include the _links field on the shallow references. :param str repository_id: The name or ID of the repository :param str project: Project ID or project name :rtype: [[GitItem]] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(request_data, 'GitItemRequestData') response = self._send(http_method='POST', location_id='630fd2e4-fb88-4f85-ad21-13f3fd1fbca9', version='5.0', route_values=route_values, content=content) return self._deserialize('[[GitItem]]', self._unwrap_collection(response)) def get_merge_bases(self, repository_name_or_id, commit_id, other_commit_id, project=None, other_collection_id=None, other_repository_id=None): """GetMergeBases. [Preview API] Find the merge bases of two commits, optionally across forks. If otherRepositoryId is not specified, the merge bases will only be calculated within the context of the local repositoryNameOrId. :param str repository_name_or_id: ID or name of the local repository. :param str commit_id: First commit, usually the tip of the target branch of the potential merge. :param str other_commit_id: Other commit, usually the tip of the source branch of the potential merge. :param str project: Project ID or project name :param str other_collection_id: The collection ID where otherCommitId lives. :param str other_repository_id: The repository ID where otherCommitId lives. :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_name_or_id is not None: route_values['repositoryNameOrId'] = self._serialize.url('repository_name_or_id', repository_name_or_id, 'str') if commit_id is not None: route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') query_parameters = {} if other_commit_id is not None: query_parameters['otherCommitId'] = self._serialize.query('other_commit_id', other_commit_id, 'str') if other_collection_id is not None: query_parameters['otherCollectionId'] = self._serialize.query('other_collection_id', other_collection_id, 'str') if other_repository_id is not None: query_parameters['otherRepositoryId'] = self._serialize.query('other_repository_id', other_repository_id, 'str') response = self._send(http_method='GET', location_id='7cf2abb6-c964-4f7e-9872-f78c66e72e9c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def create_attachment(self, upload_stream, file_name, repository_id, pull_request_id, project=None, **kwargs): """CreateAttachment. [Preview API] Attach a new file to a pull request. :param object upload_stream: Stream to upload :param str file_name: The name of the file. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if file_name is not None: route_values['fileName'] = self._serialize.url('file_name', file_name, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/octet-stream') return self._deserialize('Attachment', response) def delete_attachment(self, file_name, repository_id, pull_request_id, project=None): """DeleteAttachment. [Preview API] Delete a pull request attachment. :param str file_name: The name of the attachment to delete. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if file_name is not None: route_values['fileName'] = self._serialize.url('file_name', file_name, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') self._send(http_method='DELETE', location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', version='5.0-preview.1', route_values=route_values) def get_attachment_content(self, file_name, repository_id, pull_request_id, project=None, **kwargs): """GetAttachmentContent. [Preview API] Get the file content of a pull request attachment. :param str file_name: The name of the attachment. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if file_name is not None: route_values['fileName'] = self._serialize.url('file_name', file_name, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_attachments(self, repository_id, pull_request_id, project=None): """GetAttachments. [Preview API] Get a list of files attached to a given pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [Attachment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', version='5.0-preview.1', route_values=route_values) return self._deserialize('[Attachment]', self._unwrap_collection(response)) def get_attachment_zip(self, file_name, repository_id, pull_request_id, project=None, **kwargs): """GetAttachmentZip. [Preview API] Get the file content of a pull request attachment. :param str file_name: The name of the attachment. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if file_name is not None: route_values['fileName'] = self._serialize.url('file_name', file_name, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='965d9361-878b-413b-a494-45d5b5fd8ab7', version='5.0-preview.1', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def create_like(self, repository_id, pull_request_id, thread_id, comment_id, project=None): """CreateLike. [Preview API] Add a like on a comment. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: The ID of the thread that contains the comment. :param int comment_id: The ID of the comment. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') if comment_id is not None: route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') self._send(http_method='POST', location_id='5f2e2851-1389-425b-a00b-fb2adb3ef31b', version='5.0-preview.1', route_values=route_values) def delete_like(self, repository_id, pull_request_id, thread_id, comment_id, project=None): """DeleteLike. [Preview API] Delete a like on a comment. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: The ID of the thread that contains the comment. :param int comment_id: The ID of the comment. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') if comment_id is not None: route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') self._send(http_method='DELETE', location_id='5f2e2851-1389-425b-a00b-fb2adb3ef31b', version='5.0-preview.1', route_values=route_values) def get_likes(self, repository_id, pull_request_id, thread_id, comment_id, project=None): """GetLikes. [Preview API] Get likes for a comment. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: The ID of the thread that contains the comment. :param int comment_id: The ID of the comment. :param str project: Project ID or project name :rtype: [IdentityRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') if comment_id is not None: route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') response = self._send(http_method='GET', location_id='5f2e2851-1389-425b-a00b-fb2adb3ef31b', version='5.0-preview.1', route_values=route_values) return self._deserialize('[IdentityRef]', self._unwrap_collection(response)) def get_pull_request_iteration_commits(self, repository_id, pull_request_id, iteration_id, project=None): """GetPullRequestIterationCommits. Get the commits for the specified iteration of a pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the iteration from which to get the commits. :param str project: Project ID or project name :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') response = self._send(http_method='GET', location_id='e7ea0883-095f-4926-b5fb-f24691c26fb9', version='5.0', route_values=route_values) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_pull_request_commits(self, repository_id, pull_request_id, project=None): """GetPullRequestCommits. Get the commits for the specified pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [GitCommitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='52823034-34a8-4576-922c-8d8b77e9e4c4', version='5.0', route_values=route_values) return self._deserialize('[GitCommitRef]', self._unwrap_collection(response)) def get_pull_request_iteration_changes(self, repository_id, pull_request_id, iteration_id, project=None, top=None, skip=None, compare_to=None): """GetPullRequestIterationChanges. Retrieve the changes made in a pull request between two iterations. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration.
Iteration IDs are zero-based with zero indicating the common commit between the source and target branches. Iteration one is the head of the source branch at the time the pull request is created and subsequent iterations are created when there are pushes to the source branch. :param str project: Project ID or project name :param int top: Optional. The number of changes to retrieve. The default value is 100 and the maximum value is 2000. :param int skip: Optional. The number of changes to ignore. For example, to retrieve changes 101-150, set top 50 and skip to 100. :param int compare_to: ID of the pull request iteration to compare against. The default value is zero which indicates the comparison is made against the common commit between the source and target branches :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if compare_to is not None: query_parameters['$compareTo'] = self._serialize.query('compare_to', compare_to, 'int') response = self._send(http_method='GET', location_id='4216bdcf-b6b1-4d59-8b82-c34cc183fc8b', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPullRequestIterationChanges', response) def get_pull_request_iteration(self, repository_id, pull_request_id, iteration_id, project=None): """GetPullRequestIteration. Get the specified iteration for a pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration to return. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') response = self._send(http_method='GET', location_id='d43911ee-6958-46b0-a42b-8445b8a0d004', version='5.0', route_values=route_values) return self._deserialize('GitPullRequestIteration', response) def get_pull_request_iterations(self, repository_id, pull_request_id, project=None, include_commits=None): """GetPullRequestIterations. Get the list of iterations for the specified pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :param bool include_commits: If true, include the commits associated with each iteration in the response. :rtype: [GitPullRequestIteration] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') query_parameters = {} if include_commits is not None: query_parameters['includeCommits'] = self._serialize.query('include_commits', include_commits, 'bool') response = self._send(http_method='GET', location_id='d43911ee-6958-46b0-a42b-8445b8a0d004', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequestIteration]', self._unwrap_collection(response)) def create_pull_request_iteration_status(self, status, repository_id, pull_request_id, iteration_id, project=None): """CreatePullRequestIterationStatus. [Preview API] Create a pull request status on the iteration. This operation will have the same result as Create status on pull request with specified iteration ID in the request body. :param :class:` ` status: Pull request status to create. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') content = self._serialize.body(status, 'GitPullRequestStatus') response = self._send(http_method='POST', location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('GitPullRequestStatus', response) def delete_pull_request_iteration_status(self, repository_id, pull_request_id, iteration_id, status_id, project=None): """DeletePullRequestIterationStatus. [Preview API] Delete pull request iteration status. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration. :param int status_id: ID of the pull request status. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') if status_id is not None: route_values['statusId'] = self._serialize.url('status_id', status_id, 'int') self._send(http_method='DELETE', location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', version='5.0-preview.1', route_values=route_values) def get_pull_request_iteration_status(self, repository_id, pull_request_id, iteration_id, status_id, project=None): """GetPullRequestIterationStatus. [Preview API] Get the specific pull request iteration status by ID. The status ID is unique within the pull request across all iterations. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration. :param int status_id: ID of the pull request status. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') if status_id is not None: route_values['statusId'] = self._serialize.url('status_id', status_id, 'int') response = self._send(http_method='GET', location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', version='5.0-preview.1', route_values=route_values) return self._deserialize('GitPullRequestStatus', response) def get_pull_request_iteration_statuses(self, repository_id, pull_request_id, iteration_id, project=None): """GetPullRequestIterationStatuses. [Preview API] Get all the statuses associated with a pull request iteration. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration. :param str project: Project ID or project name :rtype: [GitPullRequestStatus] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') response = self._send(http_method='GET', location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', version='5.0-preview.1', route_values=route_values) return self._deserialize('[GitPullRequestStatus]', self._unwrap_collection(response)) def update_pull_request_iteration_statuses(self, patch_document, repository_id, pull_request_id, iteration_id, project=None): """UpdatePullRequestIterationStatuses. [Preview API] Update pull request iteration statuses collection. The only supported operation type is `remove`. :param :class:`<[JsonPatchOperation]> ` patch_document: Operations to apply to the pull request statuses in JSON Patch format. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param int iteration_id: ID of the pull request iteration. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') content = self._serialize.body(patch_document, '[JsonPatchOperation]') self._send(http_method='PATCH', location_id='75cf11c5-979f-4038-a76e-058a06adf2bf', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') def create_pull_request_label(self, label, repository_id, pull_request_id, project=None, project_id=None): """CreatePullRequestLabel. [Preview API] Create a label for a specified pull request. The only required field is the name of the new label. :param :class:` ` label: Label to assign to the pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :param str project_id: Project ID or project name. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') content = self._serialize.body(label, 'WebApiCreateTagRequestData') response = self._send(http_method='POST', location_id='f22387e3-984e-4c52-9c6d-fbb8f14c812d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('WebApiTagDefinition', response) def delete_pull_request_labels(self, repository_id, pull_request_id, label_id_or_name, project=None, project_id=None): """DeletePullRequestLabels. [Preview API] Removes a label from the set of those assigned to the pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str label_id_or_name: The name or ID of the label requested. :param str project: Project ID or project name :param str project_id: Project ID or project name. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if label_id_or_name is not None: route_values['labelIdOrName'] = self._serialize.url('label_id_or_name', label_id_or_name, 'str') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') self._send(http_method='DELETE', location_id='f22387e3-984e-4c52-9c6d-fbb8f14c812d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) def get_pull_request_label(self, repository_id, pull_request_id, label_id_or_name, project=None, project_id=None): """GetPullRequestLabel. [Preview API] Retrieves a single label that has been assigned to a pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str label_id_or_name: The name or ID of the label requested. :param str project: Project ID or project name :param str project_id: Project ID or project name. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if label_id_or_name is not None: route_values['labelIdOrName'] = self._serialize.url('label_id_or_name', label_id_or_name, 'str') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') response = self._send(http_method='GET', location_id='f22387e3-984e-4c52-9c6d-fbb8f14c812d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WebApiTagDefinition', response) def get_pull_request_labels(self, repository_id, pull_request_id, project=None, project_id=None): """GetPullRequestLabels. [Preview API] Get all the labels assigned to a pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :param str project_id: Project ID or project name. :rtype: [WebApiTagDefinition] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') response = self._send(http_method='GET', location_id='f22387e3-984e-4c52-9c6d-fbb8f14c812d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WebApiTagDefinition]', self._unwrap_collection(response)) def get_pull_request_properties(self, repository_id, pull_request_id, project=None): """GetPullRequestProperties. [Preview API] Get external properties of the pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='48a52185-5b9e-4736-9dc1-bb1e2feac80b', version='5.0-preview.1', route_values=route_values) return self._deserialize('object', response) def update_pull_request_properties(self, patch_document, repository_id, pull_request_id, project=None): """UpdatePullRequestProperties. [Preview API] Create or update pull request external properties. The patch operation can be `add`, `replace` or `remove`. For `add` operation, the path can be empty. If the path is empty, the value must be a list of key value pairs. For `replace` operation, the path cannot be empty. If the path does not exist, the property will be added to the collection. For `remove` operation, the path cannot be empty. If the path does not exist, no action will be performed. :param :class:`<[JsonPatchOperation]> ` patch_document: Properties to add, replace or remove in JSON Patch format. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(patch_document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='48a52185-5b9e-4736-9dc1-bb1e2feac80b', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') return self._deserialize('object', response) def get_pull_request_query(self, queries, repository_id, project=None): """GetPullRequestQuery. This API is used to find what pull requests are related to a given commit. It can be used to either find the pull request that created a particular merge commit or it can be used to find all pull requests that have ever merged a particular commit. The input is a list of queries which each contain a list of commits. For each commit that you search against, you will get back a dictionary of commit -> pull requests. :param :class:` ` queries: The list of queries to perform. :param str repository_id: ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(queries, 'GitPullRequestQuery') response = self._send(http_method='POST', location_id='b3a6eebe-9cf0-49ea-b6cb-1a4c5f5007b0', version='5.0', route_values=route_values, content=content) return self._deserialize('GitPullRequestQuery', response) def create_pull_request_reviewer(self, reviewer, repository_id, pull_request_id, reviewer_id, project=None): """CreatePullRequestReviewer. Add a reviewer to a pull request or cast a vote. :param :class:` ` reviewer: Reviewer's vote.
If the reviewer's ID is included here, it must match the reviewerID parameter.
Reviewers can set their own vote with this method. When adding other reviewers, vote must be set to zero. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str reviewer_id: ID of the reviewer. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if reviewer_id is not None: route_values['reviewerId'] = self._serialize.url('reviewer_id', reviewer_id, 'str') content = self._serialize.body(reviewer, 'IdentityRefWithVote') response = self._send(http_method='PUT', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.0', route_values=route_values, content=content) return self._deserialize('IdentityRefWithVote', response) def create_pull_request_reviewers(self, reviewers, repository_id, pull_request_id, project=None): """CreatePullRequestReviewers. Add reviewers to a pull request. :param [IdentityRef] reviewers: Reviewers to add to the pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [IdentityRefWithVote] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(reviewers, '[IdentityRef]') response = self._send(http_method='POST', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.0', route_values=route_values, content=content) return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) def delete_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): """DeletePullRequestReviewer. Remove a reviewer from a pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str reviewer_id: ID of the reviewer to remove. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if reviewer_id is not None: route_values['reviewerId'] = self._serialize.url('reviewer_id', reviewer_id, 'str') self._send(http_method='DELETE', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.0', route_values=route_values) def get_pull_request_reviewer(self, repository_id, pull_request_id, reviewer_id, project=None): """GetPullRequestReviewer. Retrieve information about a particular reviewer on a pull request :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str reviewer_id: ID of the reviewer. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if reviewer_id is not None: route_values['reviewerId'] = self._serialize.url('reviewer_id', reviewer_id, 'str') response = self._send(http_method='GET', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.0', route_values=route_values) return self._deserialize('IdentityRefWithVote', response) def get_pull_request_reviewers(self, repository_id, pull_request_id, project=None): """GetPullRequestReviewers. Retrieve the reviewers for a pull request :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [IdentityRefWithVote] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.0', route_values=route_values) return self._deserialize('[IdentityRefWithVote]', self._unwrap_collection(response)) def update_pull_request_reviewers(self, patch_votes, repository_id, pull_request_id, project=None): """UpdatePullRequestReviewers. Reset the votes of multiple reviewers on a pull request. NOTE: This endpoint only supports updating votes, but does not support updating required reviewers (use policy) or display names. :param [IdentityRefWithVote] patch_votes: IDs of the reviewers whose votes will be reset to zero :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(patch_votes, '[IdentityRefWithVote]') self._send(http_method='PATCH', location_id='4b6702c7-aa35-4b89-9c96-b9abf6d3e540', version='5.0', route_values=route_values, content=content) def get_pull_request_by_id(self, pull_request_id, project=None): """GetPullRequestById. Retrieve a pull request. :param int pull_request_id: The ID of the pull request to retrieve. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='01a46dea-7d46-4d40-bc84-319e7c260d99', version='5.0', route_values=route_values) return self._deserialize('GitPullRequest', response) def get_pull_requests_by_project(self, project, search_criteria, max_comment_length=None, skip=None, top=None): """GetPullRequestsByProject. Retrieve all pull requests matching a specified criteria. :param str project: Project ID or project name :param :class:` ` search_criteria: Pull requests will be returned that match this search criteria. :param int max_comment_length: Not used. :param int skip: The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. :param int top: The number of pull requests to retrieve. :rtype: [GitPullRequest] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if search_criteria is not None: if search_criteria.repository_id is not None: query_parameters['searchCriteria.repositoryId'] = search_criteria.repository_id if search_criteria.creator_id is not None: query_parameters['searchCriteria.creatorId'] = search_criteria.creator_id if search_criteria.reviewer_id is not None: query_parameters['searchCriteria.reviewerId'] = search_criteria.reviewer_id if search_criteria.status is not None: query_parameters['searchCriteria.status'] = search_criteria.status if search_criteria.target_ref_name is not None: query_parameters['searchCriteria.targetRefName'] = search_criteria.target_ref_name if search_criteria.source_repository_id is not None: query_parameters['searchCriteria.sourceRepositoryId'] = search_criteria.source_repository_id if search_criteria.source_ref_name is not None: query_parameters['searchCriteria.sourceRefName'] = search_criteria.source_ref_name if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='a5d28130-9cd2-40fa-9f08-902e7daa9efb', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequest]', self._unwrap_collection(response)) def create_pull_request(self, git_pull_request_to_create, repository_id, project=None, supports_iterations=None): """CreatePullRequest. Create a pull request. :param :class:` ` git_pull_request_to_create: The pull request to create. :param str repository_id: The repository ID of the pull request's target branch. :param str project: Project ID or project name :param bool supports_iterations: If true, subsequent pushes to the pull request will be individually reviewable. Set this to false for large pull requests for performance reasons if this functionality is not needed. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if supports_iterations is not None: query_parameters['supportsIterations'] = self._serialize.query('supports_iterations', supports_iterations, 'bool') content = self._serialize.body(git_pull_request_to_create, 'GitPullRequest') response = self._send(http_method='POST', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('GitPullRequest', response) def get_pull_request(self, repository_id, pull_request_id, project=None, max_comment_length=None, skip=None, top=None, include_commits=None, include_work_item_refs=None): """GetPullRequest. Retrieve a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: The ID of the pull request to retrieve. :param str project: Project ID or project name :param int max_comment_length: Not used. :param int skip: Not used. :param int top: Not used. :param bool include_commits: If true, the pull request will be returned with the associated commits. :param bool include_work_item_refs: If true, the pull request will be returned with the associated work item references. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') query_parameters = {} if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if include_commits is not None: query_parameters['includeCommits'] = self._serialize.query('include_commits', include_commits, 'bool') if include_work_item_refs is not None: query_parameters['includeWorkItemRefs'] = self._serialize.query('include_work_item_refs', include_work_item_refs, 'bool') response = self._send(http_method='GET', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPullRequest', response) def get_pull_requests(self, repository_id, search_criteria, project=None, max_comment_length=None, skip=None, top=None): """GetPullRequests. Retrieve all pull requests matching a specified criteria. :param str repository_id: The repository ID of the pull request's target branch. :param :class:` ` search_criteria: Pull requests will be returned that match this search criteria. :param str project: Project ID or project name :param int max_comment_length: Not used. :param int skip: The number of pull requests to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. :param int top: The number of pull requests to retrieve. :rtype: [GitPullRequest] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if search_criteria is not None: if search_criteria.repository_id is not None: query_parameters['searchCriteria.repositoryId'] = search_criteria.repository_id if search_criteria.creator_id is not None: query_parameters['searchCriteria.creatorId'] = search_criteria.creator_id if search_criteria.reviewer_id is not None: query_parameters['searchCriteria.reviewerId'] = search_criteria.reviewer_id if search_criteria.status is not None: query_parameters['searchCriteria.status'] = search_criteria.status if search_criteria.target_ref_name is not None: query_parameters['searchCriteria.targetRefName'] = search_criteria.target_ref_name if search_criteria.source_repository_id is not None: query_parameters['searchCriteria.sourceRepositoryId'] = search_criteria.source_repository_id if search_criteria.source_ref_name is not None: query_parameters['searchCriteria.sourceRefName'] = search_criteria.source_ref_name if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequest]', self._unwrap_collection(response)) def update_pull_request(self, git_pull_request_to_update, repository_id, pull_request_id, project=None): """UpdatePullRequest. Update a pull request. :param :class:` ` git_pull_request_to_update: The pull request content to update. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: The ID of the pull request to retrieve. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(git_pull_request_to_update, 'GitPullRequest') response = self._send(http_method='PATCH', location_id='9946fd70-0d40-406e-b686-b4744cbbcc37', version='5.0', route_values=route_values, content=content) return self._deserialize('GitPullRequest', response) def share_pull_request(self, user_message, repository_id, pull_request_id, project=None): """SharePullRequest. [Preview API] Sends an e-mail notification about a specific pull request to a set of recipients :param :class:` ` user_message: :param str repository_id: ID of the git repository. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(user_message, 'ShareNotificationContext') self._send(http_method='POST', location_id='696f3a82-47c9-487f-9117-b9d00972ca84', version='5.0-preview.1', route_values=route_values, content=content) def create_pull_request_status(self, status, repository_id, pull_request_id, project=None): """CreatePullRequestStatus. [Preview API] Create a pull request status. :param :class:` ` status: Pull request status to create. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(status, 'GitPullRequestStatus') response = self._send(http_method='POST', location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('GitPullRequestStatus', response) def delete_pull_request_status(self, repository_id, pull_request_id, status_id, project=None): """DeletePullRequestStatus. [Preview API] Delete pull request status. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param int status_id: ID of the pull request status. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if status_id is not None: route_values['statusId'] = self._serialize.url('status_id', status_id, 'int') self._send(http_method='DELETE', location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', version='5.0-preview.1', route_values=route_values) def get_pull_request_status(self, repository_id, pull_request_id, status_id, project=None): """GetPullRequestStatus. [Preview API] Get the specific pull request status by ID. The status ID is unique within the pull request across all iterations. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param int status_id: ID of the pull request status. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if status_id is not None: route_values['statusId'] = self._serialize.url('status_id', status_id, 'int') response = self._send(http_method='GET', location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', version='5.0-preview.1', route_values=route_values) return self._deserialize('GitPullRequestStatus', response) def get_pull_request_statuses(self, repository_id, pull_request_id, project=None): """GetPullRequestStatuses. [Preview API] Get all the statuses associated with a pull request. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [GitPullRequestStatus] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', version='5.0-preview.1', route_values=route_values) return self._deserialize('[GitPullRequestStatus]', self._unwrap_collection(response)) def update_pull_request_statuses(self, patch_document, repository_id, pull_request_id, project=None): """UpdatePullRequestStatuses. [Preview API] Update pull request statuses collection. The only supported operation type is `remove`. :param :class:`<[JsonPatchOperation]> ` patch_document: Operations to apply to the pull request statuses in JSON Patch format. :param str repository_id: The repository ID of the pull request’s target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(patch_document, '[JsonPatchOperation]') self._send(http_method='PATCH', location_id='b5f6bb4f-8d1e-4d79-8d11-4c9172c99c35', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') def create_comment(self, comment, repository_id, pull_request_id, thread_id, project=None): """CreateComment. Create a comment on a specific thread in a pull request. :param :class:` ` comment: The comment to create. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') content = self._serialize.body(comment, 'Comment') response = self._send(http_method='POST', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.0', route_values=route_values, content=content) return self._deserialize('Comment', response) def delete_comment(self, repository_id, pull_request_id, thread_id, comment_id, project=None): """DeleteComment. Delete a comment associated with a specific thread in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param int comment_id: ID of the comment. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') if comment_id is not None: route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') self._send(http_method='DELETE', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.0', route_values=route_values) def get_comment(self, repository_id, pull_request_id, thread_id, comment_id, project=None): """GetComment. Retrieve a comment associated with a specific thread in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param int comment_id: ID of the comment. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') if comment_id is not None: route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') response = self._send(http_method='GET', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.0', route_values=route_values) return self._deserialize('Comment', response) def get_comments(self, repository_id, pull_request_id, thread_id, project=None): """GetComments. Retrieve all comments associated with a specific thread in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread. :param str project: Project ID or project name :rtype: [Comment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') response = self._send(http_method='GET', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.0', route_values=route_values) return self._deserialize('[Comment]', self._unwrap_collection(response)) def update_comment(self, comment, repository_id, pull_request_id, thread_id, comment_id, project=None): """UpdateComment. Update a comment associated with a specific thread in a pull request. :param :class:` ` comment: The comment content that should be updated. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread that the desired comment is in. :param int comment_id: ID of the comment to update. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') if comment_id is not None: route_values['commentId'] = self._serialize.url('comment_id', comment_id, 'int') content = self._serialize.body(comment, 'Comment') response = self._send(http_method='PATCH', location_id='965a3ec7-5ed8-455a-bdcb-835a5ea7fe7b', version='5.0', route_values=route_values, content=content) return self._deserialize('Comment', response) def create_thread(self, comment_thread, repository_id, pull_request_id, project=None): """CreateThread. Create a thread in a pull request. :param :class:` ` comment_thread: The thread to create. Thread must contain at least one comment. :param str repository_id: Repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') content = self._serialize.body(comment_thread, 'GitPullRequestCommentThread') response = self._send(http_method='POST', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', version='5.0', route_values=route_values, content=content) return self._deserialize('GitPullRequestCommentThread', response) def get_pull_request_thread(self, repository_id, pull_request_id, thread_id, project=None, iteration=None, base_iteration=None): """GetPullRequestThread. Retrieve a thread in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread. :param str project: Project ID or project name :param int iteration: If specified, thread position will be tracked using this iteration as the right side of the diff. :param int base_iteration: If specified, thread position will be tracked using this iteration as the left side of the diff. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') query_parameters = {} if iteration is not None: query_parameters['$iteration'] = self._serialize.query('iteration', iteration, 'int') if base_iteration is not None: query_parameters['$baseIteration'] = self._serialize.query('base_iteration', base_iteration, 'int') response = self._send(http_method='GET', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPullRequestCommentThread', response) def get_threads(self, repository_id, pull_request_id, project=None, iteration=None, base_iteration=None): """GetThreads. Retrieve all threads in a pull request. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :param int iteration: If specified, thread positions will be tracked using this iteration as the right side of the diff. :param int base_iteration: If specified, thread positions will be tracked using this iteration as the left side of the diff. :rtype: [GitPullRequestCommentThread] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') query_parameters = {} if iteration is not None: query_parameters['$iteration'] = self._serialize.query('iteration', iteration, 'int') if base_iteration is not None: query_parameters['$baseIteration'] = self._serialize.query('base_iteration', base_iteration, 'int') response = self._send(http_method='GET', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPullRequestCommentThread]', self._unwrap_collection(response)) def update_thread(self, comment_thread, repository_id, pull_request_id, thread_id, project=None): """UpdateThread. Update a thread in a pull request. :param :class:` ` comment_thread: The thread content that should be updated. :param str repository_id: The repository ID of the pull request's target branch. :param int pull_request_id: ID of the pull request. :param int thread_id: ID of the thread to update. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') if thread_id is not None: route_values['threadId'] = self._serialize.url('thread_id', thread_id, 'int') content = self._serialize.body(comment_thread, 'GitPullRequestCommentThread') response = self._send(http_method='PATCH', location_id='ab6e2e5d-a0b7-4153-b64a-a4efe0d49449', version='5.0', route_values=route_values, content=content) return self._deserialize('GitPullRequestCommentThread', response) def get_pull_request_work_item_refs(self, repository_id, pull_request_id, project=None): """GetPullRequestWorkItemRefs. Retrieve a list of work items associated with a pull request. :param str repository_id: ID or name of the repository. :param int pull_request_id: ID of the pull request. :param str project: Project ID or project name :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'int') response = self._send(http_method='GET', location_id='0a637fcc-5370-4ce8-b0e8-98091f5f9482', version='5.0', route_values=route_values) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) def create_push(self, push, repository_id, project=None): """CreatePush. Push changes to the repository. :param :class:` ` push: :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(push, 'GitPush') response = self._send(http_method='POST', location_id='ea98d07b-3c87-4971-8ede-a613694ffb55', version='5.0', route_values=route_values, content=content) return self._deserialize('GitPush', response) def get_push(self, repository_id, push_id, project=None, include_commits=None, include_ref_updates=None): """GetPush. Retrieves a particular push. :param str repository_id: The name or ID of the repository. :param int push_id: ID of the push. :param str project: Project ID or project name :param int include_commits: The number of commits to include in the result. :param bool include_ref_updates: If true, include the list of refs that were updated by the push. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if push_id is not None: route_values['pushId'] = self._serialize.url('push_id', push_id, 'int') query_parameters = {} if include_commits is not None: query_parameters['includeCommits'] = self._serialize.query('include_commits', include_commits, 'int') if include_ref_updates is not None: query_parameters['includeRefUpdates'] = self._serialize.query('include_ref_updates', include_ref_updates, 'bool') response = self._send(http_method='GET', location_id='ea98d07b-3c87-4971-8ede-a613694ffb55', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitPush', response) def get_pushes(self, repository_id, project=None, skip=None, top=None, search_criteria=None): """GetPushes. Retrieves pushes associated with the specified repository. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param int skip: Number of pushes to skip. :param int top: Number of pushes to return. :param :class:` ` search_criteria: Search criteria attributes: fromDate, toDate, pusherId, refName, includeRefUpdates or includeLinks. fromDate: Start date to search from. toDate: End date to search to. pusherId: Identity of the person who submitted the push. refName: Branch name to consider. includeRefUpdates: If true, include the list of refs that were updated by the push. includeLinks: Whether to include the _links field on the shallow references. :rtype: [GitPush] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if search_criteria is not None: if search_criteria.from_date is not None: query_parameters['searchCriteria.fromDate'] = search_criteria.from_date if search_criteria.to_date is not None: query_parameters['searchCriteria.toDate'] = search_criteria.to_date if search_criteria.pusher_id is not None: query_parameters['searchCriteria.pusherId'] = search_criteria.pusher_id if search_criteria.ref_name is not None: query_parameters['searchCriteria.refName'] = search_criteria.ref_name if search_criteria.include_ref_updates is not None: query_parameters['searchCriteria.includeRefUpdates'] = search_criteria.include_ref_updates if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links response = self._send(http_method='GET', location_id='ea98d07b-3c87-4971-8ede-a613694ffb55', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitPush]', self._unwrap_collection(response)) def delete_repository_from_recycle_bin(self, project, repository_id): """DeleteRepositoryFromRecycleBin. [Preview API] Destroy (hard delete) a soft-deleted Git repository. :param str project: Project ID or project name :param str repository_id: The ID of the repository. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') self._send(http_method='DELETE', location_id='a663da97-81db-4eb3-8b83-287670f63073', version='5.0-preview.1', route_values=route_values) def get_recycle_bin_repositories(self, project): """GetRecycleBinRepositories. [Preview API] Retrieve soft-deleted git repositories from the recycle bin. :param str project: Project ID or project name :rtype: [GitDeletedRepository] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='a663da97-81db-4eb3-8b83-287670f63073', version='5.0-preview.1', route_values=route_values) return self._deserialize('[GitDeletedRepository]', self._unwrap_collection(response)) def restore_repository_from_recycle_bin(self, repository_details, project, repository_id): """RestoreRepositoryFromRecycleBin. [Preview API] Recover a soft-deleted Git repository. Recently deleted repositories go into a soft-delete state for a period of time before they are hard deleted and become unrecoverable. :param :class:` ` repository_details: :param str project: Project ID or project name :param str repository_id: The ID of the repository. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(repository_details, 'GitRecycleBinRepositoryDetails') response = self._send(http_method='PATCH', location_id='a663da97-81db-4eb3-8b83-287670f63073', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('GitRepository', response) def get_refs(self, repository_id, project=None, filter=None, include_links=None, include_statuses=None, include_my_branches=None, latest_statuses_only=None, peel_tags=None, filter_contains=None): """GetRefs. Queries the provided repository for its refs and returns them. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param str filter: [optional] A filter to apply to the refs (starts with). :param bool include_links: [optional] Specifies if referenceLinks should be included in the result. default is false. :param bool include_statuses: [optional] Includes up to the first 1000 commit statuses for each ref. The default value is false. :param bool include_my_branches: [optional] Includes only branches that the user owns, the branches the user favorites, and the default branch. The default value is false. Cannot be combined with the filter parameter. :param bool latest_statuses_only: [optional] True to include only the tip commit status for each ref. This option requires `includeStatuses` to be true. The default value is false. :param bool peel_tags: [optional] Annotated tags will populate the PeeledObjectId property. default is false. :param str filter_contains: [optional] A filter to apply to the refs (contains). :rtype: [GitRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if filter is not None: query_parameters['filter'] = self._serialize.query('filter', filter, 'str') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') if include_statuses is not None: query_parameters['includeStatuses'] = self._serialize.query('include_statuses', include_statuses, 'bool') if include_my_branches is not None: query_parameters['includeMyBranches'] = self._serialize.query('include_my_branches', include_my_branches, 'bool') if latest_statuses_only is not None: query_parameters['latestStatusesOnly'] = self._serialize.query('latest_statuses_only', latest_statuses_only, 'bool') if peel_tags is not None: query_parameters['peelTags'] = self._serialize.query('peel_tags', peel_tags, 'bool') if filter_contains is not None: query_parameters['filterContains'] = self._serialize.query('filter_contains', filter_contains, 'str') response = self._send(http_method='GET', location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitRef]', self._unwrap_collection(response)) def update_ref(self, new_ref_info, repository_id, filter, project=None, project_id=None): """UpdateRef. Lock or Unlock a branch. :param :class:` ` new_ref_info: The ref update action (lock/unlock) to perform :param str repository_id: The name or ID of the repository. :param str filter: The name of the branch to lock/unlock :param str project: Project ID or project name :param str project_id: ID or name of the team project. Optional if specifying an ID for repository. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if filter is not None: query_parameters['filter'] = self._serialize.query('filter', filter, 'str') if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') content = self._serialize.body(new_ref_info, 'GitRefUpdate') response = self._send(http_method='PATCH', location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('GitRef', response) def update_refs(self, ref_updates, repository_id, project=None, project_id=None): """UpdateRefs. Creating, updating, or deleting refs(branches). :param [GitRefUpdate] ref_updates: List of ref updates to attempt to perform :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :param str project_id: ID or name of the team project. Optional if specifying an ID for repository. :rtype: [GitRefUpdateResult] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') content = self._serialize.body(ref_updates, '[GitRefUpdate]') response = self._send(http_method='POST', location_id='2d874a60-a811-4f62-9c9f-963a6ea0a55b', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[GitRefUpdateResult]', self._unwrap_collection(response)) def create_favorite(self, favorite, project): """CreateFavorite. [Preview API] Creates a ref favorite :param :class:` ` favorite: The ref favorite to create. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(favorite, 'GitRefFavorite') response = self._send(http_method='POST', location_id='876f70af-5792-485a-a1c7-d0a7b2f42bbb', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('GitRefFavorite', response) def delete_ref_favorite(self, project, favorite_id): """DeleteRefFavorite. [Preview API] Deletes the refs favorite specified :param str project: Project ID or project name :param int favorite_id: The Id of the ref favorite to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if favorite_id is not None: route_values['favoriteId'] = self._serialize.url('favorite_id', favorite_id, 'int') self._send(http_method='DELETE', location_id='876f70af-5792-485a-a1c7-d0a7b2f42bbb', version='5.0-preview.1', route_values=route_values) def get_ref_favorite(self, project, favorite_id): """GetRefFavorite. [Preview API] Gets the refs favorite for a favorite Id. :param str project: Project ID or project name :param int favorite_id: The Id of the requested ref favorite. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if favorite_id is not None: route_values['favoriteId'] = self._serialize.url('favorite_id', favorite_id, 'int') response = self._send(http_method='GET', location_id='876f70af-5792-485a-a1c7-d0a7b2f42bbb', version='5.0-preview.1', route_values=route_values) return self._deserialize('GitRefFavorite', response) def get_ref_favorites(self, project, repository_id=None, identity_id=None): """GetRefFavorites. [Preview API] Gets the refs favorites for a repo and an identity. :param str project: Project ID or project name :param str repository_id: The id of the repository. :param str identity_id: The id of the identity whose favorites are to be retrieved. If null, the requesting identity is used. :rtype: [GitRefFavorite] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if identity_id is not None: query_parameters['identityId'] = self._serialize.query('identity_id', identity_id, 'str') response = self._send(http_method='GET', location_id='876f70af-5792-485a-a1c7-d0a7b2f42bbb', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitRefFavorite]', self._unwrap_collection(response)) def create_repository(self, git_repository_to_create, project=None, source_ref=None): """CreateRepository. Create a git repository in a team project. :param :class:` ` git_repository_to_create: Specify the repo name, team project and/or parent repository. Team project information can be ommitted from gitRepositoryToCreate if the request is project-scoped (i.e., includes project Id). :param str project: Project ID or project name :param str source_ref: [optional] Specify the source refs to use while creating a fork repo :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if source_ref is not None: query_parameters['sourceRef'] = self._serialize.query('source_ref', source_ref, 'str') content = self._serialize.body(git_repository_to_create, 'GitRepositoryCreateOptions') response = self._send(http_method='POST', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('GitRepository', response) def delete_repository(self, repository_id, project=None): """DeleteRepository. Delete a git repository :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') self._send(http_method='DELETE', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.0', route_values=route_values) def get_repositories(self, project=None, include_links=None, include_all_urls=None, include_hidden=None): """GetRepositories. Retrieve git repositories. :param str project: Project ID or project name :param bool include_links: [optional] True to include reference links. The default value is false. :param bool include_all_urls: [optional] True to include all remote URLs. The default value is false. :param bool include_hidden: [optional] True to include hidden repositories. The default value is false. :rtype: [GitRepository] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') if include_all_urls is not None: query_parameters['includeAllUrls'] = self._serialize.query('include_all_urls', include_all_urls, 'bool') if include_hidden is not None: query_parameters['includeHidden'] = self._serialize.query('include_hidden', include_hidden, 'bool') response = self._send(http_method='GET', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitRepository]', self._unwrap_collection(response)) def get_repository(self, repository_id, project=None): """GetRepository. Retrieve a git repository. :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') response = self._send(http_method='GET', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.0', route_values=route_values) return self._deserialize('GitRepository', response) def get_repository_with_parent(self, repository_id, include_parent, project=None): """GetRepositoryWithParent. Retrieve a git repository. :param str repository_id: The name or ID of the repository. :param bool include_parent: True to include parent repository. Only available in authenticated calls. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if include_parent is not None: query_parameters['includeParent'] = self._serialize.query('include_parent', include_parent, 'bool') response = self._send(http_method='GET', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitRepository', response) def update_repository(self, new_repository_info, repository_id, project=None): """UpdateRepository. Updates the Git repository with either a new repo name or a new default branch. :param :class:` ` new_repository_info: Specify a new repo name or a new default branch of the repository :param str repository_id: The name or ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(new_repository_info, 'GitRepository') response = self._send(http_method='PATCH', location_id='225f7195-f9c7-4d14-ab28-a83f7ff77e1f', version='5.0', route_values=route_values, content=content) return self._deserialize('GitRepository', response) def create_revert(self, revert_to_create, project, repository_id): """CreateRevert. [Preview API] Starts the operation to create a new branch which reverts changes introduced by either a specific commit or commits that are associated to a pull request. :param :class:` ` revert_to_create: :param str project: Project ID or project name :param str repository_id: ID of the repository. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(revert_to_create, 'GitAsyncRefOperationParameters') response = self._send(http_method='POST', location_id='bc866058-5449-4715-9cf1-a510b6ff193c', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('GitRevert', response) def get_revert(self, project, revert_id, repository_id): """GetRevert. [Preview API] Retrieve information about a revert operation by revert Id. :param str project: Project ID or project name :param int revert_id: ID of the revert operation. :param str repository_id: ID of the repository. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if revert_id is not None: route_values['revertId'] = self._serialize.url('revert_id', revert_id, 'int') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') response = self._send(http_method='GET', location_id='bc866058-5449-4715-9cf1-a510b6ff193c', version='5.0-preview.1', route_values=route_values) return self._deserialize('GitRevert', response) def get_revert_for_ref_name(self, project, repository_id, ref_name): """GetRevertForRefName. [Preview API] Retrieve information about a revert operation for a specific branch. :param str project: Project ID or project name :param str repository_id: ID of the repository. :param str ref_name: The GitAsyncRefOperationParameters generatedRefName used for the revert operation. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if ref_name is not None: query_parameters['refName'] = self._serialize.query('ref_name', ref_name, 'str') response = self._send(http_method='GET', location_id='bc866058-5449-4715-9cf1-a510b6ff193c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitRevert', response) def create_commit_status(self, git_commit_status_to_create, commit_id, repository_id, project=None): """CreateCommitStatus. Create Git commit status. :param :class:` ` git_commit_status_to_create: Git commit status object to create. :param str commit_id: ID of the Git commit. :param str repository_id: ID of the repository. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if commit_id is not None: route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') content = self._serialize.body(git_commit_status_to_create, 'GitStatus') response = self._send(http_method='POST', location_id='428dd4fb-fda5-4722-af02-9313b80305da', version='5.0', route_values=route_values, content=content) return self._deserialize('GitStatus', response) def get_statuses(self, commit_id, repository_id, project=None, top=None, skip=None, latest_only=None): """GetStatuses. Get statuses associated with the Git commit. :param str commit_id: ID of the Git commit. :param str repository_id: ID of the repository. :param str project: Project ID or project name :param int top: Optional. The number of statuses to retrieve. Default is 1000. :param int skip: Optional. The number of statuses to ignore. Default is 0. For example, to retrieve results 101-150, set top to 50 and skip to 100. :param bool latest_only: The flag indicates whether to get only latest statuses grouped by `Context.Name` and `Context.Genre`. :rtype: [GitStatus] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if commit_id is not None: route_values['commitId'] = self._serialize.url('commit_id', commit_id, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['skip'] = self._serialize.query('skip', skip, 'int') if latest_only is not None: query_parameters['latestOnly'] = self._serialize.query('latest_only', latest_only, 'bool') response = self._send(http_method='GET', location_id='428dd4fb-fda5-4722-af02-9313b80305da', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GitStatus]', self._unwrap_collection(response)) def get_suggestions(self, repository_id, project=None): """GetSuggestions. [Preview API] Retrieve a pull request suggestion for a particular repository or team project. :param str repository_id: ID of the git repository. :param str project: Project ID or project name :rtype: [GitSuggestion] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') response = self._send(http_method='GET', location_id='9393b4fb-4445-4919-972b-9ad16f442d83', version='5.0-preview.1', route_values=route_values) return self._deserialize('[GitSuggestion]', self._unwrap_collection(response)) def get_tree(self, repository_id, sha1, project=None, project_id=None, recursive=None, file_name=None): """GetTree. The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository. :param str repository_id: Repository Id. :param str sha1: SHA1 hash of the tree object. :param str project: Project ID or project name :param str project_id: Project Id. :param bool recursive: Search recursively. Include trees underneath this tree. Default is false. :param str file_name: Name to use if a .zip file is returned. Default is the object ID. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') if recursive is not None: query_parameters['recursive'] = self._serialize.query('recursive', recursive, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='729f6437-6f92-44ec-8bee-273a7111063c', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GitTreeRef', response) def get_tree_zip(self, repository_id, sha1, project=None, project_id=None, recursive=None, file_name=None, **kwargs): """GetTreeZip. The Tree endpoint returns the collection of objects underneath the specified tree. Trees are folders in a Git repository. :param str repository_id: Repository Id. :param str sha1: SHA1 hash of the tree object. :param str project: Project ID or project name :param str project_id: Project Id. :param bool recursive: Search recursively. Include trees underneath this tree. Default is false. :param str file_name: Name to use if a .zip file is returned. Default is the object ID. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') if sha1 is not None: route_values['sha1'] = self._serialize.url('sha1', sha1, 'str') query_parameters = {} if project_id is not None: query_parameters['projectId'] = self._serialize.query('project_id', project_id, 'str') if recursive is not None: query_parameters['recursive'] = self._serialize.query('recursive', recursive, 'bool') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='729f6437-6f92-44ec-8bee-273a7111063c', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/git/models.py000066400000000000000000004722571360605530400315160ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class Attachment(Model): """Attachment. :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param author: The person that uploaded this attachment. :type author: :class:`IdentityRef ` :param content_hash: Content hash of on-disk representation of file content. Its calculated by the server by using SHA1 hash function. :type content_hash: str :param created_date: The time the attachment was uploaded. :type created_date: datetime :param description: The description of the attachment. :type description: str :param display_name: The display name of the attachment. Can't be null or empty. :type display_name: str :param id: Id of the attachment. :type id: int :param properties: Extended properties. :type properties: :class:`object ` :param url: The url to download the content of the attachment. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'IdentityRef'}, 'content_hash': {'key': 'contentHash', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'properties': {'key': 'properties', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, author=None, content_hash=None, created_date=None, description=None, display_name=None, id=None, properties=None, url=None): super(Attachment, self).__init__() self._links = _links self.author = author self.content_hash = content_hash self.created_date = created_date self.description = description self.display_name = display_name self.id = id self.properties = properties self.url = url class Change(Model): """Change. :param change_type: The type of change that was made to the item. :type change_type: object :param item: Current version. :type item: object :param new_content: Content of the item after the change. :type new_content: :class:`ItemContent ` :param source_server_item: Path of the item on the server. :type source_server_item: str :param url: URL to retrieve the item. :type url: str """ _attribute_map = { 'change_type': {'key': 'changeType', 'type': 'object'}, 'item': {'key': 'item', 'type': 'object'}, 'new_content': {'key': 'newContent', 'type': 'ItemContent'}, 'source_server_item': {'key': 'sourceServerItem', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, change_type=None, item=None, new_content=None, source_server_item=None, url=None): super(Change, self).__init__() self.change_type = change_type self.item = item self.new_content = new_content self.source_server_item = source_server_item self.url = url class Comment(Model): """Comment. :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param author: The author of the comment. :type author: :class:`IdentityRef ` :param comment_type: The comment type at the time of creation. :type comment_type: object :param content: The comment content. :type content: str :param id: The comment ID. IDs start at 1 and are unique to a pull request. :type id: int :param is_deleted: Whether or not this comment was soft-deleted. :type is_deleted: bool :param last_content_updated_date: The date the comment's content was last updated. :type last_content_updated_date: datetime :param last_updated_date: The date the comment was last updated. :type last_updated_date: datetime :param parent_comment_id: The ID of the parent comment. This is used for replies. :type parent_comment_id: int :param published_date: The date the comment was first published. :type published_date: datetime :param users_liked: A list of the users who have liked this comment. :type users_liked: list of :class:`IdentityRef ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'IdentityRef'}, 'comment_type': {'key': 'commentType', 'type': 'object'}, 'content': {'key': 'content', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'last_content_updated_date': {'key': 'lastContentUpdatedDate', 'type': 'iso-8601'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'parent_comment_id': {'key': 'parentCommentId', 'type': 'int'}, 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, 'users_liked': {'key': 'usersLiked', 'type': '[IdentityRef]'} } def __init__(self, _links=None, author=None, comment_type=None, content=None, id=None, is_deleted=None, last_content_updated_date=None, last_updated_date=None, parent_comment_id=None, published_date=None, users_liked=None): super(Comment, self).__init__() self._links = _links self.author = author self.comment_type = comment_type self.content = content self.id = id self.is_deleted = is_deleted self.last_content_updated_date = last_content_updated_date self.last_updated_date = last_updated_date self.parent_comment_id = parent_comment_id self.published_date = published_date self.users_liked = users_liked class CommentIterationContext(Model): """CommentIterationContext. :param first_comparing_iteration: The iteration of the file on the left side of the diff when the thread was created. If this value is equal to SecondComparingIteration, then this version is the common commit between the source and target branches of the pull request. :type first_comparing_iteration: int :param second_comparing_iteration: The iteration of the file on the right side of the diff when the thread was created. :type second_comparing_iteration: int """ _attribute_map = { 'first_comparing_iteration': {'key': 'firstComparingIteration', 'type': 'int'}, 'second_comparing_iteration': {'key': 'secondComparingIteration', 'type': 'int'} } def __init__(self, first_comparing_iteration=None, second_comparing_iteration=None): super(CommentIterationContext, self).__init__() self.first_comparing_iteration = first_comparing_iteration self.second_comparing_iteration = second_comparing_iteration class CommentPosition(Model): """CommentPosition. :param line: The line number of a thread's position. Starts at 1. :type line: int :param offset: The character offset of a thread's position inside of a line. Starts at 0. :type offset: int """ _attribute_map = { 'line': {'key': 'line', 'type': 'int'}, 'offset': {'key': 'offset', 'type': 'int'} } def __init__(self, line=None, offset=None): super(CommentPosition, self).__init__() self.line = line self.offset = offset class CommentThread(Model): """CommentThread. :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param comments: A list of the comments. :type comments: list of :class:`Comment ` :param id: The comment thread id. :type id: int :param identities: Set of identities related to this thread :type identities: dict :param is_deleted: Specify if the thread is deleted which happens when all comments are deleted. :type is_deleted: bool :param last_updated_date: The time this thread was last updated. :type last_updated_date: datetime :param properties: Optional properties associated with the thread as a collection of key-value pairs. :type properties: :class:`object ` :param published_date: The time this thread was published. :type published_date: datetime :param status: The status of the comment thread. :type status: object :param thread_context: Specify thread context such as position in left/right file. :type thread_context: :class:`CommentThreadContext ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'comments': {'key': 'comments', 'type': '[Comment]'}, 'id': {'key': 'id', 'type': 'int'}, 'identities': {'key': 'identities', 'type': '{IdentityRef}'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'properties': {'key': 'properties', 'type': 'object'}, 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'thread_context': {'key': 'threadContext', 'type': 'CommentThreadContext'} } def __init__(self, _links=None, comments=None, id=None, identities=None, is_deleted=None, last_updated_date=None, properties=None, published_date=None, status=None, thread_context=None): super(CommentThread, self).__init__() self._links = _links self.comments = comments self.id = id self.identities = identities self.is_deleted = is_deleted self.last_updated_date = last_updated_date self.properties = properties self.published_date = published_date self.status = status self.thread_context = thread_context class CommentThreadContext(Model): """CommentThreadContext. :param file_path: File path relative to the root of the repository. It's up to the client to use any path format. :type file_path: str :param left_file_end: Position of last character of the thread's span in left file. :type left_file_end: :class:`CommentPosition ` :param left_file_start: Position of first character of the thread's span in left file. :type left_file_start: :class:`CommentPosition ` :param right_file_end: Position of last character of the thread's span in right file. :type right_file_end: :class:`CommentPosition ` :param right_file_start: Position of first character of the thread's span in right file. :type right_file_start: :class:`CommentPosition ` """ _attribute_map = { 'file_path': {'key': 'filePath', 'type': 'str'}, 'left_file_end': {'key': 'leftFileEnd', 'type': 'CommentPosition'}, 'left_file_start': {'key': 'leftFileStart', 'type': 'CommentPosition'}, 'right_file_end': {'key': 'rightFileEnd', 'type': 'CommentPosition'}, 'right_file_start': {'key': 'rightFileStart', 'type': 'CommentPosition'} } def __init__(self, file_path=None, left_file_end=None, left_file_start=None, right_file_end=None, right_file_start=None): super(CommentThreadContext, self).__init__() self.file_path = file_path self.left_file_end = left_file_end self.left_file_start = left_file_start self.right_file_end = right_file_end self.right_file_start = right_file_start class CommentTrackingCriteria(Model): """CommentTrackingCriteria. :param first_comparing_iteration: The iteration of the file on the left side of the diff that the thread will be tracked to. Threads were tracked if this is greater than 0. :type first_comparing_iteration: int :param orig_file_path: Original filepath the thread was created on before tracking. This will be different than the current thread filepath if the file in question was renamed in a later iteration. :type orig_file_path: str :param orig_left_file_end: Original position of last character of the thread's span in left file. :type orig_left_file_end: :class:`CommentPosition ` :param orig_left_file_start: Original position of first character of the thread's span in left file. :type orig_left_file_start: :class:`CommentPosition ` :param orig_right_file_end: Original position of last character of the thread's span in right file. :type orig_right_file_end: :class:`CommentPosition ` :param orig_right_file_start: Original position of first character of the thread's span in right file. :type orig_right_file_start: :class:`CommentPosition ` :param second_comparing_iteration: The iteration of the file on the right side of the diff that the thread will be tracked to. Threads were tracked if this is greater than 0. :type second_comparing_iteration: int """ _attribute_map = { 'first_comparing_iteration': {'key': 'firstComparingIteration', 'type': 'int'}, 'orig_file_path': {'key': 'origFilePath', 'type': 'str'}, 'orig_left_file_end': {'key': 'origLeftFileEnd', 'type': 'CommentPosition'}, 'orig_left_file_start': {'key': 'origLeftFileStart', 'type': 'CommentPosition'}, 'orig_right_file_end': {'key': 'origRightFileEnd', 'type': 'CommentPosition'}, 'orig_right_file_start': {'key': 'origRightFileStart', 'type': 'CommentPosition'}, 'second_comparing_iteration': {'key': 'secondComparingIteration', 'type': 'int'} } def __init__(self, first_comparing_iteration=None, orig_file_path=None, orig_left_file_end=None, orig_left_file_start=None, orig_right_file_end=None, orig_right_file_start=None, second_comparing_iteration=None): super(CommentTrackingCriteria, self).__init__() self.first_comparing_iteration = first_comparing_iteration self.orig_file_path = orig_file_path self.orig_left_file_end = orig_left_file_end self.orig_left_file_start = orig_left_file_start self.orig_right_file_end = orig_right_file_end self.orig_right_file_start = orig_right_file_start self.second_comparing_iteration = second_comparing_iteration class FileContentMetadata(Model): """FileContentMetadata. :param content_type: :type content_type: str :param encoding: :type encoding: int :param extension: :type extension: str :param file_name: :type file_name: str :param is_binary: :type is_binary: bool :param is_image: :type is_image: bool :param vs_link: :type vs_link: str """ _attribute_map = { 'content_type': {'key': 'contentType', 'type': 'str'}, 'encoding': {'key': 'encoding', 'type': 'int'}, 'extension': {'key': 'extension', 'type': 'str'}, 'file_name': {'key': 'fileName', 'type': 'str'}, 'is_binary': {'key': 'isBinary', 'type': 'bool'}, 'is_image': {'key': 'isImage', 'type': 'bool'}, 'vs_link': {'key': 'vsLink', 'type': 'str'} } def __init__(self, content_type=None, encoding=None, extension=None, file_name=None, is_binary=None, is_image=None, vs_link=None): super(FileContentMetadata, self).__init__() self.content_type = content_type self.encoding = encoding self.extension = extension self.file_name = file_name self.is_binary = is_binary self.is_image = is_image self.vs_link = vs_link class FileDiff(Model): """FileDiff. :param line_diff_blocks: The collection of line diff blocks :type line_diff_blocks: list of :class:`LineDiffBlock ` :param original_path: Original path of item if different from current path. :type original_path: str :param path: Current path of item :type path: str """ _attribute_map = { 'line_diff_blocks': {'key': 'lineDiffBlocks', 'type': '[LineDiffBlock]'}, 'original_path': {'key': 'originalPath', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, line_diff_blocks=None, original_path=None, path=None): super(FileDiff, self).__init__() self.line_diff_blocks = line_diff_blocks self.original_path = original_path self.path = path class FileDiffParams(Model): """FileDiffParams. :param original_path: Original path of the file :type original_path: str :param path: Current path of the file :type path: str """ _attribute_map = { 'original_path': {'key': 'originalPath', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, original_path=None, path=None): super(FileDiffParams, self).__init__() self.original_path = original_path self.path = path class FileDiffsCriteria(Model): """FileDiffsCriteria. :param base_version_commit: Commit ID of the base version :type base_version_commit: str :param file_diff_params: List of parameters for each of the files for which we need to get the file diff :type file_diff_params: list of :class:`FileDiffParams ` :param target_version_commit: Commit ID of the target version :type target_version_commit: str """ _attribute_map = { 'base_version_commit': {'key': 'baseVersionCommit', 'type': 'str'}, 'file_diff_params': {'key': 'fileDiffParams', 'type': '[FileDiffParams]'}, 'target_version_commit': {'key': 'targetVersionCommit', 'type': 'str'} } def __init__(self, base_version_commit=None, file_diff_params=None, target_version_commit=None): super(FileDiffsCriteria, self).__init__() self.base_version_commit = base_version_commit self.file_diff_params = file_diff_params self.target_version_commit = target_version_commit class GitAnnotatedTag(Model): """GitAnnotatedTag. :param message: The tagging Message :type message: str :param name: The name of the annotated tag. :type name: str :param object_id: The objectId (Sha1Id) of the tag. :type object_id: str :param tagged_by: User info and date of tagging. :type tagged_by: :class:`GitUserDate ` :param tagged_object: Tagged git object. :type tagged_object: :class:`GitObject ` :param url: :type url: str """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'object_id': {'key': 'objectId', 'type': 'str'}, 'tagged_by': {'key': 'taggedBy', 'type': 'GitUserDate'}, 'tagged_object': {'key': 'taggedObject', 'type': 'GitObject'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, message=None, name=None, object_id=None, tagged_by=None, tagged_object=None, url=None): super(GitAnnotatedTag, self).__init__() self.message = message self.name = name self.object_id = object_id self.tagged_by = tagged_by self.tagged_object = tagged_object self.url = url class GitAsyncRefOperation(Model): """GitAsyncRefOperation. :param _links: :type _links: :class:`ReferenceLinks ` :param detailed_status: :type detailed_status: :class:`GitAsyncRefOperationDetail ` :param parameters: :type parameters: :class:`GitAsyncRefOperationParameters ` :param status: :type status: object :param url: A URL that can be used to make further requests for status about the operation :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'detailed_status': {'key': 'detailedStatus', 'type': 'GitAsyncRefOperationDetail'}, 'parameters': {'key': 'parameters', 'type': 'GitAsyncRefOperationParameters'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, detailed_status=None, parameters=None, status=None, url=None): super(GitAsyncRefOperation, self).__init__() self._links = _links self.detailed_status = detailed_status self.parameters = parameters self.status = status self.url = url class GitAsyncRefOperationDetail(Model): """GitAsyncRefOperationDetail. :param conflict: Indicates if there was a conflict generated when trying to cherry pick or revert the changes. :type conflict: bool :param current_commit_id: The current commit from the list of commits that are being cherry picked or reverted. :type current_commit_id: str :param failure_message: Detailed information about why the cherry pick or revert failed to complete. :type failure_message: str :param progress: A number between 0 and 1 indicating the percent complete of the operation. :type progress: float :param status: Provides a status code that indicates the reason the cherry pick or revert failed. :type status: object :param timedout: Indicates if the operation went beyond the maximum time allowed for a cherry pick or revert operation. :type timedout: bool """ _attribute_map = { 'conflict': {'key': 'conflict', 'type': 'bool'}, 'current_commit_id': {'key': 'currentCommitId', 'type': 'str'}, 'failure_message': {'key': 'failureMessage', 'type': 'str'}, 'progress': {'key': 'progress', 'type': 'float'}, 'status': {'key': 'status', 'type': 'object'}, 'timedout': {'key': 'timedout', 'type': 'bool'} } def __init__(self, conflict=None, current_commit_id=None, failure_message=None, progress=None, status=None, timedout=None): super(GitAsyncRefOperationDetail, self).__init__() self.conflict = conflict self.current_commit_id = current_commit_id self.failure_message = failure_message self.progress = progress self.status = status self.timedout = timedout class GitAsyncRefOperationParameters(Model): """GitAsyncRefOperationParameters. :param generated_ref_name: Proposed target branch name for the cherry pick or revert operation. :type generated_ref_name: str :param onto_ref_name: The target branch for the cherry pick or revert operation. :type onto_ref_name: str :param repository: The git repository for the cherry pick or revert operation. :type repository: :class:`GitRepository ` :param source: Details about the source of the cherry pick or revert operation (e.g. A pull request or a specific commit). :type source: :class:`GitAsyncRefOperationSource ` """ _attribute_map = { 'generated_ref_name': {'key': 'generatedRefName', 'type': 'str'}, 'onto_ref_name': {'key': 'ontoRefName', 'type': 'str'}, 'repository': {'key': 'repository', 'type': 'GitRepository'}, 'source': {'key': 'source', 'type': 'GitAsyncRefOperationSource'} } def __init__(self, generated_ref_name=None, onto_ref_name=None, repository=None, source=None): super(GitAsyncRefOperationParameters, self).__init__() self.generated_ref_name = generated_ref_name self.onto_ref_name = onto_ref_name self.repository = repository self.source = source class GitAsyncRefOperationSource(Model): """GitAsyncRefOperationSource. :param commit_list: A list of commits to cherry pick or revert :type commit_list: list of :class:`GitCommitRef ` :param pull_request_id: Id of the pull request to cherry pick or revert :type pull_request_id: int """ _attribute_map = { 'commit_list': {'key': 'commitList', 'type': '[GitCommitRef]'}, 'pull_request_id': {'key': 'pullRequestId', 'type': 'int'} } def __init__(self, commit_list=None, pull_request_id=None): super(GitAsyncRefOperationSource, self).__init__() self.commit_list = commit_list self.pull_request_id = pull_request_id class GitBlobRef(Model): """GitBlobRef. :param _links: :type _links: :class:`ReferenceLinks ` :param object_id: SHA1 hash of git object :type object_id: str :param size: Size of blob content (in bytes) :type size: long :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'object_id': {'key': 'objectId', 'type': 'str'}, 'size': {'key': 'size', 'type': 'long'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, object_id=None, size=None, url=None): super(GitBlobRef, self).__init__() self._links = _links self.object_id = object_id self.size = size self.url = url class GitBranchStats(Model): """GitBranchStats. :param ahead_count: Number of commits ahead. :type ahead_count: int :param behind_count: Number of commits behind. :type behind_count: int :param commit: Current commit. :type commit: :class:`GitCommitRef ` :param is_base_version: True if this is the result for the base version. :type is_base_version: bool :param name: Name of the ref. :type name: str """ _attribute_map = { 'ahead_count': {'key': 'aheadCount', 'type': 'int'}, 'behind_count': {'key': 'behindCount', 'type': 'int'}, 'commit': {'key': 'commit', 'type': 'GitCommitRef'}, 'is_base_version': {'key': 'isBaseVersion', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, ahead_count=None, behind_count=None, commit=None, is_base_version=None, name=None): super(GitBranchStats, self).__init__() self.ahead_count = ahead_count self.behind_count = behind_count self.commit = commit self.is_base_version = is_base_version self.name = name class GitCherryPick(GitAsyncRefOperation): """GitCherryPick. :param _links: :type _links: :class:`ReferenceLinks ` :param detailed_status: :type detailed_status: :class:`GitAsyncRefOperationDetail ` :param parameters: :type parameters: :class:`GitAsyncRefOperationParameters ` :param status: :type status: object :param url: A URL that can be used to make further requests for status about the operation :type url: str :param cherry_pick_id: :type cherry_pick_id: int """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'detailed_status': {'key': 'detailedStatus', 'type': 'GitAsyncRefOperationDetail'}, 'parameters': {'key': 'parameters', 'type': 'GitAsyncRefOperationParameters'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'cherry_pick_id': {'key': 'cherryPickId', 'type': 'int'} } def __init__(self, _links=None, detailed_status=None, parameters=None, status=None, url=None, cherry_pick_id=None): super(GitCherryPick, self).__init__(_links=_links, detailed_status=detailed_status, parameters=parameters, status=status, url=url) self.cherry_pick_id = cherry_pick_id class GitCommitChanges(Model): """GitCommitChanges. :param change_counts: :type change_counts: dict :param changes: :type changes: list of :class:`object ` """ _attribute_map = { 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, 'changes': {'key': 'changes', 'type': '[object]'} } def __init__(self, change_counts=None, changes=None): super(GitCommitChanges, self).__init__() self.change_counts = change_counts self.changes = changes class GitCommitDiffs(Model): """GitCommitDiffs. :param ahead_count: :type ahead_count: int :param all_changes_included: :type all_changes_included: bool :param base_commit: :type base_commit: str :param behind_count: :type behind_count: int :param change_counts: :type change_counts: dict :param changes: :type changes: list of :class:`object ` :param common_commit: :type common_commit: str :param target_commit: :type target_commit: str """ _attribute_map = { 'ahead_count': {'key': 'aheadCount', 'type': 'int'}, 'all_changes_included': {'key': 'allChangesIncluded', 'type': 'bool'}, 'base_commit': {'key': 'baseCommit', 'type': 'str'}, 'behind_count': {'key': 'behindCount', 'type': 'int'}, 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, 'changes': {'key': 'changes', 'type': '[object]'}, 'common_commit': {'key': 'commonCommit', 'type': 'str'}, 'target_commit': {'key': 'targetCommit', 'type': 'str'} } def __init__(self, ahead_count=None, all_changes_included=None, base_commit=None, behind_count=None, change_counts=None, changes=None, common_commit=None, target_commit=None): super(GitCommitDiffs, self).__init__() self.ahead_count = ahead_count self.all_changes_included = all_changes_included self.base_commit = base_commit self.behind_count = behind_count self.change_counts = change_counts self.changes = changes self.common_commit = common_commit self.target_commit = target_commit class GitCommitRef(Model): """GitCommitRef. :param _links: A collection of related REST reference links. :type _links: :class:`ReferenceLinks ` :param author: Author of the commit. :type author: :class:`GitUserDate ` :param change_counts: Counts of the types of changes (edits, deletes, etc.) included with the commit. :type change_counts: dict :param changes: An enumeration of the changes included with the commit. :type changes: list of :class:`object ` :param comment: Comment or message of the commit. :type comment: str :param comment_truncated: Indicates if the comment is truncated from the full Git commit comment message. :type comment_truncated: bool :param commit_id: ID (SHA-1) of the commit. :type commit_id: str :param committer: Committer of the commit. :type committer: :class:`GitUserDate ` :param parents: An enumeration of the parent commit IDs for this commit. :type parents: list of str :param push: The push associated with this commit. :type push: :class:`GitPushRef ` :param remote_url: Remote URL path to the commit. :type remote_url: str :param statuses: A list of status metadata from services and extensions that may associate additional information to the commit. :type statuses: list of :class:`GitStatus ` :param url: REST URL for this resource. :type url: str :param work_items: A list of workitems associated with this commit. :type work_items: list of :class:`ResourceRef ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'GitUserDate'}, 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, 'changes': {'key': 'changes', 'type': '[object]'}, 'comment': {'key': 'comment', 'type': 'str'}, 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, 'commit_id': {'key': 'commitId', 'type': 'str'}, 'committer': {'key': 'committer', 'type': 'GitUserDate'}, 'parents': {'key': 'parents', 'type': '[str]'}, 'push': {'key': 'push', 'type': 'GitPushRef'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'statuses': {'key': 'statuses', 'type': '[GitStatus]'}, 'url': {'key': 'url', 'type': 'str'}, 'work_items': {'key': 'workItems', 'type': '[ResourceRef]'} } def __init__(self, _links=None, author=None, change_counts=None, changes=None, comment=None, comment_truncated=None, commit_id=None, committer=None, parents=None, push=None, remote_url=None, statuses=None, url=None, work_items=None): super(GitCommitRef, self).__init__() self._links = _links self.author = author self.change_counts = change_counts self.changes = changes self.comment = comment self.comment_truncated = comment_truncated self.commit_id = commit_id self.committer = committer self.parents = parents self.push = push self.remote_url = remote_url self.statuses = statuses self.url = url self.work_items = work_items class GitConflict(Model): """GitConflict. :param _links: :type _links: :class:`ReferenceLinks ` :param conflict_id: :type conflict_id: int :param conflict_path: :type conflict_path: str :param conflict_type: :type conflict_type: object :param merge_base_commit: :type merge_base_commit: :class:`GitCommitRef ` :param merge_origin: :type merge_origin: :class:`GitMergeOriginRef ` :param merge_source_commit: :type merge_source_commit: :class:`GitCommitRef ` :param merge_target_commit: :type merge_target_commit: :class:`GitCommitRef ` :param resolution_error: :type resolution_error: object :param resolution_status: :type resolution_status: object :param resolved_by: :type resolved_by: :class:`IdentityRef ` :param resolved_date: :type resolved_date: datetime :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'conflict_id': {'key': 'conflictId', 'type': 'int'}, 'conflict_path': {'key': 'conflictPath', 'type': 'str'}, 'conflict_type': {'key': 'conflictType', 'type': 'object'}, 'merge_base_commit': {'key': 'mergeBaseCommit', 'type': 'GitCommitRef'}, 'merge_origin': {'key': 'mergeOrigin', 'type': 'GitMergeOriginRef'}, 'merge_source_commit': {'key': 'mergeSourceCommit', 'type': 'GitCommitRef'}, 'merge_target_commit': {'key': 'mergeTargetCommit', 'type': 'GitCommitRef'}, 'resolution_error': {'key': 'resolutionError', 'type': 'object'}, 'resolution_status': {'key': 'resolutionStatus', 'type': 'object'}, 'resolved_by': {'key': 'resolvedBy', 'type': 'IdentityRef'}, 'resolved_date': {'key': 'resolvedDate', 'type': 'iso-8601'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, conflict_id=None, conflict_path=None, conflict_type=None, merge_base_commit=None, merge_origin=None, merge_source_commit=None, merge_target_commit=None, resolution_error=None, resolution_status=None, resolved_by=None, resolved_date=None, url=None): super(GitConflict, self).__init__() self._links = _links self.conflict_id = conflict_id self.conflict_path = conflict_path self.conflict_type = conflict_type self.merge_base_commit = merge_base_commit self.merge_origin = merge_origin self.merge_source_commit = merge_source_commit self.merge_target_commit = merge_target_commit self.resolution_error = resolution_error self.resolution_status = resolution_status self.resolved_by = resolved_by self.resolved_date = resolved_date self.url = url class GitConflictUpdateResult(Model): """GitConflictUpdateResult. :param conflict_id: Conflict ID that was provided by input :type conflict_id: int :param custom_message: Reason for failing :type custom_message: str :param updated_conflict: New state of the conflict after updating :type updated_conflict: :class:`GitConflict ` :param update_status: Status of the update on the server :type update_status: object """ _attribute_map = { 'conflict_id': {'key': 'conflictId', 'type': 'int'}, 'custom_message': {'key': 'customMessage', 'type': 'str'}, 'updated_conflict': {'key': 'updatedConflict', 'type': 'GitConflict'}, 'update_status': {'key': 'updateStatus', 'type': 'object'} } def __init__(self, conflict_id=None, custom_message=None, updated_conflict=None, update_status=None): super(GitConflictUpdateResult, self).__init__() self.conflict_id = conflict_id self.custom_message = custom_message self.updated_conflict = updated_conflict self.update_status = update_status class GitDeletedRepository(Model): """GitDeletedRepository. :param created_date: :type created_date: datetime :param deleted_by: :type deleted_by: :class:`IdentityRef ` :param deleted_date: :type deleted_date: datetime :param id: :type id: str :param name: :type name: str :param project: :type project: :class:`TeamProjectReference ` """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'deleted_by': {'key': 'deletedBy', 'type': 'IdentityRef'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'} } def __init__(self, created_date=None, deleted_by=None, deleted_date=None, id=None, name=None, project=None): super(GitDeletedRepository, self).__init__() self.created_date = created_date self.deleted_by = deleted_by self.deleted_date = deleted_date self.id = id self.name = name self.project = project class GitFilePathsCollection(Model): """GitFilePathsCollection. :param commit_id: :type commit_id: str :param paths: :type paths: list of str :param url: :type url: str """ _attribute_map = { 'commit_id': {'key': 'commitId', 'type': 'str'}, 'paths': {'key': 'paths', 'type': '[str]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, commit_id=None, paths=None, url=None): super(GitFilePathsCollection, self).__init__() self.commit_id = commit_id self.paths = paths self.url = url class GitForkOperationStatusDetail(Model): """GitForkOperationStatusDetail. :param all_steps: All valid steps for the forking process :type all_steps: list of str :param current_step: Index into AllSteps for the current step :type current_step: int :param error_message: Error message if the operation failed. :type error_message: str """ _attribute_map = { 'all_steps': {'key': 'allSteps', 'type': '[str]'}, 'current_step': {'key': 'currentStep', 'type': 'int'}, 'error_message': {'key': 'errorMessage', 'type': 'str'} } def __init__(self, all_steps=None, current_step=None, error_message=None): super(GitForkOperationStatusDetail, self).__init__() self.all_steps = all_steps self.current_step = current_step self.error_message = error_message class GitForkSyncRequest(Model): """GitForkSyncRequest. :param _links: Collection of related links :type _links: :class:`ReferenceLinks ` :param detailed_status: :type detailed_status: :class:`GitForkOperationStatusDetail ` :param operation_id: Unique identifier for the operation. :type operation_id: int :param source: Fully-qualified identifier for the source repository. :type source: :class:`GlobalGitRepositoryKey ` :param source_to_target_refs: If supplied, the set of ref mappings to use when performing a "sync" or create. If missing, all refs will be synchronized. :type source_to_target_refs: list of :class:`SourceToTargetRef ` :param status: :type status: object """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'detailed_status': {'key': 'detailedStatus', 'type': 'GitForkOperationStatusDetail'}, 'operation_id': {'key': 'operationId', 'type': 'int'}, 'source': {'key': 'source', 'type': 'GlobalGitRepositoryKey'}, 'source_to_target_refs': {'key': 'sourceToTargetRefs', 'type': '[SourceToTargetRef]'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, _links=None, detailed_status=None, operation_id=None, source=None, source_to_target_refs=None, status=None): super(GitForkSyncRequest, self).__init__() self._links = _links self.detailed_status = detailed_status self.operation_id = operation_id self.source = source self.source_to_target_refs = source_to_target_refs self.status = status class GitForkSyncRequestParameters(Model): """GitForkSyncRequestParameters. :param source: Fully-qualified identifier for the source repository. :type source: :class:`GlobalGitRepositoryKey ` :param source_to_target_refs: If supplied, the set of ref mappings to use when performing a "sync" or create. If missing, all refs will be synchronized. :type source_to_target_refs: list of :class:`SourceToTargetRef ` """ _attribute_map = { 'source': {'key': 'source', 'type': 'GlobalGitRepositoryKey'}, 'source_to_target_refs': {'key': 'sourceToTargetRefs', 'type': '[SourceToTargetRef]'} } def __init__(self, source=None, source_to_target_refs=None): super(GitForkSyncRequestParameters, self).__init__() self.source = source self.source_to_target_refs = source_to_target_refs class GitImportGitSource(Model): """GitImportGitSource. :param overwrite: Tells if this is a sync request or not :type overwrite: bool :param url: Url for the source repo :type url: str """ _attribute_map = { 'overwrite': {'key': 'overwrite', 'type': 'bool'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, overwrite=None, url=None): super(GitImportGitSource, self).__init__() self.overwrite = overwrite self.url = url class GitImportRequest(Model): """GitImportRequest. :param _links: Links to related resources. :type _links: :class:`ReferenceLinks ` :param detailed_status: Detailed status of the import, including the current step and an error message, if applicable. :type detailed_status: :class:`GitImportStatusDetail ` :param import_request_id: The unique identifier for this import request. :type import_request_id: int :param parameters: Parameters for creating the import request. :type parameters: :class:`GitImportRequestParameters ` :param repository: The target repository for this import. :type repository: :class:`GitRepository ` :param status: Current status of the import. :type status: object :param url: A link back to this import request resource. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'detailed_status': {'key': 'detailedStatus', 'type': 'GitImportStatusDetail'}, 'import_request_id': {'key': 'importRequestId', 'type': 'int'}, 'parameters': {'key': 'parameters', 'type': 'GitImportRequestParameters'}, 'repository': {'key': 'repository', 'type': 'GitRepository'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, detailed_status=None, import_request_id=None, parameters=None, repository=None, status=None, url=None): super(GitImportRequest, self).__init__() self._links = _links self.detailed_status = detailed_status self.import_request_id = import_request_id self.parameters = parameters self.repository = repository self.status = status self.url = url class GitImportRequestParameters(Model): """GitImportRequestParameters. :param delete_service_endpoint_after_import_is_done: Option to delete service endpoint when import is done :type delete_service_endpoint_after_import_is_done: bool :param git_source: Source for importing git repository :type git_source: :class:`GitImportGitSource ` :param service_endpoint_id: Service Endpoint for connection to external endpoint :type service_endpoint_id: str :param tfvc_source: Source for importing tfvc repository :type tfvc_source: :class:`GitImportTfvcSource ` """ _attribute_map = { 'delete_service_endpoint_after_import_is_done': {'key': 'deleteServiceEndpointAfterImportIsDone', 'type': 'bool'}, 'git_source': {'key': 'gitSource', 'type': 'GitImportGitSource'}, 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'}, 'tfvc_source': {'key': 'tfvcSource', 'type': 'GitImportTfvcSource'} } def __init__(self, delete_service_endpoint_after_import_is_done=None, git_source=None, service_endpoint_id=None, tfvc_source=None): super(GitImportRequestParameters, self).__init__() self.delete_service_endpoint_after_import_is_done = delete_service_endpoint_after_import_is_done self.git_source = git_source self.service_endpoint_id = service_endpoint_id self.tfvc_source = tfvc_source class GitImportStatusDetail(Model): """GitImportStatusDetail. :param all_steps: All valid steps for the import process :type all_steps: list of str :param current_step: Index into AllSteps for the current step :type current_step: int :param error_message: Error message if the operation failed. :type error_message: str """ _attribute_map = { 'all_steps': {'key': 'allSteps', 'type': '[str]'}, 'current_step': {'key': 'currentStep', 'type': 'int'}, 'error_message': {'key': 'errorMessage', 'type': 'str'} } def __init__(self, all_steps=None, current_step=None, error_message=None): super(GitImportStatusDetail, self).__init__() self.all_steps = all_steps self.current_step = current_step self.error_message = error_message class GitImportTfvcSource(Model): """GitImportTfvcSource. :param import_history: Set true to import History, false otherwise :type import_history: bool :param import_history_duration_in_days: Get history for last n days (max allowed value is 180 days) :type import_history_duration_in_days: int :param path: Path which we want to import (this can be copied from Path Control in Explorer) :type path: str """ _attribute_map = { 'import_history': {'key': 'importHistory', 'type': 'bool'}, 'import_history_duration_in_days': {'key': 'importHistoryDurationInDays', 'type': 'int'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, import_history=None, import_history_duration_in_days=None, path=None): super(GitImportTfvcSource, self).__init__() self.import_history = import_history self.import_history_duration_in_days = import_history_duration_in_days self.path = path class GitItemDescriptor(Model): """GitItemDescriptor. :param path: Path to item :type path: str :param recursion_level: Specifies whether to include children (OneLevel), all descendants (Full), or None :type recursion_level: object :param version: Version string (interpretation based on VersionType defined in subclass :type version: str :param version_options: Version modifiers (e.g. previous) :type version_options: object :param version_type: How to interpret version (branch,tag,commit) :type version_type: object """ _attribute_map = { 'path': {'key': 'path', 'type': 'str'}, 'recursion_level': {'key': 'recursionLevel', 'type': 'object'}, 'version': {'key': 'version', 'type': 'str'}, 'version_options': {'key': 'versionOptions', 'type': 'object'}, 'version_type': {'key': 'versionType', 'type': 'object'} } def __init__(self, path=None, recursion_level=None, version=None, version_options=None, version_type=None): super(GitItemDescriptor, self).__init__() self.path = path self.recursion_level = recursion_level self.version = version self.version_options = version_options self.version_type = version_type class GitItemRequestData(Model): """GitItemRequestData. :param include_content_metadata: Whether to include metadata for all items :type include_content_metadata: bool :param include_links: Whether to include the _links field on the shallow references :type include_links: bool :param item_descriptors: Collection of items to fetch, including path, version, and recursion level :type item_descriptors: list of :class:`GitItemDescriptor ` :param latest_processed_change: Whether to include shallow ref to commit that last changed each item :type latest_processed_change: bool """ _attribute_map = { 'include_content_metadata': {'key': 'includeContentMetadata', 'type': 'bool'}, 'include_links': {'key': 'includeLinks', 'type': 'bool'}, 'item_descriptors': {'key': 'itemDescriptors', 'type': '[GitItemDescriptor]'}, 'latest_processed_change': {'key': 'latestProcessedChange', 'type': 'bool'} } def __init__(self, include_content_metadata=None, include_links=None, item_descriptors=None, latest_processed_change=None): super(GitItemRequestData, self).__init__() self.include_content_metadata = include_content_metadata self.include_links = include_links self.item_descriptors = item_descriptors self.latest_processed_change = latest_processed_change class GitMergeOperationStatusDetail(Model): """GitMergeOperationStatusDetail. :param failure_message: Error message if the operation failed. :type failure_message: str :param merge_commit_id: The commitId of the resultant merge commit. :type merge_commit_id: str """ _attribute_map = { 'failure_message': {'key': 'failureMessage', 'type': 'str'}, 'merge_commit_id': {'key': 'mergeCommitId', 'type': 'str'} } def __init__(self, failure_message=None, merge_commit_id=None): super(GitMergeOperationStatusDetail, self).__init__() self.failure_message = failure_message self.merge_commit_id = merge_commit_id class GitMergeOriginRef(Model): """GitMergeOriginRef. :param pull_request_id: :type pull_request_id: int """ _attribute_map = { 'pull_request_id': {'key': 'pullRequestId', 'type': 'int'} } def __init__(self, pull_request_id=None): super(GitMergeOriginRef, self).__init__() self.pull_request_id = pull_request_id class GitMergeParameters(Model): """GitMergeParameters. :param comment: Comment or message of the commit. :type comment: str :param parents: An enumeration of the parent commit IDs for the merge commit. :type parents: list of str """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'parents': {'key': 'parents', 'type': '[str]'} } def __init__(self, comment=None, parents=None): super(GitMergeParameters, self).__init__() self.comment = comment self.parents = parents class GitObject(Model): """GitObject. :param object_id: Object Id (Sha1Id). :type object_id: str :param object_type: Type of object (Commit, Tree, Blob, Tag) :type object_type: object """ _attribute_map = { 'object_id': {'key': 'objectId', 'type': 'str'}, 'object_type': {'key': 'objectType', 'type': 'object'} } def __init__(self, object_id=None, object_type=None): super(GitObject, self).__init__() self.object_id = object_id self.object_type = object_type class GitPullRequest(Model): """GitPullRequest. :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param artifact_id: A string which uniquely identifies this pull request. To generate an artifact ID for a pull request, use this template: ```vstfs:///Git/PullRequestId/{projectId}/{repositoryId}/{pullRequestId}``` :type artifact_id: str :param auto_complete_set_by: If set, auto-complete is enabled for this pull request and this is the identity that enabled it. :type auto_complete_set_by: :class:`IdentityRef ` :param closed_by: The user who closed the pull request. :type closed_by: :class:`IdentityRef ` :param closed_date: The date when the pull request was closed (completed, abandoned, or merged externally). :type closed_date: datetime :param code_review_id: The code review ID of the pull request. Used internally. :type code_review_id: int :param commits: The commits contained in the pull request. :type commits: list of :class:`GitCommitRef ` :param completion_options: Options which affect how the pull request will be merged when it is completed. :type completion_options: :class:`GitPullRequestCompletionOptions ` :param completion_queue_time: The most recent date at which the pull request entered the queue to be completed. Used internally. :type completion_queue_time: datetime :param created_by: The identity of the user who created the pull request. :type created_by: :class:`IdentityRef ` :param creation_date: The date when the pull request was created. :type creation_date: datetime :param description: The description of the pull request. :type description: str :param fork_source: If this is a PR from a fork this will contain information about its source. :type fork_source: :class:`GitForkRef ` :param is_draft: Draft / WIP pull request. :type is_draft: bool :param labels: The labels associated with the pull request. :type labels: list of :class:`WebApiTagDefinition ` :param last_merge_commit: The commit of the most recent pull request merge. If empty, the most recent merge is in progress or was unsuccessful. :type last_merge_commit: :class:`GitCommitRef ` :param last_merge_source_commit: The commit at the head of the source branch at the time of the last pull request merge. :type last_merge_source_commit: :class:`GitCommitRef ` :param last_merge_target_commit: The commit at the head of the target branch at the time of the last pull request merge. :type last_merge_target_commit: :class:`GitCommitRef ` :param merge_failure_message: If set, pull request merge failed for this reason. :type merge_failure_message: str :param merge_failure_type: The type of failure (if any) of the pull request merge. :type merge_failure_type: object :param merge_id: The ID of the job used to run the pull request merge. Used internally. :type merge_id: str :param merge_options: Options used when the pull request merge runs. These are separate from completion options since completion happens only once and a new merge will run every time the source branch of the pull request changes. :type merge_options: :class:`GitPullRequestMergeOptions ` :param merge_status: The current status of the pull request merge. :type merge_status: object :param pull_request_id: The ID of the pull request. :type pull_request_id: int :param remote_url: Used internally. :type remote_url: str :param repository: The repository containing the target branch of the pull request. :type repository: :class:`GitRepository ` :param reviewers: A list of reviewers on the pull request along with the state of their votes. :type reviewers: list of :class:`IdentityRefWithVote ` :param source_ref_name: The name of the source branch of the pull request. :type source_ref_name: str :param status: The status of the pull request. :type status: object :param supports_iterations: If true, this pull request supports multiple iterations. Iteration support means individual pushes to the source branch of the pull request can be reviewed and comments left in one iteration will be tracked across future iterations. :type supports_iterations: bool :param target_ref_name: The name of the target branch of the pull request. :type target_ref_name: str :param title: The title of the pull request. :type title: str :param url: Used internally. :type url: str :param work_item_refs: Any work item references associated with this pull request. :type work_item_refs: list of :class:`ResourceRef ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'auto_complete_set_by': {'key': 'autoCompleteSetBy', 'type': 'IdentityRef'}, 'closed_by': {'key': 'closedBy', 'type': 'IdentityRef'}, 'closed_date': {'key': 'closedDate', 'type': 'iso-8601'}, 'code_review_id': {'key': 'codeReviewId', 'type': 'int'}, 'commits': {'key': 'commits', 'type': '[GitCommitRef]'}, 'completion_options': {'key': 'completionOptions', 'type': 'GitPullRequestCompletionOptions'}, 'completion_queue_time': {'key': 'completionQueueTime', 'type': 'iso-8601'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'fork_source': {'key': 'forkSource', 'type': 'GitForkRef'}, 'is_draft': {'key': 'isDraft', 'type': 'bool'}, 'labels': {'key': 'labels', 'type': '[WebApiTagDefinition]'}, 'last_merge_commit': {'key': 'lastMergeCommit', 'type': 'GitCommitRef'}, 'last_merge_source_commit': {'key': 'lastMergeSourceCommit', 'type': 'GitCommitRef'}, 'last_merge_target_commit': {'key': 'lastMergeTargetCommit', 'type': 'GitCommitRef'}, 'merge_failure_message': {'key': 'mergeFailureMessage', 'type': 'str'}, 'merge_failure_type': {'key': 'mergeFailureType', 'type': 'object'}, 'merge_id': {'key': 'mergeId', 'type': 'str'}, 'merge_options': {'key': 'mergeOptions', 'type': 'GitPullRequestMergeOptions'}, 'merge_status': {'key': 'mergeStatus', 'type': 'object'}, 'pull_request_id': {'key': 'pullRequestId', 'type': 'int'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'repository': {'key': 'repository', 'type': 'GitRepository'}, 'reviewers': {'key': 'reviewers', 'type': '[IdentityRefWithVote]'}, 'source_ref_name': {'key': 'sourceRefName', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'supports_iterations': {'key': 'supportsIterations', 'type': 'bool'}, 'target_ref_name': {'key': 'targetRefName', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'work_item_refs': {'key': 'workItemRefs', 'type': '[ResourceRef]'} } def __init__(self, _links=None, artifact_id=None, auto_complete_set_by=None, closed_by=None, closed_date=None, code_review_id=None, commits=None, completion_options=None, completion_queue_time=None, created_by=None, creation_date=None, description=None, fork_source=None, is_draft=None, labels=None, last_merge_commit=None, last_merge_source_commit=None, last_merge_target_commit=None, merge_failure_message=None, merge_failure_type=None, merge_id=None, merge_options=None, merge_status=None, pull_request_id=None, remote_url=None, repository=None, reviewers=None, source_ref_name=None, status=None, supports_iterations=None, target_ref_name=None, title=None, url=None, work_item_refs=None): super(GitPullRequest, self).__init__() self._links = _links self.artifact_id = artifact_id self.auto_complete_set_by = auto_complete_set_by self.closed_by = closed_by self.closed_date = closed_date self.code_review_id = code_review_id self.commits = commits self.completion_options = completion_options self.completion_queue_time = completion_queue_time self.created_by = created_by self.creation_date = creation_date self.description = description self.fork_source = fork_source self.is_draft = is_draft self.labels = labels self.last_merge_commit = last_merge_commit self.last_merge_source_commit = last_merge_source_commit self.last_merge_target_commit = last_merge_target_commit self.merge_failure_message = merge_failure_message self.merge_failure_type = merge_failure_type self.merge_id = merge_id self.merge_options = merge_options self.merge_status = merge_status self.pull_request_id = pull_request_id self.remote_url = remote_url self.repository = repository self.reviewers = reviewers self.source_ref_name = source_ref_name self.status = status self.supports_iterations = supports_iterations self.target_ref_name = target_ref_name self.title = title self.url = url self.work_item_refs = work_item_refs class GitPullRequestChange(Model): """GitPullRequestChange. :param change_tracking_id: ID used to track files through multiple changes. :type change_tracking_id: int """ _attribute_map = { 'change_tracking_id': {'key': 'changeTrackingId', 'type': 'int'} } def __init__(self, change_tracking_id=None): super(GitPullRequestChange, self).__init__() self.change_tracking_id = change_tracking_id class GitPullRequestCommentThread(CommentThread): """GitPullRequestCommentThread. :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param comments: A list of the comments. :type comments: list of :class:`Comment ` :param id: The comment thread id. :type id: int :param identities: Set of identities related to this thread :type identities: dict :param is_deleted: Specify if the thread is deleted which happens when all comments are deleted. :type is_deleted: bool :param last_updated_date: The time this thread was last updated. :type last_updated_date: datetime :param properties: Optional properties associated with the thread as a collection of key-value pairs. :type properties: :class:`object ` :param published_date: The time this thread was published. :type published_date: datetime :param status: The status of the comment thread. :type status: object :param thread_context: Specify thread context such as position in left/right file. :type thread_context: :class:`CommentThreadContext ` :param pull_request_thread_context: Extended context information unique to pull requests :type pull_request_thread_context: :class:`GitPullRequestCommentThreadContext ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'comments': {'key': 'comments', 'type': '[Comment]'}, 'id': {'key': 'id', 'type': 'int'}, 'identities': {'key': 'identities', 'type': '{IdentityRef}'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'properties': {'key': 'properties', 'type': 'object'}, 'published_date': {'key': 'publishedDate', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'thread_context': {'key': 'threadContext', 'type': 'CommentThreadContext'}, 'pull_request_thread_context': {'key': 'pullRequestThreadContext', 'type': 'GitPullRequestCommentThreadContext'} } def __init__(self, _links=None, comments=None, id=None, identities=None, is_deleted=None, last_updated_date=None, properties=None, published_date=None, status=None, thread_context=None, pull_request_thread_context=None): super(GitPullRequestCommentThread, self).__init__(_links=_links, comments=comments, id=id, identities=identities, is_deleted=is_deleted, last_updated_date=last_updated_date, properties=properties, published_date=published_date, status=status, thread_context=thread_context) self.pull_request_thread_context = pull_request_thread_context class GitPullRequestCommentThreadContext(Model): """GitPullRequestCommentThreadContext. :param change_tracking_id: Used to track a comment across iterations. This value can be found by looking at the iteration's changes list. Must be set for pull requests with iteration support. Otherwise, it's not required for 'legacy' pull requests. :type change_tracking_id: int :param iteration_context: The iteration context being viewed when the thread was created. :type iteration_context: :class:`CommentIterationContext ` :param tracking_criteria: The criteria used to track this thread. If this property is filled out when the thread is returned, then the thread has been tracked from its original location using the given criteria. :type tracking_criteria: :class:`CommentTrackingCriteria ` """ _attribute_map = { 'change_tracking_id': {'key': 'changeTrackingId', 'type': 'int'}, 'iteration_context': {'key': 'iterationContext', 'type': 'CommentIterationContext'}, 'tracking_criteria': {'key': 'trackingCriteria', 'type': 'CommentTrackingCriteria'} } def __init__(self, change_tracking_id=None, iteration_context=None, tracking_criteria=None): super(GitPullRequestCommentThreadContext, self).__init__() self.change_tracking_id = change_tracking_id self.iteration_context = iteration_context self.tracking_criteria = tracking_criteria class GitPullRequestCompletionOptions(Model): """GitPullRequestCompletionOptions. :param bypass_policy: If true, policies will be explicitly bypassed while the pull request is completed. :type bypass_policy: bool :param bypass_reason: If policies are bypassed, this reason is stored as to why bypass was used. :type bypass_reason: str :param delete_source_branch: If true, the source branch of the pull request will be deleted after completion. :type delete_source_branch: bool :param merge_commit_message: If set, this will be used as the commit message of the merge commit. :type merge_commit_message: str :param squash_merge: If true, the commits in the pull request will be squash-merged into the specified target branch on completion. :type squash_merge: bool :param transition_work_items: If true, we will attempt to transition any work items linked to the pull request into the next logical state (i.e. Active -> Resolved) :type transition_work_items: bool :param triggered_by_auto_complete: If true, the current completion attempt was triggered via auto-complete. Used internally. :type triggered_by_auto_complete: bool """ _attribute_map = { 'bypass_policy': {'key': 'bypassPolicy', 'type': 'bool'}, 'bypass_reason': {'key': 'bypassReason', 'type': 'str'}, 'delete_source_branch': {'key': 'deleteSourceBranch', 'type': 'bool'}, 'merge_commit_message': {'key': 'mergeCommitMessage', 'type': 'str'}, 'squash_merge': {'key': 'squashMerge', 'type': 'bool'}, 'transition_work_items': {'key': 'transitionWorkItems', 'type': 'bool'}, 'triggered_by_auto_complete': {'key': 'triggeredByAutoComplete', 'type': 'bool'} } def __init__(self, bypass_policy=None, bypass_reason=None, delete_source_branch=None, merge_commit_message=None, squash_merge=None, transition_work_items=None, triggered_by_auto_complete=None): super(GitPullRequestCompletionOptions, self).__init__() self.bypass_policy = bypass_policy self.bypass_reason = bypass_reason self.delete_source_branch = delete_source_branch self.merge_commit_message = merge_commit_message self.squash_merge = squash_merge self.transition_work_items = transition_work_items self.triggered_by_auto_complete = triggered_by_auto_complete class GitPullRequestIteration(Model): """GitPullRequestIteration. :param _links: A collection of related REST reference links. :type _links: :class:`ReferenceLinks ` :param author: Author of the pull request iteration. :type author: :class:`IdentityRef ` :param change_list: Changes included with the pull request iteration. :type change_list: list of :class:`GitPullRequestChange ` :param commits: The commits included with the pull request iteration. :type commits: list of :class:`GitCommitRef ` :param common_ref_commit: The first common Git commit of the source and target refs. :type common_ref_commit: :class:`GitCommitRef ` :param created_date: The creation date of the pull request iteration. :type created_date: datetime :param description: Description of the pull request iteration. :type description: str :param has_more_commits: Indicates if the Commits property contains a truncated list of commits in this pull request iteration. :type has_more_commits: bool :param id: ID of the pull request iteration. Iterations are created as a result of creating and pushing updates to a pull request. :type id: int :param new_target_ref_name: If the iteration reason is Retarget, this is the refName of the new target :type new_target_ref_name: str :param old_target_ref_name: If the iteration reason is Retarget, this is the original target refName :type old_target_ref_name: str :param push: The Git push information associated with this pull request iteration. :type push: :class:`GitPushRef ` :param reason: The reason for which the pull request iteration was created. :type reason: object :param source_ref_commit: The source Git commit of this iteration. :type source_ref_commit: :class:`GitCommitRef ` :param target_ref_commit: The target Git commit of this iteration. :type target_ref_commit: :class:`GitCommitRef ` :param updated_date: The updated date of the pull request iteration. :type updated_date: datetime """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'IdentityRef'}, 'change_list': {'key': 'changeList', 'type': '[GitPullRequestChange]'}, 'commits': {'key': 'commits', 'type': '[GitCommitRef]'}, 'common_ref_commit': {'key': 'commonRefCommit', 'type': 'GitCommitRef'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'has_more_commits': {'key': 'hasMoreCommits', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'int'}, 'new_target_ref_name': {'key': 'newTargetRefName', 'type': 'str'}, 'old_target_ref_name': {'key': 'oldTargetRefName', 'type': 'str'}, 'push': {'key': 'push', 'type': 'GitPushRef'}, 'reason': {'key': 'reason', 'type': 'object'}, 'source_ref_commit': {'key': 'sourceRefCommit', 'type': 'GitCommitRef'}, 'target_ref_commit': {'key': 'targetRefCommit', 'type': 'GitCommitRef'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'} } def __init__(self, _links=None, author=None, change_list=None, commits=None, common_ref_commit=None, created_date=None, description=None, has_more_commits=None, id=None, new_target_ref_name=None, old_target_ref_name=None, push=None, reason=None, source_ref_commit=None, target_ref_commit=None, updated_date=None): super(GitPullRequestIteration, self).__init__() self._links = _links self.author = author self.change_list = change_list self.commits = commits self.common_ref_commit = common_ref_commit self.created_date = created_date self.description = description self.has_more_commits = has_more_commits self.id = id self.new_target_ref_name = new_target_ref_name self.old_target_ref_name = old_target_ref_name self.push = push self.reason = reason self.source_ref_commit = source_ref_commit self.target_ref_commit = target_ref_commit self.updated_date = updated_date class GitPullRequestIterationChanges(Model): """GitPullRequestIterationChanges. :param change_entries: Changes made in the iteration. :type change_entries: list of :class:`GitPullRequestChange ` :param next_skip: Value to specify as skip to get the next page of changes. This will be zero if there are no more changes. :type next_skip: int :param next_top: Value to specify as top to get the next page of changes. This will be zero if there are no more changes. :type next_top: int """ _attribute_map = { 'change_entries': {'key': 'changeEntries', 'type': '[GitPullRequestChange]'}, 'next_skip': {'key': 'nextSkip', 'type': 'int'}, 'next_top': {'key': 'nextTop', 'type': 'int'} } def __init__(self, change_entries=None, next_skip=None, next_top=None): super(GitPullRequestIterationChanges, self).__init__() self.change_entries = change_entries self.next_skip = next_skip self.next_top = next_top class GitPullRequestMergeOptions(Model): """GitPullRequestMergeOptions. :param detect_rename_false_positives: :type detect_rename_false_positives: bool :param disable_renames: If true, rename detection will not be performed during the merge. :type disable_renames: bool """ _attribute_map = { 'detect_rename_false_positives': {'key': 'detectRenameFalsePositives', 'type': 'bool'}, 'disable_renames': {'key': 'disableRenames', 'type': 'bool'} } def __init__(self, detect_rename_false_positives=None, disable_renames=None): super(GitPullRequestMergeOptions, self).__init__() self.detect_rename_false_positives = detect_rename_false_positives self.disable_renames = disable_renames class GitPullRequestQuery(Model): """GitPullRequestQuery. :param queries: The queries to perform. :type queries: list of :class:`GitPullRequestQueryInput ` :param results: The results of the queries. This matches the QueryInputs list so Results[n] are the results of QueryInputs[n]. Each entry in the list is a dictionary of commit->pull requests. :type results: list of {[GitPullRequest]} """ _attribute_map = { 'queries': {'key': 'queries', 'type': '[GitPullRequestQueryInput]'}, 'results': {'key': 'results', 'type': '[{[GitPullRequest]}]'} } def __init__(self, queries=None, results=None): super(GitPullRequestQuery, self).__init__() self.queries = queries self.results = results class GitPullRequestQueryInput(Model): """GitPullRequestQueryInput. :param items: The list of commit IDs to search for. :type items: list of str :param type: The type of query to perform. :type type: object """ _attribute_map = { 'items': {'key': 'items', 'type': '[str]'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, items=None, type=None): super(GitPullRequestQueryInput, self).__init__() self.items = items self.type = type class GitPullRequestSearchCriteria(Model): """GitPullRequestSearchCriteria. :param creator_id: If set, search for pull requests that were created by this identity. :type creator_id: str :param include_links: Whether to include the _links field on the shallow references :type include_links: bool :param repository_id: If set, search for pull requests whose target branch is in this repository. :type repository_id: str :param reviewer_id: If set, search for pull requests that have this identity as a reviewer. :type reviewer_id: str :param source_ref_name: If set, search for pull requests from this branch. :type source_ref_name: str :param source_repository_id: If set, search for pull requests whose source branch is in this repository. :type source_repository_id: str :param status: If set, search for pull requests that are in this state. Defaults to Active if unset. :type status: object :param target_ref_name: If set, search for pull requests into this branch. :type target_ref_name: str """ _attribute_map = { 'creator_id': {'key': 'creatorId', 'type': 'str'}, 'include_links': {'key': 'includeLinks', 'type': 'bool'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'}, 'reviewer_id': {'key': 'reviewerId', 'type': 'str'}, 'source_ref_name': {'key': 'sourceRefName', 'type': 'str'}, 'source_repository_id': {'key': 'sourceRepositoryId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'target_ref_name': {'key': 'targetRefName', 'type': 'str'} } def __init__(self, creator_id=None, include_links=None, repository_id=None, reviewer_id=None, source_ref_name=None, source_repository_id=None, status=None, target_ref_name=None): super(GitPullRequestSearchCriteria, self).__init__() self.creator_id = creator_id self.include_links = include_links self.repository_id = repository_id self.reviewer_id = reviewer_id self.source_ref_name = source_ref_name self.source_repository_id = source_repository_id self.status = status self.target_ref_name = target_ref_name class GitPushRef(Model): """GitPushRef. :param _links: :type _links: :class:`ReferenceLinks ` :param date: :type date: datetime :param push_correlation_id: :type push_correlation_id: str :param pushed_by: :type pushed_by: :class:`IdentityRef ` :param push_id: :type push_id: int :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'date': {'key': 'date', 'type': 'iso-8601'}, 'push_correlation_id': {'key': 'pushCorrelationId', 'type': 'str'}, 'pushed_by': {'key': 'pushedBy', 'type': 'IdentityRef'}, 'push_id': {'key': 'pushId', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, date=None, push_correlation_id=None, pushed_by=None, push_id=None, url=None): super(GitPushRef, self).__init__() self._links = _links self.date = date self.push_correlation_id = push_correlation_id self.pushed_by = pushed_by self.push_id = push_id self.url = url class GitPushSearchCriteria(Model): """GitPushSearchCriteria. :param from_date: :type from_date: datetime :param include_links: Whether to include the _links field on the shallow references :type include_links: bool :param include_ref_updates: :type include_ref_updates: bool :param pusher_id: :type pusher_id: str :param ref_name: :type ref_name: str :param to_date: :type to_date: datetime """ _attribute_map = { 'from_date': {'key': 'fromDate', 'type': 'iso-8601'}, 'include_links': {'key': 'includeLinks', 'type': 'bool'}, 'include_ref_updates': {'key': 'includeRefUpdates', 'type': 'bool'}, 'pusher_id': {'key': 'pusherId', 'type': 'str'}, 'ref_name': {'key': 'refName', 'type': 'str'}, 'to_date': {'key': 'toDate', 'type': 'iso-8601'} } def __init__(self, from_date=None, include_links=None, include_ref_updates=None, pusher_id=None, ref_name=None, to_date=None): super(GitPushSearchCriteria, self).__init__() self.from_date = from_date self.include_links = include_links self.include_ref_updates = include_ref_updates self.pusher_id = pusher_id self.ref_name = ref_name self.to_date = to_date class GitQueryBranchStatsCriteria(Model): """GitQueryBranchStatsCriteria. :param base_commit: :type base_commit: :class:`GitVersionDescriptor ` :param target_commits: :type target_commits: list of :class:`GitVersionDescriptor ` """ _attribute_map = { 'base_commit': {'key': 'baseCommit', 'type': 'GitVersionDescriptor'}, 'target_commits': {'key': 'targetCommits', 'type': '[GitVersionDescriptor]'} } def __init__(self, base_commit=None, target_commits=None): super(GitQueryBranchStatsCriteria, self).__init__() self.base_commit = base_commit self.target_commits = target_commits class GitQueryCommitsCriteria(Model): """GitQueryCommitsCriteria. :param skip: Number of entries to skip :type skip: int :param top: Maximum number of entries to retrieve :type top: int :param author: Alias or display name of the author :type author: str :param compare_version: Only applicable when ItemVersion specified. If provided, start walking history starting at this commit. :type compare_version: :class:`GitVersionDescriptor ` :param exclude_deletes: Only applies when an itemPath is specified. This determines whether to exclude delete entries of the specified path. :type exclude_deletes: bool :param from_commit_id: If provided, a lower bound for filtering commits alphabetically :type from_commit_id: str :param from_date: If provided, only include history entries created after this date (string) :type from_date: str :param history_mode: What Git history mode should be used. This only applies to the search criteria when Ids = null and an itemPath is specified. :type history_mode: object :param ids: If provided, specifies the exact commit ids of the commits to fetch. May not be combined with other parameters. :type ids: list of str :param include_links: Whether to include the _links field on the shallow references :type include_links: bool :param include_push_data: Whether to include the push information :type include_push_data: bool :param include_user_image_url: Whether to include the image Url for committers and authors :type include_user_image_url: bool :param include_work_items: Whether to include linked work items :type include_work_items: bool :param item_path: Path of item to search under :type item_path: str :param item_version: If provided, identifies the commit or branch to search :type item_version: :class:`GitVersionDescriptor ` :param to_commit_id: If provided, an upper bound for filtering commits alphabetically :type to_commit_id: str :param to_date: If provided, only include history entries created before this date (string) :type to_date: str :param user: Alias or display name of the committer :type user: str """ _attribute_map = { 'skip': {'key': '$skip', 'type': 'int'}, 'top': {'key': '$top', 'type': 'int'}, 'author': {'key': 'author', 'type': 'str'}, 'compare_version': {'key': 'compareVersion', 'type': 'GitVersionDescriptor'}, 'exclude_deletes': {'key': 'excludeDeletes', 'type': 'bool'}, 'from_commit_id': {'key': 'fromCommitId', 'type': 'str'}, 'from_date': {'key': 'fromDate', 'type': 'str'}, 'history_mode': {'key': 'historyMode', 'type': 'object'}, 'ids': {'key': 'ids', 'type': '[str]'}, 'include_links': {'key': 'includeLinks', 'type': 'bool'}, 'include_push_data': {'key': 'includePushData', 'type': 'bool'}, 'include_user_image_url': {'key': 'includeUserImageUrl', 'type': 'bool'}, 'include_work_items': {'key': 'includeWorkItems', 'type': 'bool'}, 'item_path': {'key': 'itemPath', 'type': 'str'}, 'item_version': {'key': 'itemVersion', 'type': 'GitVersionDescriptor'}, 'to_commit_id': {'key': 'toCommitId', 'type': 'str'}, 'to_date': {'key': 'toDate', 'type': 'str'}, 'user': {'key': 'user', 'type': 'str'} } def __init__(self, skip=None, top=None, author=None, compare_version=None, exclude_deletes=None, from_commit_id=None, from_date=None, history_mode=None, ids=None, include_links=None, include_push_data=None, include_user_image_url=None, include_work_items=None, item_path=None, item_version=None, to_commit_id=None, to_date=None, user=None): super(GitQueryCommitsCriteria, self).__init__() self.skip = skip self.top = top self.author = author self.compare_version = compare_version self.exclude_deletes = exclude_deletes self.from_commit_id = from_commit_id self.from_date = from_date self.history_mode = history_mode self.ids = ids self.include_links = include_links self.include_push_data = include_push_data self.include_user_image_url = include_user_image_url self.include_work_items = include_work_items self.item_path = item_path self.item_version = item_version self.to_commit_id = to_commit_id self.to_date = to_date self.user = user class GitRecycleBinRepositoryDetails(Model): """GitRecycleBinRepositoryDetails. :param deleted: Setting to false will undo earlier deletion and restore the repository. :type deleted: bool """ _attribute_map = { 'deleted': {'key': 'deleted', 'type': 'bool'} } def __init__(self, deleted=None): super(GitRecycleBinRepositoryDetails, self).__init__() self.deleted = deleted class GitRef(Model): """GitRef. :param _links: :type _links: :class:`ReferenceLinks ` :param creator: :type creator: :class:`IdentityRef ` :param is_locked: :type is_locked: bool :param is_locked_by: :type is_locked_by: :class:`IdentityRef ` :param name: :type name: str :param object_id: :type object_id: str :param peeled_object_id: :type peeled_object_id: str :param statuses: :type statuses: list of :class:`GitStatus ` :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'creator': {'key': 'creator', 'type': 'IdentityRef'}, 'is_locked': {'key': 'isLocked', 'type': 'bool'}, 'is_locked_by': {'key': 'isLockedBy', 'type': 'IdentityRef'}, 'name': {'key': 'name', 'type': 'str'}, 'object_id': {'key': 'objectId', 'type': 'str'}, 'peeled_object_id': {'key': 'peeledObjectId', 'type': 'str'}, 'statuses': {'key': 'statuses', 'type': '[GitStatus]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, creator=None, is_locked=None, is_locked_by=None, name=None, object_id=None, peeled_object_id=None, statuses=None, url=None): super(GitRef, self).__init__() self._links = _links self.creator = creator self.is_locked = is_locked self.is_locked_by = is_locked_by self.name = name self.object_id = object_id self.peeled_object_id = peeled_object_id self.statuses = statuses self.url = url class GitRefFavorite(Model): """GitRefFavorite. :param _links: :type _links: :class:`ReferenceLinks ` :param id: :type id: int :param identity_id: :type identity_id: str :param name: :type name: str :param repository_id: :type repository_id: str :param type: :type type: object :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'identity_id': {'key': 'identityId', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, id=None, identity_id=None, name=None, repository_id=None, type=None, url=None): super(GitRefFavorite, self).__init__() self._links = _links self.id = id self.identity_id = identity_id self.name = name self.repository_id = repository_id self.type = type self.url = url class GitRefUpdate(Model): """GitRefUpdate. :param is_locked: :type is_locked: bool :param name: :type name: str :param new_object_id: :type new_object_id: str :param old_object_id: :type old_object_id: str :param repository_id: :type repository_id: str """ _attribute_map = { 'is_locked': {'key': 'isLocked', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'new_object_id': {'key': 'newObjectId', 'type': 'str'}, 'old_object_id': {'key': 'oldObjectId', 'type': 'str'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'} } def __init__(self, is_locked=None, name=None, new_object_id=None, old_object_id=None, repository_id=None): super(GitRefUpdate, self).__init__() self.is_locked = is_locked self.name = name self.new_object_id = new_object_id self.old_object_id = old_object_id self.repository_id = repository_id class GitRefUpdateResult(Model): """GitRefUpdateResult. :param custom_message: Custom message for the result object For instance, Reason for failing. :type custom_message: str :param is_locked: Whether the ref is locked or not :type is_locked: bool :param name: Ref name :type name: str :param new_object_id: New object ID :type new_object_id: str :param old_object_id: Old object ID :type old_object_id: str :param rejected_by: Name of the plugin that rejected the updated. :type rejected_by: str :param repository_id: Repository ID :type repository_id: str :param success: True if the ref update succeeded, false otherwise :type success: bool :param update_status: Status of the update from the TFS server. :type update_status: object """ _attribute_map = { 'custom_message': {'key': 'customMessage', 'type': 'str'}, 'is_locked': {'key': 'isLocked', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'new_object_id': {'key': 'newObjectId', 'type': 'str'}, 'old_object_id': {'key': 'oldObjectId', 'type': 'str'}, 'rejected_by': {'key': 'rejectedBy', 'type': 'str'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'}, 'success': {'key': 'success', 'type': 'bool'}, 'update_status': {'key': 'updateStatus', 'type': 'object'} } def __init__(self, custom_message=None, is_locked=None, name=None, new_object_id=None, old_object_id=None, rejected_by=None, repository_id=None, success=None, update_status=None): super(GitRefUpdateResult, self).__init__() self.custom_message = custom_message self.is_locked = is_locked self.name = name self.new_object_id = new_object_id self.old_object_id = old_object_id self.rejected_by = rejected_by self.repository_id = repository_id self.success = success self.update_status = update_status class GitRepository(Model): """GitRepository. :param _links: :type _links: :class:`ReferenceLinks ` :param default_branch: :type default_branch: str :param id: :type id: str :param is_fork: True if the repository was created as a fork :type is_fork: bool :param name: :type name: str :param parent_repository: :type parent_repository: :class:`GitRepositoryRef ` :param project: :type project: :class:`TeamProjectReference ` :param remote_url: :type remote_url: str :param size: Compressed size (bytes) of the repository. :type size: long :param ssh_url: :type ssh_url: str :param url: :type url: str :param valid_remote_urls: :type valid_remote_urls: list of str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_fork': {'key': 'isFork', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'parent_repository': {'key': 'parentRepository', 'type': 'GitRepositoryRef'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'size': {'key': 'size', 'type': 'long'}, 'ssh_url': {'key': 'sshUrl', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'valid_remote_urls': {'key': 'validRemoteUrls', 'type': '[str]'} } def __init__(self, _links=None, default_branch=None, id=None, is_fork=None, name=None, parent_repository=None, project=None, remote_url=None, size=None, ssh_url=None, url=None, valid_remote_urls=None): super(GitRepository, self).__init__() self._links = _links self.default_branch = default_branch self.id = id self.is_fork = is_fork self.name = name self.parent_repository = parent_repository self.project = project self.remote_url = remote_url self.size = size self.ssh_url = ssh_url self.url = url self.valid_remote_urls = valid_remote_urls class GitRepositoryCreateOptions(Model): """GitRepositoryCreateOptions. :param name: :type name: str :param parent_repository: :type parent_repository: :class:`GitRepositoryRef ` :param project: :type project: :class:`TeamProjectReference ` """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'parent_repository': {'key': 'parentRepository', 'type': 'GitRepositoryRef'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'} } def __init__(self, name=None, parent_repository=None, project=None): super(GitRepositoryCreateOptions, self).__init__() self.name = name self.parent_repository = parent_repository self.project = project class GitRepositoryRef(Model): """GitRepositoryRef. :param collection: Team Project Collection where this Fork resides :type collection: :class:`TeamProjectCollectionReference ` :param id: :type id: str :param is_fork: True if the repository was created as a fork :type is_fork: bool :param name: :type name: str :param project: :type project: :class:`TeamProjectReference ` :param remote_url: :type remote_url: str :param ssh_url: :type ssh_url: str :param url: :type url: str """ _attribute_map = { 'collection': {'key': 'collection', 'type': 'TeamProjectCollectionReference'}, 'id': {'key': 'id', 'type': 'str'}, 'is_fork': {'key': 'isFork', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'ssh_url': {'key': 'sshUrl', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, collection=None, id=None, is_fork=None, name=None, project=None, remote_url=None, ssh_url=None, url=None): super(GitRepositoryRef, self).__init__() self.collection = collection self.id = id self.is_fork = is_fork self.name = name self.project = project self.remote_url = remote_url self.ssh_url = ssh_url self.url = url class GitRepositoryStats(Model): """GitRepositoryStats. :param active_pull_requests_count: :type active_pull_requests_count: int :param branches_count: :type branches_count: int :param commits_count: :type commits_count: int :param repository_id: :type repository_id: str """ _attribute_map = { 'active_pull_requests_count': {'key': 'activePullRequestsCount', 'type': 'int'}, 'branches_count': {'key': 'branchesCount', 'type': 'int'}, 'commits_count': {'key': 'commitsCount', 'type': 'int'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'} } def __init__(self, active_pull_requests_count=None, branches_count=None, commits_count=None, repository_id=None): super(GitRepositoryStats, self).__init__() self.active_pull_requests_count = active_pull_requests_count self.branches_count = branches_count self.commits_count = commits_count self.repository_id = repository_id class GitRevert(GitAsyncRefOperation): """GitRevert. :param _links: :type _links: :class:`ReferenceLinks ` :param detailed_status: :type detailed_status: :class:`GitAsyncRefOperationDetail ` :param parameters: :type parameters: :class:`GitAsyncRefOperationParameters ` :param status: :type status: object :param url: A URL that can be used to make further requests for status about the operation :type url: str :param revert_id: :type revert_id: int """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'detailed_status': {'key': 'detailedStatus', 'type': 'GitAsyncRefOperationDetail'}, 'parameters': {'key': 'parameters', 'type': 'GitAsyncRefOperationParameters'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'revert_id': {'key': 'revertId', 'type': 'int'} } def __init__(self, _links=None, detailed_status=None, parameters=None, status=None, url=None, revert_id=None): super(GitRevert, self).__init__(_links=_links, detailed_status=detailed_status, parameters=parameters, status=status, url=url) self.revert_id = revert_id class GitStatus(Model): """GitStatus. :param _links: Reference links. :type _links: :class:`ReferenceLinks ` :param context: Context of the status. :type context: :class:`GitStatusContext ` :param created_by: Identity that created the status. :type created_by: :class:`IdentityRef ` :param creation_date: Creation date and time of the status. :type creation_date: datetime :param description: Status description. Typically describes current state of the status. :type description: str :param id: Status identifier. :type id: int :param state: State of the status. :type state: object :param target_url: URL with status details. :type target_url: str :param updated_date: Last update date and time of the status. :type updated_date: datetime """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'context': {'key': 'context', 'type': 'GitStatusContext'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'state': {'key': 'state', 'type': 'object'}, 'target_url': {'key': 'targetUrl', 'type': 'str'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'} } def __init__(self, _links=None, context=None, created_by=None, creation_date=None, description=None, id=None, state=None, target_url=None, updated_date=None): super(GitStatus, self).__init__() self._links = _links self.context = context self.created_by = created_by self.creation_date = creation_date self.description = description self.id = id self.state = state self.target_url = target_url self.updated_date = updated_date class GitStatusContext(Model): """GitStatusContext. :param genre: Genre of the status. Typically name of the service/tool generating the status, can be empty. :type genre: str :param name: Name identifier of the status, cannot be null or empty. :type name: str """ _attribute_map = { 'genre': {'key': 'genre', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, genre=None, name=None): super(GitStatusContext, self).__init__() self.genre = genre self.name = name class GitSuggestion(Model): """GitSuggestion. :param properties: Specific properties describing the suggestion. :type properties: dict :param type: The type of suggestion (e.g. pull request). :type type: str """ _attribute_map = { 'properties': {'key': 'properties', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, properties=None, type=None): super(GitSuggestion, self).__init__() self.properties = properties self.type = type class GitTemplate(Model): """GitTemplate. :param name: Name of the Template :type name: str :param type: Type of the Template :type type: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, name=None, type=None): super(GitTemplate, self).__init__() self.name = name self.type = type class GitTreeDiff(Model): """GitTreeDiff. :param base_tree_id: ObjectId of the base tree of this diff. :type base_tree_id: str :param diff_entries: List of tree entries that differ between the base and target tree. Renames and object type changes are returned as a delete for the old object and add for the new object. If a continuation token is returned in the response header, some tree entries are yet to be processed and may yeild more diff entries. If the continuation token is not returned all the diff entries have been included in this response. :type diff_entries: list of :class:`GitTreeDiffEntry ` :param target_tree_id: ObjectId of the target tree of this diff. :type target_tree_id: str :param url: REST Url to this resource. :type url: str """ _attribute_map = { 'base_tree_id': {'key': 'baseTreeId', 'type': 'str'}, 'diff_entries': {'key': 'diffEntries', 'type': '[GitTreeDiffEntry]'}, 'target_tree_id': {'key': 'targetTreeId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, base_tree_id=None, diff_entries=None, target_tree_id=None, url=None): super(GitTreeDiff, self).__init__() self.base_tree_id = base_tree_id self.diff_entries = diff_entries self.target_tree_id = target_tree_id self.url = url class GitTreeDiffEntry(Model): """GitTreeDiffEntry. :param base_object_id: SHA1 hash of the object in the base tree, if it exists. Will be null in case of adds. :type base_object_id: str :param change_type: Type of change that affected this entry. :type change_type: object :param object_type: Object type of the tree entry. Blob, Tree or Commit("submodule") :type object_type: object :param path: Relative path in base and target trees. :type path: str :param target_object_id: SHA1 hash of the object in the target tree, if it exists. Will be null in case of deletes. :type target_object_id: str """ _attribute_map = { 'base_object_id': {'key': 'baseObjectId', 'type': 'str'}, 'change_type': {'key': 'changeType', 'type': 'object'}, 'object_type': {'key': 'objectType', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'target_object_id': {'key': 'targetObjectId', 'type': 'str'} } def __init__(self, base_object_id=None, change_type=None, object_type=None, path=None, target_object_id=None): super(GitTreeDiffEntry, self).__init__() self.base_object_id = base_object_id self.change_type = change_type self.object_type = object_type self.path = path self.target_object_id = target_object_id class GitTreeDiffResponse(Model): """GitTreeDiffResponse. :param continuation_token: The HTTP client methods find the continuation token header in the response and populate this field. :type continuation_token: list of str :param tree_diff: :type tree_diff: :class:`GitTreeDiff ` """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': '[str]'}, 'tree_diff': {'key': 'treeDiff', 'type': 'GitTreeDiff'} } def __init__(self, continuation_token=None, tree_diff=None): super(GitTreeDiffResponse, self).__init__() self.continuation_token = continuation_token self.tree_diff = tree_diff class GitTreeEntryRef(Model): """GitTreeEntryRef. :param git_object_type: Blob or tree :type git_object_type: object :param mode: Mode represented as octal string :type mode: str :param object_id: SHA1 hash of git object :type object_id: str :param relative_path: Path relative to parent tree object :type relative_path: str :param size: Size of content :type size: long :param url: url to retrieve tree or blob :type url: str """ _attribute_map = { 'git_object_type': {'key': 'gitObjectType', 'type': 'object'}, 'mode': {'key': 'mode', 'type': 'str'}, 'object_id': {'key': 'objectId', 'type': 'str'}, 'relative_path': {'key': 'relativePath', 'type': 'str'}, 'size': {'key': 'size', 'type': 'long'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, git_object_type=None, mode=None, object_id=None, relative_path=None, size=None, url=None): super(GitTreeEntryRef, self).__init__() self.git_object_type = git_object_type self.mode = mode self.object_id = object_id self.relative_path = relative_path self.size = size self.url = url class GitTreeRef(Model): """GitTreeRef. :param _links: :type _links: :class:`ReferenceLinks ` :param object_id: SHA1 hash of git object :type object_id: str :param size: Sum of sizes of all children :type size: long :param tree_entries: Blobs and trees under this tree :type tree_entries: list of :class:`GitTreeEntryRef ` :param url: Url to tree :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'object_id': {'key': 'objectId', 'type': 'str'}, 'size': {'key': 'size', 'type': 'long'}, 'tree_entries': {'key': 'treeEntries', 'type': '[GitTreeEntryRef]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, object_id=None, size=None, tree_entries=None, url=None): super(GitTreeRef, self).__init__() self._links = _links self.object_id = object_id self.size = size self.tree_entries = tree_entries self.url = url class GitUserDate(Model): """GitUserDate. :param date: Date of the Git operation. :type date: datetime :param email: Email address of the user performing the Git operation. :type email: str :param image_url: Url for the user's avatar. :type image_url: str :param name: Name of the user performing the Git operation. :type name: str """ _attribute_map = { 'date': {'key': 'date', 'type': 'iso-8601'}, 'email': {'key': 'email', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, date=None, email=None, image_url=None, name=None): super(GitUserDate, self).__init__() self.date = date self.email = email self.image_url = image_url self.name = name class GitVersionDescriptor(Model): """GitVersionDescriptor. :param version: Version string identifier (name of tag/branch, SHA1 of commit) :type version: str :param version_options: Version options - Specify additional modifiers to version (e.g Previous) :type version_options: object :param version_type: Version type (branch, tag, or commit). Determines how Id is interpreted :type version_type: object """ _attribute_map = { 'version': {'key': 'version', 'type': 'str'}, 'version_options': {'key': 'versionOptions', 'type': 'object'}, 'version_type': {'key': 'versionType', 'type': 'object'} } def __init__(self, version=None, version_options=None, version_type=None): super(GitVersionDescriptor, self).__init__() self.version = version self.version_options = version_options self.version_type = version_type class GlobalGitRepositoryKey(Model): """GlobalGitRepositoryKey. :param collection_id: Team Project Collection ID of the collection for the repository. :type collection_id: str :param project_id: Team Project ID of the project for the repository. :type project_id: str :param repository_id: ID of the repository. :type repository_id: str """ _attribute_map = { 'collection_id': {'key': 'collectionId', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'} } def __init__(self, collection_id=None, project_id=None, repository_id=None): super(GlobalGitRepositoryKey, self).__init__() self.collection_id = collection_id self.project_id = project_id self.repository_id = repository_id class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class IdentityRefWithVote(IdentityRef): """IdentityRefWithVote. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str :param is_required: Indicates if this is a required reviewer for this pull request.
Branches can have policies that require particular reviewers are required for pull requests. :type is_required: bool :param reviewer_url: URL to retrieve information about this identity :type reviewer_url: str :param vote: Vote on a pull request:
10 - approved 5 - approved with suggestions 0 - no vote -5 - waiting for author -10 - rejected :type vote: int :param voted_for: Groups or teams that that this reviewer contributed to.
Groups and teams can be reviewers on pull requests but can not vote directly. When a member of the group or team votes, that vote is rolled up into the group or team vote. VotedFor is a list of such votes. :type voted_for: list of :class:`IdentityRefWithVote ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'}, 'is_required': {'key': 'isRequired', 'type': 'bool'}, 'reviewer_url': {'key': 'reviewerUrl', 'type': 'str'}, 'vote': {'key': 'vote', 'type': 'int'}, 'voted_for': {'key': 'votedFor', 'type': '[IdentityRefWithVote]'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None, is_required=None, reviewer_url=None, vote=None, voted_for=None): super(IdentityRefWithVote, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, directory_alias=directory_alias, id=id, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, is_deleted_in_origin=is_deleted_in_origin, profile_url=profile_url, unique_name=unique_name) self.is_required = is_required self.reviewer_url = reviewer_url self.vote = vote self.voted_for = voted_for class ImportRepositoryValidation(Model): """ImportRepositoryValidation. :param git_source: :type git_source: :class:`GitImportGitSource ` :param password: :type password: str :param tfvc_source: :type tfvc_source: :class:`GitImportTfvcSource ` :param username: :type username: str """ _attribute_map = { 'git_source': {'key': 'gitSource', 'type': 'GitImportGitSource'}, 'password': {'key': 'password', 'type': 'str'}, 'tfvc_source': {'key': 'tfvcSource', 'type': 'GitImportTfvcSource'}, 'username': {'key': 'username', 'type': 'str'} } def __init__(self, git_source=None, password=None, tfvc_source=None, username=None): super(ImportRepositoryValidation, self).__init__() self.git_source = git_source self.password = password self.tfvc_source = tfvc_source self.username = username class ItemContent(Model): """ItemContent. :param content: :type content: str :param content_type: :type content_type: object """ _attribute_map = { 'content': {'key': 'content', 'type': 'str'}, 'content_type': {'key': 'contentType', 'type': 'object'} } def __init__(self, content=None, content_type=None): super(ItemContent, self).__init__() self.content = content self.content_type = content_type class ItemModel(Model): """ItemModel. :param _links: :type _links: :class:`ReferenceLinks ` :param content: :type content: str :param content_metadata: :type content_metadata: :class:`FileContentMetadata ` :param is_folder: :type is_folder: bool :param is_sym_link: :type is_sym_link: bool :param path: :type path: str :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'content': {'key': 'content', 'type': 'str'}, 'content_metadata': {'key': 'contentMetadata', 'type': 'FileContentMetadata'}, 'is_folder': {'key': 'isFolder', 'type': 'bool'}, 'is_sym_link': {'key': 'isSymLink', 'type': 'bool'}, 'path': {'key': 'path', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, content=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None): super(ItemModel, self).__init__() self._links = _links self.content = content self.content_metadata = content_metadata self.is_folder = is_folder self.is_sym_link = is_sym_link self.path = path self.url = url class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class LineDiffBlock(Model): """LineDiffBlock. :param change_type: Type of change that was made to the block. :type change_type: object :param modified_line_number_start: Line number where this block starts in modified file. :type modified_line_number_start: int :param modified_lines_count: Count of lines in this block in modified file. :type modified_lines_count: int :param original_line_number_start: Line number where this block starts in original file. :type original_line_number_start: int :param original_lines_count: Count of lines in this block in original file. :type original_lines_count: int """ _attribute_map = { 'change_type': {'key': 'changeType', 'type': 'object'}, 'modified_line_number_start': {'key': 'modifiedLineNumberStart', 'type': 'int'}, 'modified_lines_count': {'key': 'modifiedLinesCount', 'type': 'int'}, 'original_line_number_start': {'key': 'originalLineNumberStart', 'type': 'int'}, 'original_lines_count': {'key': 'originalLinesCount', 'type': 'int'} } def __init__(self, change_type=None, modified_line_number_start=None, modified_lines_count=None, original_line_number_start=None, original_lines_count=None): super(LineDiffBlock, self).__init__() self.change_type = change_type self.modified_line_number_start = modified_line_number_start self.modified_lines_count = modified_lines_count self.original_line_number_start = original_line_number_start self.original_lines_count = original_lines_count class PolicyConfigurationRef(Model): """PolicyConfigurationRef. :param id: The policy configuration ID. :type id: int :param type: The policy configuration type. :type type: :class:`PolicyTypeRef ` :param url: The URL where the policy configuration can be retrieved. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'PolicyTypeRef'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, type=None, url=None): super(PolicyConfigurationRef, self).__init__() self.id = id self.type = type self.url = url class PolicyTypeRef(Model): """PolicyTypeRef. :param display_name: Display name of the policy type. :type display_name: str :param id: The policy type ID. :type id: str :param url: The URL where the policy type can be retrieved. :type url: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, display_name=None, id=None, url=None): super(PolicyTypeRef, self).__init__() self.display_name = display_name self.id = id self.url = url class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class ResourceRef(Model): """ResourceRef. :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(ResourceRef, self).__init__() self.id = id self.url = url class ShareNotificationContext(Model): """ShareNotificationContext. :param message: Optional user note or message. :type message: str :param receivers: Identities of users who will receive a share notification. :type receivers: list of :class:`IdentityRef ` """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'receivers': {'key': 'receivers', 'type': '[IdentityRef]'} } def __init__(self, message=None, receivers=None): super(ShareNotificationContext, self).__init__() self.message = message self.receivers = receivers class SourceToTargetRef(Model): """SourceToTargetRef. :param source_ref: The source ref to copy. For example, refs/heads/master. :type source_ref: str :param target_ref: The target ref to update. For example, refs/heads/master. :type target_ref: str """ _attribute_map = { 'source_ref': {'key': 'sourceRef', 'type': 'str'}, 'target_ref': {'key': 'targetRef', 'type': 'str'} } def __init__(self, source_ref=None, target_ref=None): super(SourceToTargetRef, self).__init__() self.source_ref = source_ref self.target_ref = target_ref class TeamProjectCollectionReference(Model): """TeamProjectCollectionReference. :param id: Collection Id. :type id: str :param name: Collection Name. :type name: str :param url: Collection REST Url. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, name=None, url=None): super(TeamProjectCollectionReference, self).__init__() self.id = id self.name = name self.url = url class TeamProjectReference(Model): """TeamProjectReference. :param abbreviation: Project abbreviation. :type abbreviation: str :param default_team_image_url: Url to default team identity image. :type default_team_image_url: str :param description: The project's description (if any). :type description: str :param id: Project identifier. :type id: str :param name: Project name. :type name: str :param revision: Project revision. :type revision: long :param state: Project state. :type state: object :param url: Url to the full version of the object. :type url: str :param visibility: Project visibility. :type visibility: object """ _attribute_map = { 'abbreviation': {'key': 'abbreviation', 'type': 'str'}, 'default_team_image_url': {'key': 'defaultTeamImageUrl', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'long'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'visibility': {'key': 'visibility', 'type': 'object'} } def __init__(self, abbreviation=None, default_team_image_url=None, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): super(TeamProjectReference, self).__init__() self.abbreviation = abbreviation self.default_team_image_url = default_team_image_url self.description = description self.id = id self.name = name self.revision = revision self.state = state self.url = url self.visibility = visibility class VersionedPolicyConfigurationRef(PolicyConfigurationRef): """VersionedPolicyConfigurationRef. :param id: The policy configuration ID. :type id: int :param type: The policy configuration type. :type type: :class:`PolicyTypeRef ` :param url: The URL where the policy configuration can be retrieved. :type url: str :param revision: The policy configuration revision ID. :type revision: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'PolicyTypeRef'}, 'url': {'key': 'url', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'} } def __init__(self, id=None, type=None, url=None, revision=None): super(VersionedPolicyConfigurationRef, self).__init__(id=id, type=type, url=url) self.revision = revision class VstsInfo(Model): """VstsInfo. :param collection: :type collection: :class:`TeamProjectCollectionReference ` :param repository: :type repository: :class:`GitRepository ` :param server_url: :type server_url: str """ _attribute_map = { 'collection': {'key': 'collection', 'type': 'TeamProjectCollectionReference'}, 'repository': {'key': 'repository', 'type': 'GitRepository'}, 'server_url': {'key': 'serverUrl', 'type': 'str'} } def __init__(self, collection=None, repository=None, server_url=None): super(VstsInfo, self).__init__() self.collection = collection self.repository = repository self.server_url = server_url class WebApiCreateTagRequestData(Model): """WebApiCreateTagRequestData. :param name: Name of the tag definition that will be created. :type name: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'} } def __init__(self, name=None): super(WebApiCreateTagRequestData, self).__init__() self.name = name class WebApiTagDefinition(Model): """WebApiTagDefinition. :param active: Whether or not the tag definition is active. :type active: bool :param id: ID of the tag definition. :type id: str :param name: The name of the tag definition. :type name: str :param url: Resource URL for the Tag Definition. :type url: str """ _attribute_map = { 'active': {'key': 'active', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, active=None, id=None, name=None, url=None): super(WebApiTagDefinition, self).__init__() self.active = active self.id = id self.name = name self.url = url class GitBaseVersionDescriptor(GitVersionDescriptor): """GitBaseVersionDescriptor. :param version: Version string identifier (name of tag/branch, SHA1 of commit) :type version: str :param version_options: Version options - Specify additional modifiers to version (e.g Previous) :type version_options: object :param version_type: Version type (branch, tag, or commit). Determines how Id is interpreted :type version_type: object :param base_version: Version string identifier (name of tag/branch, SHA1 of commit) :type base_version: str :param base_version_options: Version options - Specify additional modifiers to version (e.g Previous) :type base_version_options: object :param base_version_type: Version type (branch, tag, or commit). Determines how Id is interpreted :type base_version_type: object """ _attribute_map = { 'version': {'key': 'version', 'type': 'str'}, 'version_options': {'key': 'versionOptions', 'type': 'object'}, 'version_type': {'key': 'versionType', 'type': 'object'}, 'base_version': {'key': 'baseVersion', 'type': 'str'}, 'base_version_options': {'key': 'baseVersionOptions', 'type': 'object'}, 'base_version_type': {'key': 'baseVersionType', 'type': 'object'} } def __init__(self, version=None, version_options=None, version_type=None, base_version=None, base_version_options=None, base_version_type=None): super(GitBaseVersionDescriptor, self).__init__(version=version, version_options=version_options, version_type=version_type) self.base_version = base_version self.base_version_options = base_version_options self.base_version_type = base_version_type class GitCommit(GitCommitRef): """GitCommit. :param _links: A collection of related REST reference links. :type _links: :class:`ReferenceLinks ` :param author: Author of the commit. :type author: :class:`GitUserDate ` :param change_counts: Counts of the types of changes (edits, deletes, etc.) included with the commit. :type change_counts: dict :param changes: An enumeration of the changes included with the commit. :type changes: list of :class:`object ` :param comment: Comment or message of the commit. :type comment: str :param comment_truncated: Indicates if the comment is truncated from the full Git commit comment message. :type comment_truncated: bool :param commit_id: ID (SHA-1) of the commit. :type commit_id: str :param committer: Committer of the commit. :type committer: :class:`GitUserDate ` :param parents: An enumeration of the parent commit IDs for this commit. :type parents: list of str :param push: The push associated with this commit. :type push: :class:`GitPushRef ` :param remote_url: Remote URL path to the commit. :type remote_url: str :param statuses: A list of status metadata from services and extensions that may associate additional information to the commit. :type statuses: list of :class:`GitStatus ` :param url: REST URL for this resource. :type url: str :param work_items: A list of workitems associated with this commit. :type work_items: list of :class:`ResourceRef ` :param tree_id: :type tree_id: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'GitUserDate'}, 'change_counts': {'key': 'changeCounts', 'type': '{int}'}, 'changes': {'key': 'changes', 'type': '[object]'}, 'comment': {'key': 'comment', 'type': 'str'}, 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, 'commit_id': {'key': 'commitId', 'type': 'str'}, 'committer': {'key': 'committer', 'type': 'GitUserDate'}, 'parents': {'key': 'parents', 'type': '[str]'}, 'push': {'key': 'push', 'type': 'GitPushRef'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'statuses': {'key': 'statuses', 'type': '[GitStatus]'}, 'url': {'key': 'url', 'type': 'str'}, 'work_items': {'key': 'workItems', 'type': '[ResourceRef]'}, 'tree_id': {'key': 'treeId', 'type': 'str'} } def __init__(self, _links=None, author=None, change_counts=None, changes=None, comment=None, comment_truncated=None, commit_id=None, committer=None, parents=None, push=None, remote_url=None, statuses=None, url=None, work_items=None, tree_id=None): super(GitCommit, self).__init__(_links=_links, author=author, change_counts=change_counts, changes=changes, comment=comment, comment_truncated=comment_truncated, commit_id=commit_id, committer=committer, parents=parents, push=push, remote_url=remote_url, statuses=statuses, url=url, work_items=work_items) self.tree_id = tree_id class GitForkRef(GitRef): """GitForkRef. :param _links: :type _links: :class:`ReferenceLinks ` :param creator: :type creator: :class:`IdentityRef ` :param is_locked: :type is_locked: bool :param is_locked_by: :type is_locked_by: :class:`IdentityRef ` :param name: :type name: str :param object_id: :type object_id: str :param peeled_object_id: :type peeled_object_id: str :param statuses: :type statuses: list of :class:`GitStatus ` :param url: :type url: str :param repository: The repository ID of the fork. :type repository: :class:`GitRepository ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'creator': {'key': 'creator', 'type': 'IdentityRef'}, 'is_locked': {'key': 'isLocked', 'type': 'bool'}, 'is_locked_by': {'key': 'isLockedBy', 'type': 'IdentityRef'}, 'name': {'key': 'name', 'type': 'str'}, 'object_id': {'key': 'objectId', 'type': 'str'}, 'peeled_object_id': {'key': 'peeledObjectId', 'type': 'str'}, 'statuses': {'key': 'statuses', 'type': '[GitStatus]'}, 'url': {'key': 'url', 'type': 'str'}, 'repository': {'key': 'repository', 'type': 'GitRepository'} } def __init__(self, _links=None, creator=None, is_locked=None, is_locked_by=None, name=None, object_id=None, peeled_object_id=None, statuses=None, url=None, repository=None): super(GitForkRef, self).__init__(_links=_links, creator=creator, is_locked=is_locked, is_locked_by=is_locked_by, name=name, object_id=object_id, peeled_object_id=peeled_object_id, statuses=statuses, url=url) self.repository = repository class GitItem(ItemModel): """GitItem. :param _links: :type _links: :class:`ReferenceLinks ` :param content: :type content: str :param content_metadata: :type content_metadata: :class:`FileContentMetadata ` :param is_folder: :type is_folder: bool :param is_sym_link: :type is_sym_link: bool :param path: :type path: str :param url: :type url: str :param commit_id: SHA1 of commit item was fetched at :type commit_id: str :param git_object_type: Type of object (Commit, Tree, Blob, Tag, ...) :type git_object_type: object :param latest_processed_change: Shallow ref to commit that last changed this item Only populated if latestProcessedChange is requested May not be accurate if latest change is not yet cached :type latest_processed_change: :class:`GitCommitRef ` :param object_id: Git object id :type object_id: str :param original_object_id: Git object id :type original_object_id: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'content': {'key': 'content', 'type': 'str'}, 'content_metadata': {'key': 'contentMetadata', 'type': 'FileContentMetadata'}, 'is_folder': {'key': 'isFolder', 'type': 'bool'}, 'is_sym_link': {'key': 'isSymLink', 'type': 'bool'}, 'path': {'key': 'path', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'commit_id': {'key': 'commitId', 'type': 'str'}, 'git_object_type': {'key': 'gitObjectType', 'type': 'object'}, 'latest_processed_change': {'key': 'latestProcessedChange', 'type': 'GitCommitRef'}, 'object_id': {'key': 'objectId', 'type': 'str'}, 'original_object_id': {'key': 'originalObjectId', 'type': 'str'} } def __init__(self, _links=None, content=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None, commit_id=None, git_object_type=None, latest_processed_change=None, object_id=None, original_object_id=None): super(GitItem, self).__init__(_links=_links, content=content, content_metadata=content_metadata, is_folder=is_folder, is_sym_link=is_sym_link, path=path, url=url) self.commit_id = commit_id self.git_object_type = git_object_type self.latest_processed_change = latest_processed_change self.object_id = object_id self.original_object_id = original_object_id class GitMerge(GitMergeParameters): """GitMerge. :param comment: Comment or message of the commit. :type comment: str :param parents: An enumeration of the parent commit IDs for the merge commit. :type parents: list of str :param _links: Reference links. :type _links: :class:`ReferenceLinks ` :param detailed_status: Detailed status of the merge operation. :type detailed_status: :class:`GitMergeOperationStatusDetail ` :param merge_operation_id: Unique identifier for the merge operation. :type merge_operation_id: int :param status: Status of the merge operation. :type status: object """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'parents': {'key': 'parents', 'type': '[str]'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'detailed_status': {'key': 'detailedStatus', 'type': 'GitMergeOperationStatusDetail'}, 'merge_operation_id': {'key': 'mergeOperationId', 'type': 'int'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, comment=None, parents=None, _links=None, detailed_status=None, merge_operation_id=None, status=None): super(GitMerge, self).__init__(comment=comment, parents=parents) self._links = _links self.detailed_status = detailed_status self.merge_operation_id = merge_operation_id self.status = status class GitPullRequestStatus(GitStatus): """GitPullRequestStatus. :param _links: Reference links. :type _links: :class:`ReferenceLinks ` :param context: Context of the status. :type context: :class:`GitStatusContext ` :param created_by: Identity that created the status. :type created_by: :class:`IdentityRef ` :param creation_date: Creation date and time of the status. :type creation_date: datetime :param description: Status description. Typically describes current state of the status. :type description: str :param id: Status identifier. :type id: int :param state: State of the status. :type state: object :param target_url: URL with status details. :type target_url: str :param updated_date: Last update date and time of the status. :type updated_date: datetime :param iteration_id: ID of the iteration to associate status with. Minimum value is 1. :type iteration_id: int :param properties: Custom properties of the status. :type properties: :class:`object ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'context': {'key': 'context', 'type': 'GitStatusContext'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'state': {'key': 'state', 'type': 'object'}, 'target_url': {'key': 'targetUrl', 'type': 'str'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'iteration_id': {'key': 'iterationId', 'type': 'int'}, 'properties': {'key': 'properties', 'type': 'object'} } def __init__(self, _links=None, context=None, created_by=None, creation_date=None, description=None, id=None, state=None, target_url=None, updated_date=None, iteration_id=None, properties=None): super(GitPullRequestStatus, self).__init__(_links=_links, context=context, created_by=created_by, creation_date=creation_date, description=description, id=id, state=state, target_url=target_url, updated_date=updated_date) self.iteration_id = iteration_id self.properties = properties class GitPush(GitPushRef): """GitPush. :param _links: :type _links: :class:`ReferenceLinks ` :param date: :type date: datetime :param push_correlation_id: :type push_correlation_id: str :param pushed_by: :type pushed_by: :class:`IdentityRef ` :param push_id: :type push_id: int :param url: :type url: str :param commits: :type commits: list of :class:`GitCommitRef ` :param ref_updates: :type ref_updates: list of :class:`GitRefUpdate ` :param repository: :type repository: :class:`GitRepository ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'date': {'key': 'date', 'type': 'iso-8601'}, 'push_correlation_id': {'key': 'pushCorrelationId', 'type': 'str'}, 'pushed_by': {'key': 'pushedBy', 'type': 'IdentityRef'}, 'push_id': {'key': 'pushId', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'}, 'commits': {'key': 'commits', 'type': '[GitCommitRef]'}, 'ref_updates': {'key': 'refUpdates', 'type': '[GitRefUpdate]'}, 'repository': {'key': 'repository', 'type': 'GitRepository'} } def __init__(self, _links=None, date=None, push_correlation_id=None, pushed_by=None, push_id=None, url=None, commits=None, ref_updates=None, repository=None): super(GitPush, self).__init__(_links=_links, date=date, push_correlation_id=push_correlation_id, pushed_by=pushed_by, push_id=push_id, url=url) self.commits = commits self.ref_updates = ref_updates self.repository = repository class GitTargetVersionDescriptor(GitVersionDescriptor): """GitTargetVersionDescriptor. :param version: Version string identifier (name of tag/branch, SHA1 of commit) :type version: str :param version_options: Version options - Specify additional modifiers to version (e.g Previous) :type version_options: object :param version_type: Version type (branch, tag, or commit). Determines how Id is interpreted :type version_type: object :param target_version: Version string identifier (name of tag/branch, SHA1 of commit) :type target_version: str :param target_version_options: Version options - Specify additional modifiers to version (e.g Previous) :type target_version_options: object :param target_version_type: Version type (branch, tag, or commit). Determines how Id is interpreted :type target_version_type: object """ _attribute_map = { 'version': {'key': 'version', 'type': 'str'}, 'version_options': {'key': 'versionOptions', 'type': 'object'}, 'version_type': {'key': 'versionType', 'type': 'object'}, 'target_version': {'key': 'targetVersion', 'type': 'str'}, 'target_version_options': {'key': 'targetVersionOptions', 'type': 'object'}, 'target_version_type': {'key': 'targetVersionType', 'type': 'object'} } def __init__(self, version=None, version_options=None, version_type=None, target_version=None, target_version_options=None, target_version_type=None): super(GitTargetVersionDescriptor, self).__init__(version=version, version_options=version_options, version_type=version_type) self.target_version = target_version self.target_version_options = target_version_options self.target_version_type = target_version_type class PolicyConfiguration(VersionedPolicyConfigurationRef): """PolicyConfiguration. :param id: The policy configuration ID. :type id: int :param type: The policy configuration type. :type type: :class:`PolicyTypeRef ` :param url: The URL where the policy configuration can be retrieved. :type url: str :param revision: The policy configuration revision ID. :type revision: int :param _links: The links to other objects related to this object. :type _links: :class:`ReferenceLinks ` :param created_by: A reference to the identity that created the policy. :type created_by: :class:`IdentityRef ` :param created_date: The date and time when the policy was created. :type created_date: datetime :param is_blocking: Indicates whether the policy is blocking. :type is_blocking: bool :param is_deleted: Indicates whether the policy has been (soft) deleted. :type is_deleted: bool :param is_enabled: Indicates whether the policy is enabled. :type is_enabled: bool :param settings: The policy configuration settings. :type settings: object """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'PolicyTypeRef'}, 'url': {'key': 'url', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'is_blocking': {'key': 'isBlocking', 'type': 'bool'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'} } def __init__(self, id=None, type=None, url=None, revision=None, _links=None, created_by=None, created_date=None, is_blocking=None, is_deleted=None, is_enabled=None, settings=None): super(PolicyConfiguration, self).__init__(id=id, type=type, url=url, revision=revision) self._links = _links self.created_by = created_by self.created_date = created_date self.is_blocking = is_blocking self.is_deleted = is_deleted self.is_enabled = is_enabled self.settings = settings __all__ = [ 'Attachment', 'Change', 'Comment', 'CommentIterationContext', 'CommentPosition', 'CommentThread', 'CommentThreadContext', 'CommentTrackingCriteria', 'FileContentMetadata', 'FileDiff', 'FileDiffParams', 'FileDiffsCriteria', 'GitAnnotatedTag', 'GitAsyncRefOperation', 'GitAsyncRefOperationDetail', 'GitAsyncRefOperationParameters', 'GitAsyncRefOperationSource', 'GitBlobRef', 'GitBranchStats', 'GitCherryPick', 'GitCommitChanges', 'GitCommitDiffs', 'GitCommitRef', 'GitConflict', 'GitConflictUpdateResult', 'GitDeletedRepository', 'GitFilePathsCollection', 'GitForkOperationStatusDetail', 'GitForkSyncRequest', 'GitForkSyncRequestParameters', 'GitImportGitSource', 'GitImportRequest', 'GitImportRequestParameters', 'GitImportStatusDetail', 'GitImportTfvcSource', 'GitItemDescriptor', 'GitItemRequestData', 'GitMergeOperationStatusDetail', 'GitMergeOriginRef', 'GitMergeParameters', 'GitObject', 'GitPullRequest', 'GitPullRequestChange', 'GitPullRequestCommentThread', 'GitPullRequestCommentThreadContext', 'GitPullRequestCompletionOptions', 'GitPullRequestIteration', 'GitPullRequestIterationChanges', 'GitPullRequestMergeOptions', 'GitPullRequestQuery', 'GitPullRequestQueryInput', 'GitPullRequestSearchCriteria', 'GitPushRef', 'GitPushSearchCriteria', 'GitQueryBranchStatsCriteria', 'GitQueryCommitsCriteria', 'GitRecycleBinRepositoryDetails', 'GitRef', 'GitRefFavorite', 'GitRefUpdate', 'GitRefUpdateResult', 'GitRepository', 'GitRepositoryCreateOptions', 'GitRepositoryRef', 'GitRepositoryStats', 'GitRevert', 'GitStatus', 'GitStatusContext', 'GitSuggestion', 'GitTemplate', 'GitTreeDiff', 'GitTreeDiffEntry', 'GitTreeDiffResponse', 'GitTreeEntryRef', 'GitTreeRef', 'GitUserDate', 'GitVersionDescriptor', 'GlobalGitRepositoryKey', 'GraphSubjectBase', 'IdentityRef', 'IdentityRefWithVote', 'ImportRepositoryValidation', 'ItemContent', 'ItemModel', 'JsonPatchOperation', 'LineDiffBlock', 'PolicyConfigurationRef', 'PolicyTypeRef', 'ReferenceLinks', 'ResourceRef', 'ShareNotificationContext', 'SourceToTargetRef', 'TeamProjectCollectionReference', 'TeamProjectReference', 'VersionedPolicyConfigurationRef', 'VstsInfo', 'WebApiCreateTagRequestData', 'WebApiTagDefinition', 'GitBaseVersionDescriptor', 'GitCommit', 'GitForkRef', 'GitItem', 'GitMerge', 'GitPullRequestStatus', 'GitPush', 'GitTargetVersionDescriptor', 'PolicyConfiguration', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/graph/000077500000000000000000000000001360605530400301565ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/graph/__init__.py000066400000000000000000000024011360605530400322640ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .graph_client import GraphClient __all__ = [ 'GraphCachePolicies', 'GraphDescriptorResult', 'GraphFederatedProviderData', 'GraphGlobalExtendedPropertyBatch', 'GraphGroup', 'GraphGroupCreationContext', 'GraphMember', 'GraphMembership', 'GraphMembershipState', 'GraphMembershipTraversal', 'GraphProviderInfo', 'GraphScope', 'GraphScopeCreationContext', 'GraphStorageKeyResult', 'GraphSubject', 'GraphSubjectBase', 'GraphSubjectLookup', 'GraphSubjectLookupKey', 'GraphUser', 'GraphUserCreationContext', 'JsonPatchOperation', 'PagedGraphGroups', 'PagedGraphUsers', 'ReferenceLinks', 'GraphClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/graph/graph_client.py000066400000000000000000000517321360605530400331770ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class GraphClient(Client): """Graph :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(GraphClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'bb1e7ec9-e901-4b68-999a-de7012b920f8' def get_descriptor(self, storage_key): """GetDescriptor. [Preview API] Resolve a storage key to a descriptor :param str storage_key: Storage key of the subject (user, group, scope, etc.) to resolve :rtype: :class:` ` """ route_values = {} if storage_key is not None: route_values['storageKey'] = self._serialize.url('storage_key', storage_key, 'str') response = self._send(http_method='GET', location_id='048aee0a-7072-4cde-ab73-7af77b1e0b4e', version='5.0-preview.1', route_values=route_values) return self._deserialize('GraphDescriptorResult', response) def create_group(self, creation_context, scope_descriptor=None, group_descriptors=None): """CreateGroup. [Preview API] Create a new VSTS group or materialize an existing AAD group. :param :class:` ` creation_context: The subset of the full graph group used to uniquely find the graph subject in an external provider. :param str scope_descriptor: A descriptor referencing the scope (collection, project) in which the group should be created. If omitted, will be created in the scope of the enclosing account or organization. Valid only for VSTS groups. :param [str] group_descriptors: A comma separated list of descriptors referencing groups you want the graph group to join :rtype: :class:` ` """ query_parameters = {} if scope_descriptor is not None: query_parameters['scopeDescriptor'] = self._serialize.query('scope_descriptor', scope_descriptor, 'str') if group_descriptors is not None: group_descriptors = ",".join(group_descriptors) query_parameters['groupDescriptors'] = self._serialize.query('group_descriptors', group_descriptors, 'str') content = self._serialize.body(creation_context, 'GraphGroupCreationContext') response = self._send(http_method='POST', location_id='ebbe6af8-0b91-4c13-8cf1-777c14858188', version='5.0-preview.1', query_parameters=query_parameters, content=content) return self._deserialize('GraphGroup', response) def delete_group(self, group_descriptor): """DeleteGroup. [Preview API] Removes a VSTS group from all of its parent groups. :param str group_descriptor: The descriptor of the group to delete. """ route_values = {} if group_descriptor is not None: route_values['groupDescriptor'] = self._serialize.url('group_descriptor', group_descriptor, 'str') self._send(http_method='DELETE', location_id='ebbe6af8-0b91-4c13-8cf1-777c14858188', version='5.0-preview.1', route_values=route_values) def get_group(self, group_descriptor): """GetGroup. [Preview API] Get a group by its descriptor. :param str group_descriptor: The descriptor of the desired graph group. :rtype: :class:` ` """ route_values = {} if group_descriptor is not None: route_values['groupDescriptor'] = self._serialize.url('group_descriptor', group_descriptor, 'str') response = self._send(http_method='GET', location_id='ebbe6af8-0b91-4c13-8cf1-777c14858188', version='5.0-preview.1', route_values=route_values) return self._deserialize('GraphGroup', response) def list_groups(self, scope_descriptor=None, subject_types=None, continuation_token=None): """ListGroups. [Preview API] Gets a list of all groups in the current scope (usually organization or account). :param str scope_descriptor: Specify a non-default scope (collection, project) to search for groups. :param [str] subject_types: A comma separated list of user subject subtypes to reduce the retrieved results, e.g. Microsoft.IdentityModel.Claims.ClaimsIdentity :param str continuation_token: An opaque data blob that allows the next page of data to resume immediately after where the previous page ended. The only reliable way to know if there is more data left is the presence of a continuation token. :rtype: :class:` ` """ query_parameters = {} if scope_descriptor is not None: query_parameters['scopeDescriptor'] = self._serialize.query('scope_descriptor', scope_descriptor, 'str') if subject_types is not None: subject_types = ",".join(subject_types) query_parameters['subjectTypes'] = self._serialize.query('subject_types', subject_types, 'str') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='ebbe6af8-0b91-4c13-8cf1-777c14858188', version='5.0-preview.1', query_parameters=query_parameters) response_object = models.PagedGraphGroups() response_object.graph_groups = self._deserialize('[GraphGroup]', self._unwrap_collection(response)) response_object.continuation_token = response.headers.get('X-MS-ContinuationToken') return response_object def update_group(self, group_descriptor, patch_document): """UpdateGroup. [Preview API] Update the properties of a VSTS group. :param str group_descriptor: The descriptor of the group to modify. :param :class:`<[JsonPatchOperation]> ` patch_document: The JSON+Patch document containing the fields to alter. :rtype: :class:` ` """ route_values = {} if group_descriptor is not None: route_values['groupDescriptor'] = self._serialize.url('group_descriptor', group_descriptor, 'str') content = self._serialize.body(patch_document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='ebbe6af8-0b91-4c13-8cf1-777c14858188', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') return self._deserialize('GraphGroup', response) def add_membership(self, subject_descriptor, container_descriptor): """AddMembership. [Preview API] Create a new membership between a container and subject. :param str subject_descriptor: A descriptor to a group or user that can be the child subject in the relationship. :param str container_descriptor: A descriptor to a group that can be the container in the relationship. :rtype: :class:` ` """ route_values = {} if subject_descriptor is not None: route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') if container_descriptor is not None: route_values['containerDescriptor'] = self._serialize.url('container_descriptor', container_descriptor, 'str') response = self._send(http_method='PUT', location_id='3fd2e6ca-fb30-443a-b579-95b19ed0934c', version='5.0-preview.1', route_values=route_values) return self._deserialize('GraphMembership', response) def check_membership_existence(self, subject_descriptor, container_descriptor): """CheckMembershipExistence. [Preview API] Check to see if a membership relationship between a container and subject exists. :param str subject_descriptor: The group or user that is a child subject of the relationship. :param str container_descriptor: The group that is the container in the relationship. """ route_values = {} if subject_descriptor is not None: route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') if container_descriptor is not None: route_values['containerDescriptor'] = self._serialize.url('container_descriptor', container_descriptor, 'str') self._send(http_method='HEAD', location_id='3fd2e6ca-fb30-443a-b579-95b19ed0934c', version='5.0-preview.1', route_values=route_values) def get_membership(self, subject_descriptor, container_descriptor): """GetMembership. [Preview API] Get a membership relationship between a container and subject. :param str subject_descriptor: A descriptor to the child subject in the relationship. :param str container_descriptor: A descriptor to the container in the relationship. :rtype: :class:` ` """ route_values = {} if subject_descriptor is not None: route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') if container_descriptor is not None: route_values['containerDescriptor'] = self._serialize.url('container_descriptor', container_descriptor, 'str') response = self._send(http_method='GET', location_id='3fd2e6ca-fb30-443a-b579-95b19ed0934c', version='5.0-preview.1', route_values=route_values) return self._deserialize('GraphMembership', response) def remove_membership(self, subject_descriptor, container_descriptor): """RemoveMembership. [Preview API] Deletes a membership between a container and subject. :param str subject_descriptor: A descriptor to a group or user that is the child subject in the relationship. :param str container_descriptor: A descriptor to a group that is the container in the relationship. """ route_values = {} if subject_descriptor is not None: route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') if container_descriptor is not None: route_values['containerDescriptor'] = self._serialize.url('container_descriptor', container_descriptor, 'str') self._send(http_method='DELETE', location_id='3fd2e6ca-fb30-443a-b579-95b19ed0934c', version='5.0-preview.1', route_values=route_values) def list_memberships(self, subject_descriptor, direction=None, depth=None): """ListMemberships. [Preview API] Get all the memberships where this descriptor is a member in the relationship. :param str subject_descriptor: Fetch all direct memberships of this descriptor. :param str direction: Defaults to Up. :param int depth: The maximum number of edges to traverse up or down the membership tree. Currently the only supported value is '1'. :rtype: [GraphMembership] """ route_values = {} if subject_descriptor is not None: route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') query_parameters = {} if direction is not None: query_parameters['direction'] = self._serialize.query('direction', direction, 'str') if depth is not None: query_parameters['depth'] = self._serialize.query('depth', depth, 'int') response = self._send(http_method='GET', location_id='e34b6394-6b30-4435-94a9-409a5eef3e31', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[GraphMembership]', self._unwrap_collection(response)) def get_membership_state(self, subject_descriptor): """GetMembershipState. [Preview API] Check whether a subject is active or inactive. :param str subject_descriptor: Descriptor of the subject (user, group, scope, etc.) to check state of :rtype: :class:` ` """ route_values = {} if subject_descriptor is not None: route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') response = self._send(http_method='GET', location_id='1ffe5c94-1144-4191-907b-d0211cad36a8', version='5.0-preview.1', route_values=route_values) return self._deserialize('GraphMembershipState', response) def get_provider_info(self, user_descriptor): """GetProviderInfo. [Preview API] :param str user_descriptor: :rtype: :class:` ` """ route_values = {} if user_descriptor is not None: route_values['userDescriptor'] = self._serialize.url('user_descriptor', user_descriptor, 'str') response = self._send(http_method='GET', location_id='1e377995-6fa2-4588-bd64-930186abdcfa', version='5.0-preview.1', route_values=route_values) return self._deserialize('GraphProviderInfo', response) def get_storage_key(self, subject_descriptor): """GetStorageKey. [Preview API] Resolve a descriptor to a storage key. :param str subject_descriptor: :rtype: :class:` ` """ route_values = {} if subject_descriptor is not None: route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') response = self._send(http_method='GET', location_id='eb85f8cc-f0f6-4264-a5b1-ffe2e4d4801f', version='5.0-preview.1', route_values=route_values) return self._deserialize('GraphStorageKeyResult', response) def lookup_subjects(self, subject_lookup): """LookupSubjects. [Preview API] Resolve descriptors to users, groups or scopes (Subjects) in a batch. :param :class:` ` subject_lookup: A list of descriptors that specifies a subset of subjects to retrieve. Each descriptor uniquely identifies the subject across all instance scopes, but only at a single point in time. :rtype: {GraphSubject} """ content = self._serialize.body(subject_lookup, 'GraphSubjectLookup') response = self._send(http_method='POST', location_id='4dd4d168-11f2-48c4-83e8-756fa0de027c', version='5.0-preview.1', content=content) return self._deserialize('{GraphSubject}', self._unwrap_collection(response)) def create_user(self, creation_context, group_descriptors=None): """CreateUser. [Preview API] Materialize an existing AAD or MSA user into the VSTS account. :param :class:` ` creation_context: The subset of the full graph user used to uniquely find the graph subject in an external provider. :param [str] group_descriptors: A comma separated list of descriptors of groups you want the graph user to join :rtype: :class:` ` """ query_parameters = {} if group_descriptors is not None: group_descriptors = ",".join(group_descriptors) query_parameters['groupDescriptors'] = self._serialize.query('group_descriptors', group_descriptors, 'str') content = self._serialize.body(creation_context, 'GraphUserCreationContext') response = self._send(http_method='POST', location_id='005e26ec-6b77-4e4f-a986-b3827bf241f5', version='5.0-preview.1', query_parameters=query_parameters, content=content) return self._deserialize('GraphUser', response) def delete_user(self, user_descriptor): """DeleteUser. [Preview API] Disables a user. :param str user_descriptor: The descriptor of the user to delete. """ route_values = {} if user_descriptor is not None: route_values['userDescriptor'] = self._serialize.url('user_descriptor', user_descriptor, 'str') self._send(http_method='DELETE', location_id='005e26ec-6b77-4e4f-a986-b3827bf241f5', version='5.0-preview.1', route_values=route_values) def get_user(self, user_descriptor): """GetUser. [Preview API] Get a user by its descriptor. :param str user_descriptor: The descriptor of the desired user. :rtype: :class:` ` """ route_values = {} if user_descriptor is not None: route_values['userDescriptor'] = self._serialize.url('user_descriptor', user_descriptor, 'str') response = self._send(http_method='GET', location_id='005e26ec-6b77-4e4f-a986-b3827bf241f5', version='5.0-preview.1', route_values=route_values) return self._deserialize('GraphUser', response) def list_users(self, subject_types=None, continuation_token=None): """ListUsers. [Preview API] Get a list of all users in a given scope. :param [str] subject_types: A comma separated list of user subject subtypes to reduce the retrieved results, e.g. msa’, ‘aad’, ‘svc’ (service identity), ‘imp’ (imported identity), etc. :param str continuation_token: An opaque data blob that allows the next page of data to resume immediately after where the previous page ended. The only reliable way to know if there is more data left is the presence of a continuation token. :rtype: :class:` ` """ query_parameters = {} if subject_types is not None: subject_types = ",".join(subject_types) query_parameters['subjectTypes'] = self._serialize.query('subject_types', subject_types, 'str') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='005e26ec-6b77-4e4f-a986-b3827bf241f5', version='5.0-preview.1', query_parameters=query_parameters) response_object = models.PagedGraphUsers() response_object.graph_users = self._deserialize('[GraphUser]', self._unwrap_collection(response)) response_object.continuation_token = response.headers.get('X-MS-ContinuationToken') return response_object azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/graph/models.py000066400000000000000000001135761360605530400320300ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class GraphCachePolicies(Model): """GraphCachePolicies. :param cache_size: Size of the cache :type cache_size: int """ _attribute_map = { 'cache_size': {'key': 'cacheSize', 'type': 'int'} } def __init__(self, cache_size=None): super(GraphCachePolicies, self).__init__() self.cache_size = cache_size class GraphDescriptorResult(Model): """GraphDescriptorResult. :param _links: This field contains zero or more interesting links about the graph descriptor. These links may be invoked to obtain additional relationships or more detailed information about this graph descriptor. :type _links: :class:`ReferenceLinks ` :param value: :type value: :class:`str ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, _links=None, value=None): super(GraphDescriptorResult, self).__init__() self._links = _links self.value = value class GraphFederatedProviderData(Model): """GraphFederatedProviderData. :param access_token: The access token that can be used to communicated with the federated provider on behalf on the target identity, if we were able to successfully acquire one, otherwise null, if we were not. :type access_token: str :param can_query_access_token: Whether or not the immediate provider (i.e. AAD) has indicated that we can call them to attempt to get an access token to communicate with the federated provider on behalf of the target identity. :type can_query_access_token: bool :param provider_name: The name of the federated provider, e.g. "github.com". :type provider_name: str :param subject_descriptor: The descriptor of the graph subject to which this federated provider data corresponds. :type subject_descriptor: str :param version: The version number of this federated provider data, which corresponds to when it was last updated. Can be used to prevent returning stale provider data from the cache when the caller is aware of a newer version, such as to prevent local cache poisoning from a remote cache or store. This is the app layer equivalent of the data layer sequence ID. :type version: long """ _attribute_map = { 'access_token': {'key': 'accessToken', 'type': 'str'}, 'can_query_access_token': {'key': 'canQueryAccessToken', 'type': 'bool'}, 'provider_name': {'key': 'providerName', 'type': 'str'}, 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, 'version': {'key': 'version', 'type': 'long'} } def __init__(self, access_token=None, can_query_access_token=None, provider_name=None, subject_descriptor=None, version=None): super(GraphFederatedProviderData, self).__init__() self.access_token = access_token self.can_query_access_token = can_query_access_token self.provider_name = provider_name self.subject_descriptor = subject_descriptor self.version = version class GraphGlobalExtendedPropertyBatch(Model): """GraphGlobalExtendedPropertyBatch. :param property_name_filters: :type property_name_filters: list of str :param subject_descriptors: :type subject_descriptors: list of :class:`str ` """ _attribute_map = { 'property_name_filters': {'key': 'propertyNameFilters', 'type': '[str]'}, 'subject_descriptors': {'key': 'subjectDescriptors', 'type': '[str]'} } def __init__(self, property_name_filters=None, subject_descriptors=None): super(GraphGlobalExtendedPropertyBatch, self).__init__() self.property_name_filters = property_name_filters self.subject_descriptors = subject_descriptors class GraphGroupCreationContext(Model): """GraphGroupCreationContext. :param storage_key: Optional: If provided, we will use this identifier for the storage key of the created group :type storage_key: str """ _attribute_map = { 'storage_key': {'key': 'storageKey', 'type': 'str'} } def __init__(self, storage_key=None): super(GraphGroupCreationContext, self).__init__() self.storage_key = storage_key class GraphMembership(Model): """GraphMembership. :param _links: This field contains zero or more interesting links about the graph membership. These links may be invoked to obtain additional relationships or more detailed information about this graph membership. :type _links: :class:`ReferenceLinks ` :param container_descriptor: :type container_descriptor: str :param member_descriptor: :type member_descriptor: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'container_descriptor': {'key': 'containerDescriptor', 'type': 'str'}, 'member_descriptor': {'key': 'memberDescriptor', 'type': 'str'} } def __init__(self, _links=None, container_descriptor=None, member_descriptor=None): super(GraphMembership, self).__init__() self._links = _links self.container_descriptor = container_descriptor self.member_descriptor = member_descriptor class GraphMembershipState(Model): """GraphMembershipState. :param _links: This field contains zero or more interesting links about the graph membership state. These links may be invoked to obtain additional relationships or more detailed information about this graph membership state. :type _links: :class:`ReferenceLinks ` :param active: When true, the membership is active :type active: bool """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'active': {'key': 'active', 'type': 'bool'} } def __init__(self, _links=None, active=None): super(GraphMembershipState, self).__init__() self._links = _links self.active = active class GraphMembershipTraversal(Model): """GraphMembershipTraversal. :param incompleteness_reason: Reason why the subject could not be traversed completely :type incompleteness_reason: str :param is_complete: When true, the subject is traversed completely :type is_complete: bool :param subject_descriptor: The traversed subject descriptor :type subject_descriptor: :class:`str ` :param traversed_subject_ids: Subject descriptor ids of the traversed members :type traversed_subject_ids: list of str :param traversed_subjects: Subject descriptors of the traversed members :type traversed_subjects: list of :class:`str ` """ _attribute_map = { 'incompleteness_reason': {'key': 'incompletenessReason', 'type': 'str'}, 'is_complete': {'key': 'isComplete', 'type': 'bool'}, 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, 'traversed_subject_ids': {'key': 'traversedSubjectIds', 'type': '[str]'}, 'traversed_subjects': {'key': 'traversedSubjects', 'type': '[str]'} } def __init__(self, incompleteness_reason=None, is_complete=None, subject_descriptor=None, traversed_subject_ids=None, traversed_subjects=None): super(GraphMembershipTraversal, self).__init__() self.incompleteness_reason = incompleteness_reason self.is_complete = is_complete self.subject_descriptor = subject_descriptor self.traversed_subject_ids = traversed_subject_ids self.traversed_subjects = traversed_subjects class GraphProviderInfo(Model): """GraphProviderInfo. :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AAD the tenantID of the directory.) :type domain: str :param origin: The type of source provider for the origin identifier (ex: "aad", "msa") :type origin: str :param origin_id: The unique identifier from the system of origin. (For MSA this is the PUID in hex notation, for AAD this is the object id.) :type origin_id: str """ _attribute_map = { 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'} } def __init__(self, descriptor=None, domain=None, origin=None, origin_id=None): super(GraphProviderInfo, self).__init__() self.descriptor = descriptor self.domain = domain self.origin = origin self.origin_id = origin_id class GraphScopeCreationContext(Model): """GraphScopeCreationContext. :param admin_group_description: Set this field to override the default description of this scope's admin group. :type admin_group_description: str :param admin_group_name: All scopes have an Administrator Group that controls access to the contents of the scope. Set this field to use a non-default group name for that administrators group. :type admin_group_name: str :param creator_id: Set this optional field if this scope is created on behalf of a user other than the user making the request. This should be the Id of the user that is not the requester. :type creator_id: str :param name: The scope must be provided with a unique name within the parent scope. This means the created scope can have a parent or child with the same name, but no siblings with the same name. :type name: str :param scope_type: The type of scope being created. :type scope_type: object :param storage_key: An optional ID that uniquely represents the scope within it's parent scope. If this parameter is not provided, Vsts will generate on automatically. :type storage_key: str """ _attribute_map = { 'admin_group_description': {'key': 'adminGroupDescription', 'type': 'str'}, 'admin_group_name': {'key': 'adminGroupName', 'type': 'str'}, 'creator_id': {'key': 'creatorId', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'scope_type': {'key': 'scopeType', 'type': 'object'}, 'storage_key': {'key': 'storageKey', 'type': 'str'} } def __init__(self, admin_group_description=None, admin_group_name=None, creator_id=None, name=None, scope_type=None, storage_key=None): super(GraphScopeCreationContext, self).__init__() self.admin_group_description = admin_group_description self.admin_group_name = admin_group_name self.creator_id = creator_id self.name = name self.scope_type = scope_type self.storage_key = storage_key class GraphStorageKeyResult(Model): """GraphStorageKeyResult. :param _links: This field contains zero or more interesting links about the graph storage key. These links may be invoked to obtain additional relationships or more detailed information about this graph storage key. :type _links: :class:`ReferenceLinks ` :param value: :type value: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, _links=None, value=None): super(GraphStorageKeyResult, self).__init__() self._links = _links self.value = value class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class GraphSubjectLookup(Model): """GraphSubjectLookup. :param lookup_keys: :type lookup_keys: list of :class:`GraphSubjectLookupKey ` """ _attribute_map = { 'lookup_keys': {'key': 'lookupKeys', 'type': '[GraphSubjectLookupKey]'} } def __init__(self, lookup_keys=None): super(GraphSubjectLookup, self).__init__() self.lookup_keys = lookup_keys class GraphSubjectLookupKey(Model): """GraphSubjectLookupKey. :param descriptor: :type descriptor: :class:`str ` """ _attribute_map = { 'descriptor': {'key': 'descriptor', 'type': 'str'} } def __init__(self, descriptor=None): super(GraphSubjectLookupKey, self).__init__() self.descriptor = descriptor class GraphUserCreationContext(Model): """GraphUserCreationContext. :param storage_key: Optional: If provided, we will use this identifier for the storage key of the created user :type storage_key: str """ _attribute_map = { 'storage_key': {'key': 'storageKey', 'type': 'str'} } def __init__(self, storage_key=None): super(GraphUserCreationContext, self).__init__() self.storage_key = storage_key class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class PagedGraphGroups(Model): """PagedGraphGroups. :param continuation_token: This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request. :type continuation_token: list of str :param graph_groups: The enumerable list of groups found within a page. :type graph_groups: list of :class:`GraphGroup ` """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': '[str]'}, 'graph_groups': {'key': 'graphGroups', 'type': '[GraphGroup]'} } def __init__(self, continuation_token=None, graph_groups=None): super(PagedGraphGroups, self).__init__() self.continuation_token = continuation_token self.graph_groups = graph_groups class PagedGraphUsers(Model): """PagedGraphUsers. :param continuation_token: This will be non-null if there is another page of data. There will never be more than one continuation token returned by a request. :type continuation_token: list of str :param graph_users: The enumerable set of users found within a page. :type graph_users: list of :class:`GraphUser ` """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': '[str]'}, 'graph_users': {'key': 'graphUsers', 'type': '[GraphUser]'} } def __init__(self, continuation_token=None, graph_users=None): super(PagedGraphUsers, self).__init__() self.continuation_token = continuation_token self.graph_users = graph_users class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class GraphSubject(GraphSubjectBase): """GraphSubject. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. :type legacy_descriptor: str :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) :type origin: str :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. :type origin_id: str :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). :type subject_kind: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'subject_kind': {'key': 'subjectKind', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None): super(GraphSubject, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.legacy_descriptor = legacy_descriptor self.origin = origin self.origin_id = origin_id self.subject_kind = subject_kind class GraphMember(GraphSubject): """GraphMember. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. :type legacy_descriptor: str :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) :type origin: str :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. :type origin_id: str :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). :type subject_kind: str :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc) :type domain: str :param mail_address: The email address of record for a given graph member. This may be different than the principal name. :type mail_address: str :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS. :type principal_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, 'mail_address': {'key': 'mailAddress', 'type': 'str'}, 'principal_name': {'key': 'principalName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, domain=None, mail_address=None, principal_name=None): super(GraphMember, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind) self.domain = domain self.mail_address = mail_address self.principal_name = principal_name class GraphScope(GraphSubject): """GraphScope. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. :type legacy_descriptor: str :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) :type origin: str :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. :type origin_id: str :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). :type subject_kind: str :param administrator_descriptor: The subject descriptor that references the administrators group for this scope. Only members of this group can change the contents of this scope or assign other users permissions to access this scope. :type administrator_descriptor: str :param is_global: When true, this scope is also a securing host for one or more scopes. :type is_global: bool :param parent_descriptor: The subject descriptor for the closest account or organization in the ancestor tree of this scope. :type parent_descriptor: str :param scope_type: The type of this scope. Typically ServiceHost or TeamProject. :type scope_type: object :param securing_host_descriptor: The subject descriptor for the containing organization in the ancestor tree of this scope. :type securing_host_descriptor: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, 'administrator_descriptor': {'key': 'administratorDescriptor', 'type': 'str'}, 'is_global': {'key': 'isGlobal', 'type': 'bool'}, 'parent_descriptor': {'key': 'parentDescriptor', 'type': 'str'}, 'scope_type': {'key': 'scopeType', 'type': 'object'}, 'securing_host_descriptor': {'key': 'securingHostDescriptor', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, administrator_descriptor=None, is_global=None, parent_descriptor=None, scope_type=None, securing_host_descriptor=None): super(GraphScope, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind) self.administrator_descriptor = administrator_descriptor self.is_global = is_global self.parent_descriptor = parent_descriptor self.scope_type = scope_type self.securing_host_descriptor = securing_host_descriptor class GraphUser(GraphMember): """GraphUser. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. :type legacy_descriptor: str :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) :type origin: str :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. :type origin_id: str :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). :type subject_kind: str :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc) :type domain: str :param mail_address: The email address of record for a given graph member. This may be different than the principal name. :type mail_address: str :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS. :type principal_name: str :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param metadata_update_date: :type metadata_update_date: datetime :param meta_type: The meta type of the user in the origin, such as "member", "guest", etc. See UserMetaType for the set of possible values. :type meta_type: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, 'mail_address': {'key': 'mailAddress', 'type': 'str'}, 'principal_name': {'key': 'principalName', 'type': 'str'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'metadata_update_date': {'key': 'metadataUpdateDate', 'type': 'iso-8601'}, 'meta_type': {'key': 'metaType', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, domain=None, mail_address=None, principal_name=None, is_deleted_in_origin=None, metadata_update_date=None, meta_type=None): super(GraphUser, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind, domain=domain, mail_address=mail_address, principal_name=principal_name) self.is_deleted_in_origin = is_deleted_in_origin self.metadata_update_date = metadata_update_date self.meta_type = meta_type class GraphGroup(GraphMember): """GraphGroup. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. :type legacy_descriptor: str :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) :type origin: str :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. :type origin_id: str :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). :type subject_kind: str :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc) :type domain: str :param mail_address: The email address of record for a given graph member. This may be different than the principal name. :type mail_address: str :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS. :type principal_name: str :param description: A short phrase to help human readers disambiguate groups with similar names :type description: str :param is_cross_project: :type is_cross_project: bool :param is_deleted: :type is_deleted: bool :param is_global_scope: :type is_global_scope: bool :param is_restricted_visible: :type is_restricted_visible: bool :param local_scope_id: :type local_scope_id: str :param scope_id: :type scope_id: str :param scope_name: :type scope_name: str :param scope_type: :type scope_type: str :param securing_host_id: :type securing_host_id: str :param special_type: :type special_type: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, 'mail_address': {'key': 'mailAddress', 'type': 'str'}, 'principal_name': {'key': 'principalName', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'is_cross_project': {'key': 'isCrossProject', 'type': 'bool'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'is_global_scope': {'key': 'isGlobalScope', 'type': 'bool'}, 'is_restricted_visible': {'key': 'isRestrictedVisible', 'type': 'bool'}, 'local_scope_id': {'key': 'localScopeId', 'type': 'str'}, 'scope_id': {'key': 'scopeId', 'type': 'str'}, 'scope_name': {'key': 'scopeName', 'type': 'str'}, 'scope_type': {'key': 'scopeType', 'type': 'str'}, 'securing_host_id': {'key': 'securingHostId', 'type': 'str'}, 'special_type': {'key': 'specialType', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, domain=None, mail_address=None, principal_name=None, description=None, is_cross_project=None, is_deleted=None, is_global_scope=None, is_restricted_visible=None, local_scope_id=None, scope_id=None, scope_name=None, scope_type=None, securing_host_id=None, special_type=None): super(GraphGroup, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind, domain=domain, mail_address=mail_address, principal_name=principal_name) self.description = description self.is_cross_project = is_cross_project self.is_deleted = is_deleted self.is_global_scope = is_global_scope self.is_restricted_visible = is_restricted_visible self.local_scope_id = local_scope_id self.scope_id = scope_id self.scope_name = scope_name self.scope_type = scope_type self.securing_host_id = securing_host_id self.special_type = special_type __all__ = [ 'GraphCachePolicies', 'GraphDescriptorResult', 'GraphFederatedProviderData', 'GraphGlobalExtendedPropertyBatch', 'GraphGroupCreationContext', 'GraphMembership', 'GraphMembershipState', 'GraphMembershipTraversal', 'GraphProviderInfo', 'GraphScopeCreationContext', 'GraphStorageKeyResult', 'GraphSubjectBase', 'GraphSubjectLookup', 'GraphSubjectLookupKey', 'GraphUserCreationContext', 'JsonPatchOperation', 'PagedGraphGroups', 'PagedGraphUsers', 'ReferenceLinks', 'GraphSubject', 'GraphMember', 'GraphScope', 'GraphUser', 'GraphGroup', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/identity/000077500000000000000000000000001360605530400307065ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/identity/__init__.py000066400000000000000000000021241360605530400330160ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .identity_client import IdentityClient __all__ = [ 'AccessTokenResult', 'AuthorizationGrant', 'ChangedIdentities', 'ChangedIdentitiesContext', 'CreateScopeInfo', 'FrameworkIdentityInfo', 'GroupMembership', 'Identity', 'IdentityBase', 'IdentityBatchInfo', 'IdentityScope', 'IdentitySelf', 'IdentitySnapshot', 'IdentityUpdateData', 'JsonPatchOperation', 'JsonWebToken', 'RefreshTokenGrant', 'SwapIdentityInfo', 'TenantInfo', 'IdentityClient' ] identity_client.py000066400000000000000000000637171360605530400344060ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/identity# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class IdentityClient(Client): """Identity :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(IdentityClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '8a3d49b8-91f0-46ef-b33d-dda338c25db3' def create_or_bind_with_claims(self, source_identity): """CreateOrBindWithClaims. [Preview API] :param :class:` ` source_identity: :rtype: :class:` ` """ content = self._serialize.body(source_identity, 'Identity') response = self._send(http_method='PUT', location_id='90ddfe71-171c-446c-bf3b-b597cd562afd', version='5.0-preview.1', content=content) return self._deserialize('Identity', response) def get_descriptor_by_id(self, id, is_master_id=None): """GetDescriptorById. [Preview API] :param str id: :param bool is_master_id: :rtype: :class:` ` """ route_values = {} if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if is_master_id is not None: query_parameters['isMasterId'] = self._serialize.query('is_master_id', is_master_id, 'bool') response = self._send(http_method='GET', location_id='a230389a-94f2-496c-839f-c929787496dd', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def create_groups(self, container): """CreateGroups. :param :class:` ` container: :rtype: [Identity] """ content = self._serialize.body(container, 'object') response = self._send(http_method='POST', location_id='5966283b-4196-4d57-9211-1b68f41ec1c2', version='5.0', content=content) return self._deserialize('[Identity]', self._unwrap_collection(response)) def delete_group(self, group_id): """DeleteGroup. :param str group_id: """ route_values = {} if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') self._send(http_method='DELETE', location_id='5966283b-4196-4d57-9211-1b68f41ec1c2', version='5.0', route_values=route_values) def list_groups(self, scope_ids=None, recurse=None, deleted=None, properties=None): """ListGroups. :param str scope_ids: :param bool recurse: :param bool deleted: :param str properties: :rtype: [Identity] """ query_parameters = {} if scope_ids is not None: query_parameters['scopeIds'] = self._serialize.query('scope_ids', scope_ids, 'str') if recurse is not None: query_parameters['recurse'] = self._serialize.query('recurse', recurse, 'bool') if deleted is not None: query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='5966283b-4196-4d57-9211-1b68f41ec1c2', version='5.0', query_parameters=query_parameters) return self._deserialize('[Identity]', self._unwrap_collection(response)) def get_identity_changes(self, identity_sequence_id, group_sequence_id, organization_identity_sequence_id=None, page_size=None, scope_id=None): """GetIdentityChanges. :param int identity_sequence_id: :param int group_sequence_id: :param int organization_identity_sequence_id: :param int page_size: :param str scope_id: :rtype: :class:` ` """ query_parameters = {} if identity_sequence_id is not None: query_parameters['identitySequenceId'] = self._serialize.query('identity_sequence_id', identity_sequence_id, 'int') if group_sequence_id is not None: query_parameters['groupSequenceId'] = self._serialize.query('group_sequence_id', group_sequence_id, 'int') if organization_identity_sequence_id is not None: query_parameters['organizationIdentitySequenceId'] = self._serialize.query('organization_identity_sequence_id', organization_identity_sequence_id, 'int') if page_size is not None: query_parameters['pageSize'] = self._serialize.query('page_size', page_size, 'int') if scope_id is not None: query_parameters['scopeId'] = self._serialize.query('scope_id', scope_id, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.0', query_parameters=query_parameters) return self._deserialize('ChangedIdentities', response) def get_user_identity_ids_by_domain_id(self, domain_id): """GetUserIdentityIdsByDomainId. :param str domain_id: :rtype: [str] """ query_parameters = {} if domain_id is not None: query_parameters['domainId'] = self._serialize.query('domain_id', domain_id, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.0', query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def read_identities(self, descriptors=None, identity_ids=None, subject_descriptors=None, search_filter=None, filter_value=None, query_membership=None, properties=None, include_restricted_visibility=None, options=None): """ReadIdentities. :param str descriptors: :param str identity_ids: :param str subject_descriptors: :param str search_filter: :param str filter_value: :param str query_membership: :param str properties: :param bool include_restricted_visibility: :param str options: :rtype: [Identity] """ query_parameters = {} if descriptors is not None: query_parameters['descriptors'] = self._serialize.query('descriptors', descriptors, 'str') if identity_ids is not None: query_parameters['identityIds'] = self._serialize.query('identity_ids', identity_ids, 'str') if subject_descriptors is not None: query_parameters['subjectDescriptors'] = self._serialize.query('subject_descriptors', subject_descriptors, 'str') if search_filter is not None: query_parameters['searchFilter'] = self._serialize.query('search_filter', search_filter, 'str') if filter_value is not None: query_parameters['filterValue'] = self._serialize.query('filter_value', filter_value, 'str') if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') if include_restricted_visibility is not None: query_parameters['includeRestrictedVisibility'] = self._serialize.query('include_restricted_visibility', include_restricted_visibility, 'bool') if options is not None: query_parameters['options'] = self._serialize.query('options', options, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.0', query_parameters=query_parameters) return self._deserialize('[Identity]', self._unwrap_collection(response)) def read_identities_by_scope(self, scope_id, query_membership=None, properties=None): """ReadIdentitiesByScope. :param str scope_id: :param str query_membership: :param str properties: :rtype: [Identity] """ query_parameters = {} if scope_id is not None: query_parameters['scopeId'] = self._serialize.query('scope_id', scope_id, 'str') if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.0', query_parameters=query_parameters) return self._deserialize('[Identity]', self._unwrap_collection(response)) def read_identity(self, identity_id, query_membership=None, properties=None): """ReadIdentity. :param str identity_id: :param str query_membership: :param str properties: :rtype: :class:` ` """ route_values = {} if identity_id is not None: route_values['identityId'] = self._serialize.url('identity_id', identity_id, 'str') query_parameters = {} if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Identity', response) def update_identities(self, identities): """UpdateIdentities. :param :class:` ` identities: :rtype: [IdentityUpdateData] """ content = self._serialize.body(identities, 'VssJsonCollectionWrapper') response = self._send(http_method='PUT', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.0', content=content) return self._deserialize('[IdentityUpdateData]', self._unwrap_collection(response)) def update_identity(self, identity, identity_id): """UpdateIdentity. :param :class:` ` identity: :param str identity_id: """ route_values = {} if identity_id is not None: route_values['identityId'] = self._serialize.url('identity_id', identity_id, 'str') content = self._serialize.body(identity, 'Identity') self._send(http_method='PUT', location_id='28010c54-d0c0-4c89-a5b0-1c9e188b9fb7', version='5.0', route_values=route_values, content=content) def create_identity(self, framework_identity_info): """CreateIdentity. :param :class:` ` framework_identity_info: :rtype: :class:` ` """ content = self._serialize.body(framework_identity_info, 'FrameworkIdentityInfo') response = self._send(http_method='PUT', location_id='dd55f0eb-6ea2-4fe4-9ebe-919e7dd1dfb4', version='5.0', content=content) return self._deserialize('Identity', response) def read_identity_batch(self, batch_info): """ReadIdentityBatch. [Preview API] :param :class:` ` batch_info: :rtype: [Identity] """ content = self._serialize.body(batch_info, 'IdentityBatchInfo') response = self._send(http_method='POST', location_id='299e50df-fe45-4d3a-8b5b-a5836fac74dc', version='5.0-preview.1', content=content) return self._deserialize('[Identity]', self._unwrap_collection(response)) def get_identity_snapshot(self, scope_id): """GetIdentitySnapshot. [Preview API] :param str scope_id: :rtype: :class:` ` """ route_values = {} if scope_id is not None: route_values['scopeId'] = self._serialize.url('scope_id', scope_id, 'str') response = self._send(http_method='GET', location_id='d56223df-8ccd-45c9-89b4-eddf692400d7', version='5.0-preview.1', route_values=route_values) return self._deserialize('IdentitySnapshot', response) def get_max_sequence_id(self): """GetMaxSequenceId. Read the max sequence id of all the identities. :rtype: long """ response = self._send(http_method='GET', location_id='e4a70778-cb2c-4e85-b7cc-3f3c7ae2d408', version='5.0') return self._deserialize('long', response) def get_self(self): """GetSelf. Read identity of the home tenant request user. :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='4bb02b5b-c120-4be2-b68e-21f7c50a4b82', version='5.0') return self._deserialize('IdentitySelf', response) def add_member(self, container_id, member_id): """AddMember. [Preview API] :param str container_id: :param str member_id: :rtype: bool """ route_values = {} if container_id is not None: route_values['containerId'] = self._serialize.url('container_id', container_id, 'str') if member_id is not None: route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') response = self._send(http_method='PUT', location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', version='5.0-preview.1', route_values=route_values) return self._deserialize('bool', response) def read_member(self, container_id, member_id, query_membership=None): """ReadMember. [Preview API] :param str container_id: :param str member_id: :param str query_membership: :rtype: :class:` ` """ route_values = {} if container_id is not None: route_values['containerId'] = self._serialize.url('container_id', container_id, 'str') if member_id is not None: route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') query_parameters = {} if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') response = self._send(http_method='GET', location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def read_members(self, container_id, query_membership=None): """ReadMembers. [Preview API] :param str container_id: :param str query_membership: :rtype: [str] """ route_values = {} if container_id is not None: route_values['containerId'] = self._serialize.url('container_id', container_id, 'str') query_parameters = {} if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') response = self._send(http_method='GET', location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def remove_member(self, container_id, member_id): """RemoveMember. [Preview API] :param str container_id: :param str member_id: :rtype: bool """ route_values = {} if container_id is not None: route_values['containerId'] = self._serialize.url('container_id', container_id, 'str') if member_id is not None: route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') response = self._send(http_method='DELETE', location_id='8ba35978-138e-41f8-8963-7b1ea2c5f775', version='5.0-preview.1', route_values=route_values) return self._deserialize('bool', response) def read_member_of(self, member_id, container_id, query_membership=None): """ReadMemberOf. [Preview API] :param str member_id: :param str container_id: :param str query_membership: :rtype: :class:` ` """ route_values = {} if member_id is not None: route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') if container_id is not None: route_values['containerId'] = self._serialize.url('container_id', container_id, 'str') query_parameters = {} if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') response = self._send(http_method='GET', location_id='22865b02-9e4a-479e-9e18-e35b8803b8a0', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def read_members_of(self, member_id, query_membership=None): """ReadMembersOf. [Preview API] :param str member_id: :param str query_membership: :rtype: [str] """ route_values = {} if member_id is not None: route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') query_parameters = {} if query_membership is not None: query_parameters['queryMembership'] = self._serialize.query('query_membership', query_membership, 'str') response = self._send(http_method='GET', location_id='22865b02-9e4a-479e-9e18-e35b8803b8a0', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def create_scope(self, info, scope_id): """CreateScope. [Preview API] :param :class:` ` info: :param str scope_id: :rtype: :class:` ` """ route_values = {} if scope_id is not None: route_values['scopeId'] = self._serialize.url('scope_id', scope_id, 'str') content = self._serialize.body(info, 'CreateScopeInfo') response = self._send(http_method='PUT', location_id='4e11e2bf-1e79-4eb5-8f34-a6337bd0de38', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('IdentityScope', response) def delete_scope(self, scope_id): """DeleteScope. [Preview API] :param str scope_id: """ route_values = {} if scope_id is not None: route_values['scopeId'] = self._serialize.url('scope_id', scope_id, 'str') self._send(http_method='DELETE', location_id='4e11e2bf-1e79-4eb5-8f34-a6337bd0de38', version='5.0-preview.2', route_values=route_values) def get_scope_by_id(self, scope_id): """GetScopeById. [Preview API] :param str scope_id: :rtype: :class:` ` """ route_values = {} if scope_id is not None: route_values['scopeId'] = self._serialize.url('scope_id', scope_id, 'str') response = self._send(http_method='GET', location_id='4e11e2bf-1e79-4eb5-8f34-a6337bd0de38', version='5.0-preview.2', route_values=route_values) return self._deserialize('IdentityScope', response) def get_scope_by_name(self, scope_name): """GetScopeByName. [Preview API] :param str scope_name: :rtype: :class:` ` """ query_parameters = {} if scope_name is not None: query_parameters['scopeName'] = self._serialize.query('scope_name', scope_name, 'str') response = self._send(http_method='GET', location_id='4e11e2bf-1e79-4eb5-8f34-a6337bd0de38', version='5.0-preview.2', query_parameters=query_parameters) return self._deserialize('IdentityScope', response) def update_scope(self, patch_document, scope_id): """UpdateScope. [Preview API] :param :class:`<[JsonPatchOperation]> ` patch_document: :param str scope_id: """ route_values = {} if scope_id is not None: route_values['scopeId'] = self._serialize.url('scope_id', scope_id, 'str') content = self._serialize.body(patch_document, '[JsonPatchOperation]') self._send(http_method='PATCH', location_id='4e11e2bf-1e79-4eb5-8f34-a6337bd0de38', version='5.0-preview.2', route_values=route_values, content=content, media_type='application/json-patch+json') def get_signed_in_token(self): """GetSignedInToken. [Preview API] :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='6074ff18-aaad-4abb-a41e-5c75f6178057', version='5.0-preview.1') return self._deserialize('AccessTokenResult', response) def get_signout_token(self): """GetSignoutToken. [Preview API] :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='be39e83c-7529-45e9-9c67-0410885880da', version='5.0-preview.1') return self._deserialize('AccessTokenResult', response) def get_tenant(self, tenant_id): """GetTenant. [Preview API] :param str tenant_id: :rtype: :class:` ` """ route_values = {} if tenant_id is not None: route_values['tenantId'] = self._serialize.url('tenant_id', tenant_id, 'str') response = self._send(http_method='GET', location_id='5f0a1723-2e2c-4c31-8cae-002d01bdd592', version='5.0-preview.1', route_values=route_values) return self._deserialize('TenantInfo', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/identity/models.py000066400000000000000000000614331360605530400325520ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AccessTokenResult(Model): """AccessTokenResult. :param access_token: :type access_token: :class:`JsonWebToken ` :param access_token_error: :type access_token_error: object :param authorization_id: :type authorization_id: str :param error_description: :type error_description: str :param has_error: :type has_error: bool :param refresh_token: :type refresh_token: :class:`RefreshTokenGrant ` :param token_type: :type token_type: str :param valid_to: :type valid_to: datetime """ _attribute_map = { 'access_token': {'key': 'accessToken', 'type': 'JsonWebToken'}, 'access_token_error': {'key': 'accessTokenError', 'type': 'object'}, 'authorization_id': {'key': 'authorizationId', 'type': 'str'}, 'error_description': {'key': 'errorDescription', 'type': 'str'}, 'has_error': {'key': 'hasError', 'type': 'bool'}, 'refresh_token': {'key': 'refreshToken', 'type': 'RefreshTokenGrant'}, 'token_type': {'key': 'tokenType', 'type': 'str'}, 'valid_to': {'key': 'validTo', 'type': 'iso-8601'} } def __init__(self, access_token=None, access_token_error=None, authorization_id=None, error_description=None, has_error=None, refresh_token=None, token_type=None, valid_to=None): super(AccessTokenResult, self).__init__() self.access_token = access_token self.access_token_error = access_token_error self.authorization_id = authorization_id self.error_description = error_description self.has_error = has_error self.refresh_token = refresh_token self.token_type = token_type self.valid_to = valid_to class AuthorizationGrant(Model): """AuthorizationGrant. :param grant_type: :type grant_type: object """ _attribute_map = { 'grant_type': {'key': 'grantType', 'type': 'object'} } def __init__(self, grant_type=None): super(AuthorizationGrant, self).__init__() self.grant_type = grant_type class ChangedIdentities(Model): """ChangedIdentities. :param identities: Changed Identities :type identities: list of :class:`Identity ` :param more_data: More data available, set to true if pagesize is specified. :type more_data: bool :param sequence_context: Last Identity SequenceId :type sequence_context: :class:`ChangedIdentitiesContext ` """ _attribute_map = { 'identities': {'key': 'identities', 'type': '[Identity]'}, 'more_data': {'key': 'moreData', 'type': 'bool'}, 'sequence_context': {'key': 'sequenceContext', 'type': 'ChangedIdentitiesContext'} } def __init__(self, identities=None, more_data=None, sequence_context=None): super(ChangedIdentities, self).__init__() self.identities = identities self.more_data = more_data self.sequence_context = sequence_context class ChangedIdentitiesContext(Model): """ChangedIdentitiesContext. :param group_sequence_id: Last Group SequenceId :type group_sequence_id: int :param identity_sequence_id: Last Identity SequenceId :type identity_sequence_id: int :param organization_identity_sequence_id: Last Group OrganizationIdentitySequenceId :type organization_identity_sequence_id: int :param page_size: Page size :type page_size: int """ _attribute_map = { 'group_sequence_id': {'key': 'groupSequenceId', 'type': 'int'}, 'identity_sequence_id': {'key': 'identitySequenceId', 'type': 'int'}, 'organization_identity_sequence_id': {'key': 'organizationIdentitySequenceId', 'type': 'int'}, 'page_size': {'key': 'pageSize', 'type': 'int'} } def __init__(self, group_sequence_id=None, identity_sequence_id=None, organization_identity_sequence_id=None, page_size=None): super(ChangedIdentitiesContext, self).__init__() self.group_sequence_id = group_sequence_id self.identity_sequence_id = identity_sequence_id self.organization_identity_sequence_id = organization_identity_sequence_id self.page_size = page_size class CreateScopeInfo(Model): """CreateScopeInfo. :param admin_group_description: :type admin_group_description: str :param admin_group_name: :type admin_group_name: str :param creator_id: :type creator_id: str :param parent_scope_id: :type parent_scope_id: str :param scope_name: :type scope_name: str :param scope_type: :type scope_type: object """ _attribute_map = { 'admin_group_description': {'key': 'adminGroupDescription', 'type': 'str'}, 'admin_group_name': {'key': 'adminGroupName', 'type': 'str'}, 'creator_id': {'key': 'creatorId', 'type': 'str'}, 'parent_scope_id': {'key': 'parentScopeId', 'type': 'str'}, 'scope_name': {'key': 'scopeName', 'type': 'str'}, 'scope_type': {'key': 'scopeType', 'type': 'object'} } def __init__(self, admin_group_description=None, admin_group_name=None, creator_id=None, parent_scope_id=None, scope_name=None, scope_type=None): super(CreateScopeInfo, self).__init__() self.admin_group_description = admin_group_description self.admin_group_name = admin_group_name self.creator_id = creator_id self.parent_scope_id = parent_scope_id self.scope_name = scope_name self.scope_type = scope_type class FrameworkIdentityInfo(Model): """FrameworkIdentityInfo. :param display_name: :type display_name: str :param identifier: :type identifier: str :param identity_type: :type identity_type: object :param role: :type role: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'identifier': {'key': 'identifier', 'type': 'str'}, 'identity_type': {'key': 'identityType', 'type': 'object'}, 'role': {'key': 'role', 'type': 'str'} } def __init__(self, display_name=None, identifier=None, identity_type=None, role=None): super(FrameworkIdentityInfo, self).__init__() self.display_name = display_name self.identifier = identifier self.identity_type = identity_type self.role = role class GroupMembership(Model): """GroupMembership. :param active: :type active: bool :param descriptor: :type descriptor: :class:`str ` :param id: :type id: str :param queried_id: :type queried_id: str """ _attribute_map = { 'active': {'key': 'active', 'type': 'bool'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'queried_id': {'key': 'queriedId', 'type': 'str'} } def __init__(self, active=None, descriptor=None, id=None, queried_id=None): super(GroupMembership, self).__init__() self.active = active self.descriptor = descriptor self.id = id self.queried_id = queried_id class IdentityBase(Model): """IdentityBase. :param custom_display_name: The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database) :type custom_display_name: str :param descriptor: :type descriptor: :class:`str ` :param id: :type id: str :param is_active: :type is_active: bool :param is_container: :type is_container: bool :param master_id: :type master_id: str :param member_ids: :type member_ids: list of str :param member_of: :type member_of: list of :class:`str ` :param members: :type members: list of :class:`str ` :param meta_type_id: :type meta_type_id: int :param properties: :type properties: :class:`object ` :param provider_display_name: The display name for the identity as specified by the source identity provider. :type provider_display_name: str :param resource_version: :type resource_version: int :param subject_descriptor: :type subject_descriptor: :class:`str ` :param unique_user_id: :type unique_user_id: int """ _attribute_map = { 'custom_display_name': {'key': 'customDisplayName', 'type': 'str'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_active': {'key': 'isActive', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'master_id': {'key': 'masterId', 'type': 'str'}, 'member_ids': {'key': 'memberIds', 'type': '[str]'}, 'member_of': {'key': 'memberOf', 'type': '[str]'}, 'members': {'key': 'members', 'type': '[str]'}, 'meta_type_id': {'key': 'metaTypeId', 'type': 'int'}, 'properties': {'key': 'properties', 'type': 'object'}, 'provider_display_name': {'key': 'providerDisplayName', 'type': 'str'}, 'resource_version': {'key': 'resourceVersion', 'type': 'int'}, 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, 'unique_user_id': {'key': 'uniqueUserId', 'type': 'int'} } def __init__(self, custom_display_name=None, descriptor=None, id=None, is_active=None, is_container=None, master_id=None, member_ids=None, member_of=None, members=None, meta_type_id=None, properties=None, provider_display_name=None, resource_version=None, subject_descriptor=None, unique_user_id=None): super(IdentityBase, self).__init__() self.custom_display_name = custom_display_name self.descriptor = descriptor self.id = id self.is_active = is_active self.is_container = is_container self.master_id = master_id self.member_ids = member_ids self.member_of = member_of self.members = members self.meta_type_id = meta_type_id self.properties = properties self.provider_display_name = provider_display_name self.resource_version = resource_version self.subject_descriptor = subject_descriptor self.unique_user_id = unique_user_id class IdentityBatchInfo(Model): """IdentityBatchInfo. :param descriptors: :type descriptors: list of :class:`str ` :param identity_ids: :type identity_ids: list of str :param include_restricted_visibility: :type include_restricted_visibility: bool :param property_names: :type property_names: list of str :param query_membership: :type query_membership: object :param subject_descriptors: :type subject_descriptors: list of :class:`str ` """ _attribute_map = { 'descriptors': {'key': 'descriptors', 'type': '[str]'}, 'identity_ids': {'key': 'identityIds', 'type': '[str]'}, 'include_restricted_visibility': {'key': 'includeRestrictedVisibility', 'type': 'bool'}, 'property_names': {'key': 'propertyNames', 'type': '[str]'}, 'query_membership': {'key': 'queryMembership', 'type': 'object'}, 'subject_descriptors': {'key': 'subjectDescriptors', 'type': '[str]'} } def __init__(self, descriptors=None, identity_ids=None, include_restricted_visibility=None, property_names=None, query_membership=None, subject_descriptors=None): super(IdentityBatchInfo, self).__init__() self.descriptors = descriptors self.identity_ids = identity_ids self.include_restricted_visibility = include_restricted_visibility self.property_names = property_names self.query_membership = query_membership self.subject_descriptors = subject_descriptors class IdentityScope(Model): """IdentityScope. :param administrators: :type administrators: :class:`str ` :param id: :type id: str :param is_active: :type is_active: bool :param is_global: :type is_global: bool :param local_scope_id: :type local_scope_id: str :param name: :type name: str :param parent_id: :type parent_id: str :param scope_type: :type scope_type: object :param securing_host_id: :type securing_host_id: str :param subject_descriptor: :type subject_descriptor: :class:`str ` """ _attribute_map = { 'administrators': {'key': 'administrators', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_active': {'key': 'isActive', 'type': 'bool'}, 'is_global': {'key': 'isGlobal', 'type': 'bool'}, 'local_scope_id': {'key': 'localScopeId', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'parent_id': {'key': 'parentId', 'type': 'str'}, 'scope_type': {'key': 'scopeType', 'type': 'object'}, 'securing_host_id': {'key': 'securingHostId', 'type': 'str'}, 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'} } def __init__(self, administrators=None, id=None, is_active=None, is_global=None, local_scope_id=None, name=None, parent_id=None, scope_type=None, securing_host_id=None, subject_descriptor=None): super(IdentityScope, self).__init__() self.administrators = administrators self.id = id self.is_active = is_active self.is_global = is_global self.local_scope_id = local_scope_id self.name = name self.parent_id = parent_id self.scope_type = scope_type self.securing_host_id = securing_host_id self.subject_descriptor = subject_descriptor class IdentitySelf(Model): """IdentitySelf. :param account_name: The UserPrincipalName (UPN) of the account. This value comes from the source provider. :type account_name: str :param display_name: The display name. For AAD accounts with multiple tenants this is the display name of the profile in the home tenant. :type display_name: str :param domain: This represents the name of the container of origin. For AAD accounts this is the tenantID of the home tenant. For MSA accounts this is the string "Windows Live ID". :type domain: str :param id: This is the VSID of the home tenant profile. If the profile is signed into the home tenant or if the profile has no tenants then this Id is the same as the Id returned by the profile/profiles/me endpoint. Going forward it is recommended that you use the combined values of Origin, OriginId and Domain to uniquely identify a user rather than this Id. :type id: str :param origin: The type of source provider for the origin identifier. For MSA accounts this is "msa". For AAD accounts this is "aad". :type origin: str :param origin_id: The unique identifier from the system of origin. If there are multiple tenants this is the unique identifier of the account in the home tenant. (For MSA this is the PUID in hex notation, for AAD this is the object id.) :type origin_id: str :param tenants: For AAD accounts this is all of the tenants that this account is a member of. :type tenants: list of :class:`TenantInfo ` """ _attribute_map = { 'account_name': {'key': 'accountName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'tenants': {'key': 'tenants', 'type': '[TenantInfo]'} } def __init__(self, account_name=None, display_name=None, domain=None, id=None, origin=None, origin_id=None, tenants=None): super(IdentitySelf, self).__init__() self.account_name = account_name self.display_name = display_name self.domain = domain self.id = id self.origin = origin self.origin_id = origin_id self.tenants = tenants class IdentitySnapshot(Model): """IdentitySnapshot. :param groups: :type groups: list of :class:`Identity ` :param identity_ids: :type identity_ids: list of str :param memberships: :type memberships: list of :class:`GroupMembership ` :param scope_id: :type scope_id: str :param scopes: :type scopes: list of :class:`IdentityScope ` """ _attribute_map = { 'groups': {'key': 'groups', 'type': '[Identity]'}, 'identity_ids': {'key': 'identityIds', 'type': '[str]'}, 'memberships': {'key': 'memberships', 'type': '[GroupMembership]'}, 'scope_id': {'key': 'scopeId', 'type': 'str'}, 'scopes': {'key': 'scopes', 'type': '[IdentityScope]'} } def __init__(self, groups=None, identity_ids=None, memberships=None, scope_id=None, scopes=None): super(IdentitySnapshot, self).__init__() self.groups = groups self.identity_ids = identity_ids self.memberships = memberships self.scope_id = scope_id self.scopes = scopes class IdentityUpdateData(Model): """IdentityUpdateData. :param id: :type id: str :param index: :type index: int :param updated: :type updated: bool """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'index': {'key': 'index', 'type': 'int'}, 'updated': {'key': 'updated', 'type': 'bool'} } def __init__(self, id=None, index=None, updated=None): super(IdentityUpdateData, self).__init__() self.id = id self.index = index self.updated = updated class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class JsonWebToken(Model): """JsonWebToken. """ _attribute_map = { } def __init__(self): super(JsonWebToken, self).__init__() class RefreshTokenGrant(AuthorizationGrant): """RefreshTokenGrant. :param grant_type: :type grant_type: object :param jwt: :type jwt: :class:`JsonWebToken ` """ _attribute_map = { 'grant_type': {'key': 'grantType', 'type': 'object'}, 'jwt': {'key': 'jwt', 'type': 'JsonWebToken'} } def __init__(self, grant_type=None, jwt=None): super(RefreshTokenGrant, self).__init__(grant_type=grant_type) self.jwt = jwt class SwapIdentityInfo(Model): """SwapIdentityInfo. :param id1: :type id1: str :param id2: :type id2: str """ _attribute_map = { 'id1': {'key': 'id1', 'type': 'str'}, 'id2': {'key': 'id2', 'type': 'str'} } def __init__(self, id1=None, id2=None): super(SwapIdentityInfo, self).__init__() self.id1 = id1 self.id2 = id2 class TenantInfo(Model): """TenantInfo. :param home_tenant: :type home_tenant: bool :param tenant_id: :type tenant_id: str :param tenant_name: :type tenant_name: str """ _attribute_map = { 'home_tenant': {'key': 'homeTenant', 'type': 'bool'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'tenant_name': {'key': 'tenantName', 'type': 'str'} } def __init__(self, home_tenant=None, tenant_id=None, tenant_name=None): super(TenantInfo, self).__init__() self.home_tenant = home_tenant self.tenant_id = tenant_id self.tenant_name = tenant_name class Identity(IdentityBase): """Identity. :param custom_display_name: The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database) :type custom_display_name: str :param descriptor: :type descriptor: :class:`str ` :param id: :type id: str :param is_active: :type is_active: bool :param is_container: :type is_container: bool :param master_id: :type master_id: str :param member_ids: :type member_ids: list of str :param member_of: :type member_of: list of :class:`str ` :param members: :type members: list of :class:`str ` :param meta_type_id: :type meta_type_id: int :param properties: :type properties: :class:`object ` :param provider_display_name: The display name for the identity as specified by the source identity provider. :type provider_display_name: str :param resource_version: :type resource_version: int :param subject_descriptor: :type subject_descriptor: :class:`str ` :param unique_user_id: :type unique_user_id: int """ _attribute_map = { 'custom_display_name': {'key': 'customDisplayName', 'type': 'str'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_active': {'key': 'isActive', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'master_id': {'key': 'masterId', 'type': 'str'}, 'member_ids': {'key': 'memberIds', 'type': '[str]'}, 'member_of': {'key': 'memberOf', 'type': '[str]'}, 'members': {'key': 'members', 'type': '[str]'}, 'meta_type_id': {'key': 'metaTypeId', 'type': 'int'}, 'properties': {'key': 'properties', 'type': 'object'}, 'provider_display_name': {'key': 'providerDisplayName', 'type': 'str'}, 'resource_version': {'key': 'resourceVersion', 'type': 'int'}, 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, 'unique_user_id': {'key': 'uniqueUserId', 'type': 'int'}, } def __init__(self, custom_display_name=None, descriptor=None, id=None, is_active=None, is_container=None, master_id=None, member_ids=None, member_of=None, members=None, meta_type_id=None, properties=None, provider_display_name=None, resource_version=None, subject_descriptor=None, unique_user_id=None): super(Identity, self).__init__(custom_display_name=custom_display_name, descriptor=descriptor, id=id, is_active=is_active, is_container=is_container, master_id=master_id, member_ids=member_ids, member_of=member_of, members=members, meta_type_id=meta_type_id, properties=properties, provider_display_name=provider_display_name, resource_version=resource_version, subject_descriptor=subject_descriptor, unique_user_id=unique_user_id) __all__ = [ 'AccessTokenResult', 'AuthorizationGrant', 'ChangedIdentities', 'ChangedIdentitiesContext', 'CreateScopeInfo', 'FrameworkIdentityInfo', 'GroupMembership', 'IdentityBase', 'IdentityBatchInfo', 'IdentityScope', 'IdentitySelf', 'IdentitySnapshot', 'IdentityUpdateData', 'JsonPatchOperation', 'JsonWebToken', 'RefreshTokenGrant', 'SwapIdentityInfo', 'TenantInfo', 'Identity', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/licensing/000077500000000000000000000000001360605530400310305ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/licensing/__init__.py000066400000000000000000000021651360605530400331450ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .licensing_client import LicensingClient __all__ = [ 'AccountEntitlement', 'AccountEntitlementUpdateModel', 'AccountLicenseExtensionUsage', 'AccountLicenseUsage', 'AccountRights', 'AccountUserLicense', 'ClientRightsContainer', 'ExtensionAssignment', 'ExtensionAssignmentDetails', 'ExtensionLicenseData', 'ExtensionOperationResult', 'ExtensionRightsResult', 'ExtensionSource', 'GraphSubjectBase', 'IdentityRef', 'License', 'MsdnEntitlement', 'ReferenceLinks', 'LicensingClient' ] licensing_client.py000066400000000000000000000504071360605530400346420ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/licensing# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class LicensingClient(Client): """Licensing :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(LicensingClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'c73a23a1-59bb-458c-8ce3-02c83215e015' def get_extension_license_usage(self): """GetExtensionLicenseUsage. [Preview API] Returns Licensing info about paid extensions assigned to user passed into GetExtensionsAssignedToAccount :rtype: [AccountLicenseExtensionUsage] """ response = self._send(http_method='GET', location_id='01bce8d3-c130-480f-a332-474ae3f6662e', version='5.0-preview.1') return self._deserialize('[AccountLicenseExtensionUsage]', self._unwrap_collection(response)) def get_certificate(self, **kwargs): """GetCertificate. [Preview API] :rtype: object """ response = self._send(http_method='GET', location_id='2e0dbce7-a327-4bc0-a291-056139393f6d', version='5.0-preview.1', accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_client_rights(self, right_name=None, product_version=None, edition=None, rel_type=None, include_certificate=None, canary=None, machine_id=None): """GetClientRights. [Preview API] :param str right_name: :param str product_version: :param str edition: :param str rel_type: :param bool include_certificate: :param str canary: :param str machine_id: :rtype: :class:` ` """ route_values = {} if right_name is not None: route_values['rightName'] = self._serialize.url('right_name', right_name, 'str') query_parameters = {} if product_version is not None: query_parameters['productVersion'] = self._serialize.query('product_version', product_version, 'str') if edition is not None: query_parameters['edition'] = self._serialize.query('edition', edition, 'str') if rel_type is not None: query_parameters['relType'] = self._serialize.query('rel_type', rel_type, 'str') if include_certificate is not None: query_parameters['includeCertificate'] = self._serialize.query('include_certificate', include_certificate, 'bool') if canary is not None: query_parameters['canary'] = self._serialize.query('canary', canary, 'str') if machine_id is not None: query_parameters['machineId'] = self._serialize.query('machine_id', machine_id, 'str') response = self._send(http_method='GET', location_id='643c72da-eaee-4163-9f07-d748ef5c2a0c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ClientRightsContainer', response) def assign_available_account_entitlement(self, user_id, dont_notify_user=None, origin=None): """AssignAvailableAccountEntitlement. [Preview API] Assign an available entitilement to a user :param str user_id: The user to which to assign the entitilement :param bool dont_notify_user: :param str origin: :rtype: :class:` ` """ query_parameters = {} if user_id is not None: query_parameters['userId'] = self._serialize.query('user_id', user_id, 'str') if dont_notify_user is not None: query_parameters['dontNotifyUser'] = self._serialize.query('dont_notify_user', dont_notify_user, 'bool') if origin is not None: query_parameters['origin'] = self._serialize.query('origin', origin, 'str') response = self._send(http_method='POST', location_id='c01e9fd5-0d8c-4d5e-9a68-734bd8da6a38', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('AccountEntitlement', response) def get_account_entitlement(self): """GetAccountEntitlement. [Preview API] Gets the account entitlement of the current user it is mapped to _apis/licensing/entitlements/me so specifically is looking for the user of the request :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='c01e9fd5-0d8c-4d5e-9a68-734bd8da6a38', version='5.0-preview.1') return self._deserialize('AccountEntitlement', response) def get_account_entitlements(self, top=None, skip=None): """GetAccountEntitlements. [Preview API] Gets top (top) entitlements for users in the account from offset (skip) order by DateCreated ASC :param int top: number of accounts to return :param int skip: records to skip, null is interpreted as 0 :rtype: [AccountEntitlement] """ query_parameters = {} if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='ea37be6f-8cd7-48dd-983d-2b72d6e3da0f', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[AccountEntitlement]', self._unwrap_collection(response)) def assign_account_entitlement_for_user(self, body, user_id, dont_notify_user=None, origin=None): """AssignAccountEntitlementForUser. [Preview API] Assign an explicit account entitlement :param :class:` ` body: The update model for the entitlement :param str user_id: The id of the user :param bool dont_notify_user: :param str origin: :rtype: :class:` ` """ route_values = {} if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') query_parameters = {} if dont_notify_user is not None: query_parameters['dontNotifyUser'] = self._serialize.query('dont_notify_user', dont_notify_user, 'bool') if origin is not None: query_parameters['origin'] = self._serialize.query('origin', origin, 'str') content = self._serialize.body(body, 'AccountEntitlementUpdateModel') response = self._send(http_method='PUT', location_id='6490e566-b299-49a7-a4e4-28749752581f', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('AccountEntitlement', response) def delete_user_entitlements(self, user_id): """DeleteUserEntitlements. [Preview API] :param str user_id: """ route_values = {} if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') self._send(http_method='DELETE', location_id='6490e566-b299-49a7-a4e4-28749752581f', version='5.0-preview.1', route_values=route_values) def get_account_entitlement_for_user(self, user_id, determine_rights=None, create_if_not_exists=None): """GetAccountEntitlementForUser. [Preview API] Get the entitlements for a user :param str user_id: The id of the user :param bool determine_rights: :param bool create_if_not_exists: :rtype: :class:` ` """ route_values = {} if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') query_parameters = {} if determine_rights is not None: query_parameters['determineRights'] = self._serialize.query('determine_rights', determine_rights, 'bool') if create_if_not_exists is not None: query_parameters['createIfNotExists'] = self._serialize.query('create_if_not_exists', create_if_not_exists, 'bool') response = self._send(http_method='GET', location_id='6490e566-b299-49a7-a4e4-28749752581f', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('AccountEntitlement', response) def get_account_entitlements_batch(self, user_ids): """GetAccountEntitlementsBatch. [Preview API] Returns AccountEntitlements that are currently assigned to the given list of users in the account :param [str] user_ids: List of user Ids. :rtype: [AccountEntitlement] """ route_values = {} route_values['action'] = 'GetUsersEntitlements' content = self._serialize.body(user_ids, '[str]') response = self._send(http_method='POST', location_id='cc3a0130-78ad-4a00-b1ca-49bef42f4656', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('[AccountEntitlement]', self._unwrap_collection(response)) def obtain_available_account_entitlements(self, user_ids): """ObtainAvailableAccountEntitlements. [Preview API] Returns AccountEntitlements that are currently assigned to the given list of users in the account :param [str] user_ids: List of user Ids. :rtype: [AccountEntitlement] """ route_values = {} route_values['action'] = 'GetAvailableUsersEntitlements' content = self._serialize.body(user_ids, '[str]') response = self._send(http_method='POST', location_id='cc3a0130-78ad-4a00-b1ca-49bef42f4656', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('[AccountEntitlement]', self._unwrap_collection(response)) def assign_extension_to_all_eligible_users(self, extension_id): """AssignExtensionToAllEligibleUsers. [Preview API] Assigns the access to the given extension for all eligible users in the account that do not already have access to the extension though bundle or account assignment :param str extension_id: The extension id to assign the access to. :rtype: [ExtensionOperationResult] """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') response = self._send(http_method='PUT', location_id='5434f182-7f32-4135-8326-9340d887c08a', version='5.0-preview.1', route_values=route_values) return self._deserialize('[ExtensionOperationResult]', self._unwrap_collection(response)) def get_eligible_users_for_extension(self, extension_id, options): """GetEligibleUsersForExtension. [Preview API] Returns users that are currently eligible to assign the extension to. the list is filtered based on the value of ExtensionFilterOptions :param str extension_id: The extension to check the eligibility of the users for. :param str options: The options to filter the list. :rtype: [str] """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') query_parameters = {} if options is not None: query_parameters['options'] = self._serialize.query('options', options, 'str') response = self._send(http_method='GET', location_id='5434f182-7f32-4135-8326-9340d887c08a', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def get_extension_status_for_users(self, extension_id): """GetExtensionStatusForUsers. [Preview API] Returns extension assignment status of all account users for the given extension :param str extension_id: The extension to check the status of the users for. :rtype: {ExtensionAssignmentDetails} """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') response = self._send(http_method='GET', location_id='5434f182-7f32-4135-8326-9340d887c08a', version='5.0-preview.1', route_values=route_values) return self._deserialize('{ExtensionAssignmentDetails}', self._unwrap_collection(response)) def assign_extension_to_users(self, body): """AssignExtensionToUsers. [Preview API] Assigns the access to the given extension for a given list of users :param :class:` ` body: The extension assignment details. :rtype: [ExtensionOperationResult] """ content = self._serialize.body(body, 'ExtensionAssignment') response = self._send(http_method='PUT', location_id='8cec75ea-044f-4245-ab0d-a82dafcc85ea', version='5.0-preview.1', content=content) return self._deserialize('[ExtensionOperationResult]', self._unwrap_collection(response)) def get_extensions_assigned_to_user(self, user_id): """GetExtensionsAssignedToUser. [Preview API] Returns extensions that are currently assigned to the user in the account :param str user_id: The user's identity id. :rtype: {LicensingSource} """ route_values = {} if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') response = self._send(http_method='GET', location_id='8cec75ea-044f-4245-ab0d-a82dafcc85ea', version='5.0-preview.1', route_values=route_values) return self._deserialize('{LicensingSource}', self._unwrap_collection(response)) def bulk_get_extensions_assigned_to_users(self, user_ids): """BulkGetExtensionsAssignedToUsers. [Preview API] Returns extensions that are currrently assigned to the users that are in the account :param [str] user_ids: :rtype: {[ExtensionSource]} """ content = self._serialize.body(user_ids, '[str]') response = self._send(http_method='PUT', location_id='1d42ddc2-3e7d-4daa-a0eb-e12c1dbd7c72', version='5.0-preview.2', content=content) return self._deserialize('{[ExtensionSource]}', self._unwrap_collection(response)) def get_extension_license_data(self, extension_id): """GetExtensionLicenseData. [Preview API] :param str extension_id: :rtype: :class:` ` """ route_values = {} if extension_id is not None: route_values['extensionId'] = self._serialize.url('extension_id', extension_id, 'str') response = self._send(http_method='GET', location_id='004a420a-7bef-4b7f-8a50-22975d2067cc', version='5.0-preview.1', route_values=route_values) return self._deserialize('ExtensionLicenseData', response) def register_extension_license(self, extension_license_data): """RegisterExtensionLicense. [Preview API] :param :class:` ` extension_license_data: :rtype: bool """ content = self._serialize.body(extension_license_data, 'ExtensionLicenseData') response = self._send(http_method='POST', location_id='004a420a-7bef-4b7f-8a50-22975d2067cc', version='5.0-preview.1', content=content) return self._deserialize('bool', response) def compute_extension_rights(self, ids): """ComputeExtensionRights. [Preview API] :param [str] ids: :rtype: {bool} """ content = self._serialize.body(ids, '[str]') response = self._send(http_method='POST', location_id='5f1dbe21-f748-47c7-b5fd-3770c8bc2c08', version='5.0-preview.1', content=content) return self._deserialize('{bool}', self._unwrap_collection(response)) def get_extension_rights(self): """GetExtensionRights. [Preview API] :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='5f1dbe21-f748-47c7-b5fd-3770c8bc2c08', version='5.0-preview.1') return self._deserialize('ExtensionRightsResult', response) def get_msdn_presence(self): """GetMsdnPresence. [Preview API] """ self._send(http_method='GET', location_id='69522c3f-eecc-48d0-b333-f69ffb8fa6cc', version='5.0-preview.1') def get_entitlements(self): """GetEntitlements. [Preview API] :rtype: [MsdnEntitlement] """ response = self._send(http_method='GET', location_id='1cc6137e-12d5-4d44-a4f2-765006c9e85d', version='5.0-preview.1') return self._deserialize('[MsdnEntitlement]', self._unwrap_collection(response)) def get_account_licenses_usage(self): """GetAccountLicensesUsage. [Preview API] :rtype: [AccountLicenseUsage] """ response = self._send(http_method='GET', location_id='d3266b87-d395-4e91-97a5-0215b81a0b7d', version='5.0-preview.1') return self._deserialize('[AccountLicenseUsage]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/licensing/models.py000066400000000000000000000564201360605530400326740ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AccountEntitlement(Model): """AccountEntitlement. :param account_id: Gets or sets the id of the account to which the license belongs :type account_id: str :param assignment_date: Gets or sets the date the license was assigned :type assignment_date: datetime :param assignment_source: Assignment Source :type assignment_source: object :param date_created: Gets or sets the creation date of the user in this account :type date_created: datetime :param last_accessed_date: Gets or sets the date of the user last sign-in to this account :type last_accessed_date: datetime :param license: :type license: :class:`License ` :param origin: Licensing origin :type origin: object :param rights: The computed rights of this user in the account. :type rights: :class:`AccountRights ` :param status: The status of the user in the account :type status: object :param user: Identity information of the user to which the license belongs :type user: :class:`IdentityRef ` :param user_id: Gets the id of the user to which the license belongs :type user_id: str """ _attribute_map = { 'account_id': {'key': 'accountId', 'type': 'str'}, 'assignment_date': {'key': 'assignmentDate', 'type': 'iso-8601'}, 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, 'license': {'key': 'license', 'type': 'License'}, 'origin': {'key': 'origin', 'type': 'object'}, 'rights': {'key': 'rights', 'type': 'AccountRights'}, 'status': {'key': 'status', 'type': 'object'}, 'user': {'key': 'user', 'type': 'IdentityRef'}, 'user_id': {'key': 'userId', 'type': 'str'} } def __init__(self, account_id=None, assignment_date=None, assignment_source=None, date_created=None, last_accessed_date=None, license=None, origin=None, rights=None, status=None, user=None, user_id=None): super(AccountEntitlement, self).__init__() self.account_id = account_id self.assignment_date = assignment_date self.assignment_source = assignment_source self.date_created = date_created self.last_accessed_date = last_accessed_date self.license = license self.origin = origin self.rights = rights self.status = status self.user = user self.user_id = user_id class AccountEntitlementUpdateModel(Model): """AccountEntitlementUpdateModel. :param license: Gets or sets the license for the entitlement :type license: :class:`License ` """ _attribute_map = { 'license': {'key': 'license', 'type': 'License'} } def __init__(self, license=None): super(AccountEntitlementUpdateModel, self).__init__() self.license = license class AccountLicenseExtensionUsage(Model): """AccountLicenseExtensionUsage. :param extension_id: :type extension_id: str :param extension_name: :type extension_name: str :param included_quantity: :type included_quantity: int :param is_trial: :type is_trial: bool :param minimum_license_required: :type minimum_license_required: object :param msdn_used_count: :type msdn_used_count: int :param provisioned_count: :type provisioned_count: int :param remaining_trial_days: :type remaining_trial_days: int :param trial_expiry_date: :type trial_expiry_date: datetime :param used_count: :type used_count: int """ _attribute_map = { 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'included_quantity': {'key': 'includedQuantity', 'type': 'int'}, 'is_trial': {'key': 'isTrial', 'type': 'bool'}, 'minimum_license_required': {'key': 'minimumLicenseRequired', 'type': 'object'}, 'msdn_used_count': {'key': 'msdnUsedCount', 'type': 'int'}, 'provisioned_count': {'key': 'provisionedCount', 'type': 'int'}, 'remaining_trial_days': {'key': 'remainingTrialDays', 'type': 'int'}, 'trial_expiry_date': {'key': 'trialExpiryDate', 'type': 'iso-8601'}, 'used_count': {'key': 'usedCount', 'type': 'int'} } def __init__(self, extension_id=None, extension_name=None, included_quantity=None, is_trial=None, minimum_license_required=None, msdn_used_count=None, provisioned_count=None, remaining_trial_days=None, trial_expiry_date=None, used_count=None): super(AccountLicenseExtensionUsage, self).__init__() self.extension_id = extension_id self.extension_name = extension_name self.included_quantity = included_quantity self.is_trial = is_trial self.minimum_license_required = minimum_license_required self.msdn_used_count = msdn_used_count self.provisioned_count = provisioned_count self.remaining_trial_days = remaining_trial_days self.trial_expiry_date = trial_expiry_date self.used_count = used_count class AccountLicenseUsage(Model): """AccountLicenseUsage. :param disabled_count: Amount that is disabled (Usually from licenses that were provisioned, but became invalid due to loss of subscription in a new billing cycle) :type disabled_count: int :param license: :type license: :class:`AccountUserLicense ` :param pending_provisioned_count: Amount that will be purchased in the next billing cycle :type pending_provisioned_count: int :param provisioned_count: Amount that has been purchased :type provisioned_count: int :param used_count: Amount currently being used. :type used_count: int """ _attribute_map = { 'disabled_count': {'key': 'disabledCount', 'type': 'int'}, 'license': {'key': 'license', 'type': 'AccountUserLicense'}, 'pending_provisioned_count': {'key': 'pendingProvisionedCount', 'type': 'int'}, 'provisioned_count': {'key': 'provisionedCount', 'type': 'int'}, 'used_count': {'key': 'usedCount', 'type': 'int'} } def __init__(self, disabled_count=None, license=None, pending_provisioned_count=None, provisioned_count=None, used_count=None): super(AccountLicenseUsage, self).__init__() self.disabled_count = disabled_count self.license = license self.pending_provisioned_count = pending_provisioned_count self.provisioned_count = provisioned_count self.used_count = used_count class AccountRights(Model): """AccountRights. :param level: :type level: object :param reason: :type reason: str """ _attribute_map = { 'level': {'key': 'level', 'type': 'object'}, 'reason': {'key': 'reason', 'type': 'str'} } def __init__(self, level=None, reason=None): super(AccountRights, self).__init__() self.level = level self.reason = reason class AccountUserLicense(Model): """AccountUserLicense. :param license: :type license: int :param source: :type source: object """ _attribute_map = { 'license': {'key': 'license', 'type': 'int'}, 'source': {'key': 'source', 'type': 'object'} } def __init__(self, license=None, source=None): super(AccountUserLicense, self).__init__() self.license = license self.source = source class ClientRightsContainer(Model): """ClientRightsContainer. :param certificate_bytes: :type certificate_bytes: str :param token: :type token: str """ _attribute_map = { 'certificate_bytes': {'key': 'certificateBytes', 'type': 'str'}, 'token': {'key': 'token', 'type': 'str'} } def __init__(self, certificate_bytes=None, token=None): super(ClientRightsContainer, self).__init__() self.certificate_bytes = certificate_bytes self.token = token class ExtensionAssignment(Model): """ExtensionAssignment. :param extension_gallery_id: Gets or sets the extension ID to assign. :type extension_gallery_id: str :param is_auto_assignment: Set to true if this a auto assignment scenario. :type is_auto_assignment: bool :param licensing_source: Gets or sets the licensing source. :type licensing_source: object :param user_ids: Gets or sets the user IDs to assign the extension to. :type user_ids: list of str """ _attribute_map = { 'extension_gallery_id': {'key': 'extensionGalleryId', 'type': 'str'}, 'is_auto_assignment': {'key': 'isAutoAssignment', 'type': 'bool'}, 'licensing_source': {'key': 'licensingSource', 'type': 'object'}, 'user_ids': {'key': 'userIds', 'type': '[str]'} } def __init__(self, extension_gallery_id=None, is_auto_assignment=None, licensing_source=None, user_ids=None): super(ExtensionAssignment, self).__init__() self.extension_gallery_id = extension_gallery_id self.is_auto_assignment = is_auto_assignment self.licensing_source = licensing_source self.user_ids = user_ids class ExtensionAssignmentDetails(Model): """ExtensionAssignmentDetails. :param assignment_status: :type assignment_status: object :param source_collection_name: :type source_collection_name: str """ _attribute_map = { 'assignment_status': {'key': 'assignmentStatus', 'type': 'object'}, 'source_collection_name': {'key': 'sourceCollectionName', 'type': 'str'} } def __init__(self, assignment_status=None, source_collection_name=None): super(ExtensionAssignmentDetails, self).__init__() self.assignment_status = assignment_status self.source_collection_name = source_collection_name class ExtensionLicenseData(Model): """ExtensionLicenseData. :param created_date: :type created_date: datetime :param extension_id: :type extension_id: str :param is_free: :type is_free: bool :param minimum_required_access_level: :type minimum_required_access_level: object :param updated_date: :type updated_date: datetime """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'is_free': {'key': 'isFree', 'type': 'bool'}, 'minimum_required_access_level': {'key': 'minimumRequiredAccessLevel', 'type': 'object'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'} } def __init__(self, created_date=None, extension_id=None, is_free=None, minimum_required_access_level=None, updated_date=None): super(ExtensionLicenseData, self).__init__() self.created_date = created_date self.extension_id = extension_id self.is_free = is_free self.minimum_required_access_level = minimum_required_access_level self.updated_date = updated_date class ExtensionOperationResult(Model): """ExtensionOperationResult. :param account_id: :type account_id: str :param extension_id: :type extension_id: str :param message: :type message: str :param operation: :type operation: object :param result: :type result: object :param user_id: :type user_id: str """ _attribute_map = { 'account_id': {'key': 'accountId', 'type': 'str'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'operation': {'key': 'operation', 'type': 'object'}, 'result': {'key': 'result', 'type': 'object'}, 'user_id': {'key': 'userId', 'type': 'str'} } def __init__(self, account_id=None, extension_id=None, message=None, operation=None, result=None, user_id=None): super(ExtensionOperationResult, self).__init__() self.account_id = account_id self.extension_id = extension_id self.message = message self.operation = operation self.result = result self.user_id = user_id class ExtensionRightsResult(Model): """ExtensionRightsResult. :param entitled_extensions: :type entitled_extensions: list of str :param host_id: :type host_id: str :param reason: :type reason: str :param reason_code: :type reason_code: object :param result_code: :type result_code: object """ _attribute_map = { 'entitled_extensions': {'key': 'entitledExtensions', 'type': '[str]'}, 'host_id': {'key': 'hostId', 'type': 'str'}, 'reason': {'key': 'reason', 'type': 'str'}, 'reason_code': {'key': 'reasonCode', 'type': 'object'}, 'result_code': {'key': 'resultCode', 'type': 'object'} } def __init__(self, entitled_extensions=None, host_id=None, reason=None, reason_code=None, result_code=None): super(ExtensionRightsResult, self).__init__() self.entitled_extensions = entitled_extensions self.host_id = host_id self.reason = reason self.reason_code = reason_code self.result_code = result_code class ExtensionSource(Model): """ExtensionSource. :param assignment_source: Assignment Source :type assignment_source: object :param extension_gallery_id: extension Identifier :type extension_gallery_id: str :param licensing_source: The licensing source of the extension. Account, Msdn, ect. :type licensing_source: object """ _attribute_map = { 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, 'extension_gallery_id': {'key': 'extensionGalleryId', 'type': 'str'}, 'licensing_source': {'key': 'licensingSource', 'type': 'object'} } def __init__(self, assignment_source=None, extension_gallery_id=None, licensing_source=None): super(ExtensionSource, self).__init__() self.assignment_source = assignment_source self.extension_gallery_id = extension_gallery_id self.licensing_source = licensing_source class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class License(Model): """License. :param source: Gets the source of the license :type source: object """ _attribute_map = { 'source': {'key': 'source', 'type': 'object'} } def __init__(self, source=None): super(License, self).__init__() self.source = source class MsdnEntitlement(Model): """MsdnEntitlement. :param entitlement_code: Entilement id assigned to Entitlement in Benefits Database. :type entitlement_code: str :param entitlement_name: Entitlement Name e.g. Downloads, Chat. :type entitlement_name: str :param entitlement_type: Type of Entitlement e.g. Downloads, Chat. :type entitlement_type: str :param is_activated: Entitlement activation status :type is_activated: bool :param is_entitlement_available: Entitlement availability :type is_entitlement_available: bool :param subscription_channel: Write MSDN Channel into CRCT (Retail,MPN,VL,BizSpark,DreamSpark,MCT,FTE,Technet,WebsiteSpark,Other) :type subscription_channel: str :param subscription_expiration_date: Subscription Expiration Date. :type subscription_expiration_date: datetime :param subscription_id: Subscription id which identifies the subscription itself. This is the Benefit Detail Guid from BMS. :type subscription_id: str :param subscription_level_code: Identifier of the subscription or benefit level. :type subscription_level_code: str :param subscription_level_name: Name of subscription level. :type subscription_level_name: str :param subscription_status: Subscription Status Code (ACT, PND, INA ...). :type subscription_status: str """ _attribute_map = { 'entitlement_code': {'key': 'entitlementCode', 'type': 'str'}, 'entitlement_name': {'key': 'entitlementName', 'type': 'str'}, 'entitlement_type': {'key': 'entitlementType', 'type': 'str'}, 'is_activated': {'key': 'isActivated', 'type': 'bool'}, 'is_entitlement_available': {'key': 'isEntitlementAvailable', 'type': 'bool'}, 'subscription_channel': {'key': 'subscriptionChannel', 'type': 'str'}, 'subscription_expiration_date': {'key': 'subscriptionExpirationDate', 'type': 'iso-8601'}, 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, 'subscription_level_code': {'key': 'subscriptionLevelCode', 'type': 'str'}, 'subscription_level_name': {'key': 'subscriptionLevelName', 'type': 'str'}, 'subscription_status': {'key': 'subscriptionStatus', 'type': 'str'} } def __init__(self, entitlement_code=None, entitlement_name=None, entitlement_type=None, is_activated=None, is_entitlement_available=None, subscription_channel=None, subscription_expiration_date=None, subscription_id=None, subscription_level_code=None, subscription_level_name=None, subscription_status=None): super(MsdnEntitlement, self).__init__() self.entitlement_code = entitlement_code self.entitlement_name = entitlement_name self.entitlement_type = entitlement_type self.is_activated = is_activated self.is_entitlement_available = is_entitlement_available self.subscription_channel = subscription_channel self.subscription_expiration_date = subscription_expiration_date self.subscription_id = subscription_id self.subscription_level_code = subscription_level_code self.subscription_level_name = subscription_level_name self.subscription_status = subscription_status class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links __all__ = [ 'AccountEntitlement', 'AccountEntitlementUpdateModel', 'AccountLicenseExtensionUsage', 'AccountLicenseUsage', 'AccountRights', 'AccountUserLicense', 'ClientRightsContainer', 'ExtensionAssignment', 'ExtensionAssignmentDetails', 'ExtensionLicenseData', 'ExtensionOperationResult', 'ExtensionRightsResult', 'ExtensionSource', 'GraphSubjectBase', 'IdentityRef', 'License', 'MsdnEntitlement', 'ReferenceLinks', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/location/000077500000000000000000000000001360605530400306655ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/location/__init__.py000066400000000000000000000015061360605530400330000ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .location_client import LocationClient __all__ = [ 'AccessMapping', 'ConnectionData', 'Identity', 'IdentityBase', 'LocationMapping', 'LocationServiceData', 'ResourceAreaInfo', 'ServiceDefinition', 'LocationClient' ] location_client.py000066400000000000000000000230551360605530400343330ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/location# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class LocationClient(Client): """Location :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(LocationClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_connection_data(self, connect_options=None, last_change_id=None, last_change_id64=None): """GetConnectionData. [Preview API] This was copied and adapted from TeamFoundationConnectionService.Connect() :param str connect_options: :param int last_change_id: Obsolete 32-bit LastChangeId :param long last_change_id64: Non-truncated 64-bit LastChangeId :rtype: :class:` ` """ query_parameters = {} if connect_options is not None: query_parameters['connectOptions'] = self._serialize.query('connect_options', connect_options, 'str') if last_change_id is not None: query_parameters['lastChangeId'] = self._serialize.query('last_change_id', last_change_id, 'int') if last_change_id64 is not None: query_parameters['lastChangeId64'] = self._serialize.query('last_change_id64', last_change_id64, 'long') response = self._send(http_method='GET', location_id='00d9565f-ed9c-4a06-9a50-00e7896ccab4', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('ConnectionData', response) def get_resource_area(self, area_id, enterprise_name=None, organization_name=None): """GetResourceArea. [Preview API] :param str area_id: :param str enterprise_name: :param str organization_name: :rtype: :class:` ` """ route_values = {} if area_id is not None: route_values['areaId'] = self._serialize.url('area_id', area_id, 'str') query_parameters = {} if enterprise_name is not None: query_parameters['enterpriseName'] = self._serialize.query('enterprise_name', enterprise_name, 'str') if organization_name is not None: query_parameters['organizationName'] = self._serialize.query('organization_name', organization_name, 'str') response = self._send(http_method='GET', location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ResourceAreaInfo', response) def get_resource_area_by_host(self, area_id, host_id): """GetResourceAreaByHost. [Preview API] :param str area_id: :param str host_id: :rtype: :class:` ` """ route_values = {} if area_id is not None: route_values['areaId'] = self._serialize.url('area_id', area_id, 'str') query_parameters = {} if host_id is not None: query_parameters['hostId'] = self._serialize.query('host_id', host_id, 'str') response = self._send(http_method='GET', location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ResourceAreaInfo', response) def get_resource_areas(self, enterprise_name=None, organization_name=None): """GetResourceAreas. [Preview API] :param str enterprise_name: :param str organization_name: :rtype: [ResourceAreaInfo] """ query_parameters = {} if enterprise_name is not None: query_parameters['enterpriseName'] = self._serialize.query('enterprise_name', enterprise_name, 'str') if organization_name is not None: query_parameters['organizationName'] = self._serialize.query('organization_name', organization_name, 'str') response = self._send(http_method='GET', location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[ResourceAreaInfo]', self._unwrap_collection(response)) def get_resource_areas_by_host(self, host_id): """GetResourceAreasByHost. [Preview API] :param str host_id: :rtype: [ResourceAreaInfo] """ query_parameters = {} if host_id is not None: query_parameters['hostId'] = self._serialize.query('host_id', host_id, 'str') response = self._send(http_method='GET', location_id='e81700f7-3be2-46de-8624-2eb35882fcaa', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[ResourceAreaInfo]', self._unwrap_collection(response)) def delete_service_definition(self, service_type, identifier): """DeleteServiceDefinition. [Preview API] :param str service_type: :param str identifier: """ route_values = {} if service_type is not None: route_values['serviceType'] = self._serialize.url('service_type', service_type, 'str') if identifier is not None: route_values['identifier'] = self._serialize.url('identifier', identifier, 'str') self._send(http_method='DELETE', location_id='d810a47d-f4f4-4a62-a03f-fa1860585c4c', version='5.0-preview.1', route_values=route_values) def get_service_definition(self, service_type, identifier, allow_fault_in=None, preview_fault_in=None): """GetServiceDefinition. [Preview API] Finds a given service definition. :param str service_type: :param str identifier: :param bool allow_fault_in: If true, we will attempt to fault in a host instance mapping if in SPS. :param bool preview_fault_in: If true, we will calculate and return a host instance mapping, but not persist it. :rtype: :class:` ` """ route_values = {} if service_type is not None: route_values['serviceType'] = self._serialize.url('service_type', service_type, 'str') if identifier is not None: route_values['identifier'] = self._serialize.url('identifier', identifier, 'str') query_parameters = {} if allow_fault_in is not None: query_parameters['allowFaultIn'] = self._serialize.query('allow_fault_in', allow_fault_in, 'bool') if preview_fault_in is not None: query_parameters['previewFaultIn'] = self._serialize.query('preview_fault_in', preview_fault_in, 'bool') response = self._send(http_method='GET', location_id='d810a47d-f4f4-4a62-a03f-fa1860585c4c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ServiceDefinition', response) def get_service_definitions(self, service_type=None): """GetServiceDefinitions. [Preview API] :param str service_type: :rtype: [ServiceDefinition] """ route_values = {} if service_type is not None: route_values['serviceType'] = self._serialize.url('service_type', service_type, 'str') response = self._send(http_method='GET', location_id='d810a47d-f4f4-4a62-a03f-fa1860585c4c', version='5.0-preview.1', route_values=route_values) return self._deserialize('[ServiceDefinition]', self._unwrap_collection(response)) def update_service_definitions(self, service_definitions): """UpdateServiceDefinitions. [Preview API] :param :class:` ` service_definitions: """ content = self._serialize.body(service_definitions, 'VssJsonCollectionWrapper') self._send(http_method='PATCH', location_id='d810a47d-f4f4-4a62-a03f-fa1860585c4c', version='5.0-preview.1', content=content) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/location/models.py000066400000000000000000000463221360605530400325310ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AccessMapping(Model): """AccessMapping. :param access_point: :type access_point: str :param display_name: :type display_name: str :param moniker: :type moniker: str :param service_owner: The service which owns this access mapping e.g. TFS, ELS, etc. :type service_owner: str :param virtual_directory: Part of the access mapping which applies context after the access point of the server. :type virtual_directory: str """ _attribute_map = { 'access_point': {'key': 'accessPoint', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'moniker': {'key': 'moniker', 'type': 'str'}, 'service_owner': {'key': 'serviceOwner', 'type': 'str'}, 'virtual_directory': {'key': 'virtualDirectory', 'type': 'str'} } def __init__(self, access_point=None, display_name=None, moniker=None, service_owner=None, virtual_directory=None): super(AccessMapping, self).__init__() self.access_point = access_point self.display_name = display_name self.moniker = moniker self.service_owner = service_owner self.virtual_directory = virtual_directory class ConnectionData(Model): """ConnectionData. :param authenticated_user: The Id of the authenticated user who made this request. More information about the user can be obtained by passing this Id to the Identity service :type authenticated_user: :class:`Identity ` :param authorized_user: The Id of the authorized user who made this request. More information about the user can be obtained by passing this Id to the Identity service :type authorized_user: :class:`Identity ` :param deployment_id: The id for the server. :type deployment_id: str :param deployment_type: The type for the server Hosted/OnPremises. :type deployment_type: object :param instance_id: The instance id for this host. :type instance_id: str :param last_user_access: The last user access for this instance. Null if not requested specifically. :type last_user_access: datetime :param location_service_data: Data that the location service holds. :type location_service_data: :class:`LocationServiceData ` :param web_application_relative_directory: The virtual directory of the host we are talking to. :type web_application_relative_directory: str """ _attribute_map = { 'authenticated_user': {'key': 'authenticatedUser', 'type': 'Identity'}, 'authorized_user': {'key': 'authorizedUser', 'type': 'Identity'}, 'deployment_id': {'key': 'deploymentId', 'type': 'str'}, 'deployment_type': {'key': 'deploymentType', 'type': 'object'}, 'instance_id': {'key': 'instanceId', 'type': 'str'}, 'last_user_access': {'key': 'lastUserAccess', 'type': 'iso-8601'}, 'location_service_data': {'key': 'locationServiceData', 'type': 'LocationServiceData'}, 'web_application_relative_directory': {'key': 'webApplicationRelativeDirectory', 'type': 'str'} } def __init__(self, authenticated_user=None, authorized_user=None, deployment_id=None, deployment_type=None, instance_id=None, last_user_access=None, location_service_data=None, web_application_relative_directory=None): super(ConnectionData, self).__init__() self.authenticated_user = authenticated_user self.authorized_user = authorized_user self.deployment_id = deployment_id self.deployment_type = deployment_type self.instance_id = instance_id self.last_user_access = last_user_access self.location_service_data = location_service_data self.web_application_relative_directory = web_application_relative_directory class IdentityBase(Model): """IdentityBase. :param custom_display_name: The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database) :type custom_display_name: str :param descriptor: :type descriptor: :class:`str ` :param id: :type id: str :param is_active: :type is_active: bool :param is_container: :type is_container: bool :param master_id: :type master_id: str :param member_ids: :type member_ids: list of str :param member_of: :type member_of: list of :class:`str ` :param members: :type members: list of :class:`str ` :param meta_type_id: :type meta_type_id: int :param properties: :type properties: :class:`object ` :param provider_display_name: The display name for the identity as specified by the source identity provider. :type provider_display_name: str :param resource_version: :type resource_version: int :param subject_descriptor: :type subject_descriptor: :class:`str ` :param unique_user_id: :type unique_user_id: int """ _attribute_map = { 'custom_display_name': {'key': 'customDisplayName', 'type': 'str'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_active': {'key': 'isActive', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'master_id': {'key': 'masterId', 'type': 'str'}, 'member_ids': {'key': 'memberIds', 'type': '[str]'}, 'member_of': {'key': 'memberOf', 'type': '[str]'}, 'members': {'key': 'members', 'type': '[str]'}, 'meta_type_id': {'key': 'metaTypeId', 'type': 'int'}, 'properties': {'key': 'properties', 'type': 'object'}, 'provider_display_name': {'key': 'providerDisplayName', 'type': 'str'}, 'resource_version': {'key': 'resourceVersion', 'type': 'int'}, 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, 'unique_user_id': {'key': 'uniqueUserId', 'type': 'int'} } def __init__(self, custom_display_name=None, descriptor=None, id=None, is_active=None, is_container=None, master_id=None, member_ids=None, member_of=None, members=None, meta_type_id=None, properties=None, provider_display_name=None, resource_version=None, subject_descriptor=None, unique_user_id=None): super(IdentityBase, self).__init__() self.custom_display_name = custom_display_name self.descriptor = descriptor self.id = id self.is_active = is_active self.is_container = is_container self.master_id = master_id self.member_ids = member_ids self.member_of = member_of self.members = members self.meta_type_id = meta_type_id self.properties = properties self.provider_display_name = provider_display_name self.resource_version = resource_version self.subject_descriptor = subject_descriptor self.unique_user_id = unique_user_id class LocationMapping(Model): """LocationMapping. :param access_mapping_moniker: :type access_mapping_moniker: str :param location: :type location: str """ _attribute_map = { 'access_mapping_moniker': {'key': 'accessMappingMoniker', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'} } def __init__(self, access_mapping_moniker=None, location=None): super(LocationMapping, self).__init__() self.access_mapping_moniker = access_mapping_moniker self.location = location class LocationServiceData(Model): """LocationServiceData. :param access_mappings: Data about the access mappings contained by this location service. :type access_mappings: list of :class:`AccessMapping ` :param client_cache_fresh: Data that the location service holds. :type client_cache_fresh: bool :param client_cache_time_to_live: The time to live on the location service cache. :type client_cache_time_to_live: int :param default_access_mapping_moniker: The default access mapping moniker for the server. :type default_access_mapping_moniker: str :param last_change_id: The obsolete id for the last change that took place on the server (use LastChangeId64). :type last_change_id: int :param last_change_id64: The non-truncated 64-bit id for the last change that took place on the server. :type last_change_id64: long :param service_definitions: Data about the service definitions contained by this location service. :type service_definitions: list of :class:`ServiceDefinition ` :param service_owner: The identifier of the deployment which is hosting this location data (e.g. SPS, TFS, ELS, Napa, etc.) :type service_owner: str """ _attribute_map = { 'access_mappings': {'key': 'accessMappings', 'type': '[AccessMapping]'}, 'client_cache_fresh': {'key': 'clientCacheFresh', 'type': 'bool'}, 'client_cache_time_to_live': {'key': 'clientCacheTimeToLive', 'type': 'int'}, 'default_access_mapping_moniker': {'key': 'defaultAccessMappingMoniker', 'type': 'str'}, 'last_change_id': {'key': 'lastChangeId', 'type': 'int'}, 'last_change_id64': {'key': 'lastChangeId64', 'type': 'long'}, 'service_definitions': {'key': 'serviceDefinitions', 'type': '[ServiceDefinition]'}, 'service_owner': {'key': 'serviceOwner', 'type': 'str'} } def __init__(self, access_mappings=None, client_cache_fresh=None, client_cache_time_to_live=None, default_access_mapping_moniker=None, last_change_id=None, last_change_id64=None, service_definitions=None, service_owner=None): super(LocationServiceData, self).__init__() self.access_mappings = access_mappings self.client_cache_fresh = client_cache_fresh self.client_cache_time_to_live = client_cache_time_to_live self.default_access_mapping_moniker = default_access_mapping_moniker self.last_change_id = last_change_id self.last_change_id64 = last_change_id64 self.service_definitions = service_definitions self.service_owner = service_owner class ResourceAreaInfo(Model): """ResourceAreaInfo. :param id: :type id: str :param location_url: :type location_url: str :param name: :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'location_url': {'key': 'locationUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, location_url=None, name=None): super(ResourceAreaInfo, self).__init__() self.id = id self.location_url = location_url self.name = name class ServiceDefinition(Model): """ServiceDefinition. :param description: :type description: str :param display_name: :type display_name: str :param identifier: :type identifier: str :param inherit_level: :type inherit_level: object :param location_mappings: :type location_mappings: list of :class:`LocationMapping ` :param max_version: Maximum api version that this resource supports (current server version for this resource). Copied from ApiResourceLocation. :type max_version: str :param min_version: Minimum api version that this resource supports. Copied from ApiResourceLocation. :type min_version: str :param parent_identifier: :type parent_identifier: str :param parent_service_type: :type parent_service_type: str :param properties: :type properties: :class:`object ` :param relative_path: :type relative_path: str :param relative_to_setting: :type relative_to_setting: object :param released_version: The latest version of this resource location that is in "Release" (non-preview) mode. Copied from ApiResourceLocation. :type released_version: str :param resource_version: The current resource version supported by this resource location. Copied from ApiResourceLocation. :type resource_version: int :param service_owner: The service which owns this definition e.g. TFS, ELS, etc. :type service_owner: str :param service_type: :type service_type: str :param status: :type status: object :param tool_id: :type tool_id: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'identifier': {'key': 'identifier', 'type': 'str'}, 'inherit_level': {'key': 'inheritLevel', 'type': 'object'}, 'location_mappings': {'key': 'locationMappings', 'type': '[LocationMapping]'}, 'max_version': {'key': 'maxVersion', 'type': 'str'}, 'min_version': {'key': 'minVersion', 'type': 'str'}, 'parent_identifier': {'key': 'parentIdentifier', 'type': 'str'}, 'parent_service_type': {'key': 'parentServiceType', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'relative_path': {'key': 'relativePath', 'type': 'str'}, 'relative_to_setting': {'key': 'relativeToSetting', 'type': 'object'}, 'released_version': {'key': 'releasedVersion', 'type': 'str'}, 'resource_version': {'key': 'resourceVersion', 'type': 'int'}, 'service_owner': {'key': 'serviceOwner', 'type': 'str'}, 'service_type': {'key': 'serviceType', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'tool_id': {'key': 'toolId', 'type': 'str'} } def __init__(self, description=None, display_name=None, identifier=None, inherit_level=None, location_mappings=None, max_version=None, min_version=None, parent_identifier=None, parent_service_type=None, properties=None, relative_path=None, relative_to_setting=None, released_version=None, resource_version=None, service_owner=None, service_type=None, status=None, tool_id=None): super(ServiceDefinition, self).__init__() self.description = description self.display_name = display_name self.identifier = identifier self.inherit_level = inherit_level self.location_mappings = location_mappings self.max_version = max_version self.min_version = min_version self.parent_identifier = parent_identifier self.parent_service_type = parent_service_type self.properties = properties self.relative_path = relative_path self.relative_to_setting = relative_to_setting self.released_version = released_version self.resource_version = resource_version self.service_owner = service_owner self.service_type = service_type self.status = status self.tool_id = tool_id class Identity(IdentityBase): """Identity. :param custom_display_name: The custom display name for the identity (if any). Setting this property to an empty string will clear the existing custom display name. Setting this property to null will not affect the existing persisted value (since null values do not get sent over the wire or to the database) :type custom_display_name: str :param descriptor: :type descriptor: :class:`str ` :param id: :type id: str :param is_active: :type is_active: bool :param is_container: :type is_container: bool :param master_id: :type master_id: str :param member_ids: :type member_ids: list of str :param member_of: :type member_of: list of :class:`str ` :param members: :type members: list of :class:`str ` :param meta_type_id: :type meta_type_id: int :param properties: :type properties: :class:`object ` :param provider_display_name: The display name for the identity as specified by the source identity provider. :type provider_display_name: str :param resource_version: :type resource_version: int :param subject_descriptor: :type subject_descriptor: :class:`str ` :param unique_user_id: :type unique_user_id: int """ _attribute_map = { 'custom_display_name': {'key': 'customDisplayName', 'type': 'str'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_active': {'key': 'isActive', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'master_id': {'key': 'masterId', 'type': 'str'}, 'member_ids': {'key': 'memberIds', 'type': '[str]'}, 'member_of': {'key': 'memberOf', 'type': '[str]'}, 'members': {'key': 'members', 'type': '[str]'}, 'meta_type_id': {'key': 'metaTypeId', 'type': 'int'}, 'properties': {'key': 'properties', 'type': 'object'}, 'provider_display_name': {'key': 'providerDisplayName', 'type': 'str'}, 'resource_version': {'key': 'resourceVersion', 'type': 'int'}, 'subject_descriptor': {'key': 'subjectDescriptor', 'type': 'str'}, 'unique_user_id': {'key': 'uniqueUserId', 'type': 'int'}, } def __init__(self, custom_display_name=None, descriptor=None, id=None, is_active=None, is_container=None, master_id=None, member_ids=None, member_of=None, members=None, meta_type_id=None, properties=None, provider_display_name=None, resource_version=None, subject_descriptor=None, unique_user_id=None): super(Identity, self).__init__(custom_display_name=custom_display_name, descriptor=descriptor, id=id, is_active=is_active, is_container=is_container, master_id=master_id, member_ids=member_ids, member_of=member_of, members=members, meta_type_id=meta_type_id, properties=properties, provider_display_name=provider_display_name, resource_version=resource_version, subject_descriptor=subject_descriptor, unique_user_id=unique_user_id) __all__ = [ 'AccessMapping', 'ConnectionData', 'IdentityBase', 'LocationMapping', 'LocationServiceData', 'ResourceAreaInfo', 'ServiceDefinition', 'Identity', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/maven/000077500000000000000000000000001360605530400301635ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/maven/__init__.py000066400000000000000000000025421360605530400322770ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .maven_client import MavenClient __all__ = [ 'BatchOperationData', 'MavenDistributionManagement', 'MavenMinimalPackageDetails', 'MavenPackage', 'MavenPackagesBatchRequest', 'MavenPackageVersionDeletionState', 'MavenPomBuild', 'MavenPomCi', 'MavenPomCiNotifier', 'MavenPomDependency', 'MavenPomDependencyManagement', 'MavenPomGav', 'MavenPomIssueManagement', 'MavenPomLicense', 'MavenPomMailingList', 'MavenPomMetadata', 'MavenPomOrganization', 'MavenPomParent', 'MavenPomPerson', 'MavenPomScm', 'MavenRecycleBinPackageVersionDetails', 'MavenRepository', 'MavenSnapshotRepository', 'Package', 'Plugin', 'PluginConfiguration', 'ReferenceLink', 'ReferenceLinks', 'MavenClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/maven/maven_client.py000066400000000000000000000175151360605530400332120ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class MavenClient(Client): """Maven :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(MavenClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '6f7f8c07-ff36-473c-bcf3-bd6cc9b6c066' def delete_package_version_from_recycle_bin(self, feed, group_id, artifact_id, version): """DeletePackageVersionFromRecycleBin. [Preview API] Permanently delete a package from a feed's recycle bin. :param str feed: Name or ID of the feed. :param str group_id: Group ID of the package. :param str artifact_id: Artifact ID of the package. :param str version: Version of the package. """ route_values = {} if feed is not None: route_values['feed'] = self._serialize.url('feed', feed, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if artifact_id is not None: route_values['artifactId'] = self._serialize.url('artifact_id', artifact_id, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') self._send(http_method='DELETE', location_id='f67e10eb-1254-4953-add7-d49b83a16c9f', version='5.0-preview.1', route_values=route_values) def get_package_version_metadata_from_recycle_bin(self, feed, group_id, artifact_id, version): """GetPackageVersionMetadataFromRecycleBin. [Preview API] Get information about a package version in the recycle bin. :param str feed: Name or ID of the feed. :param str group_id: Group ID of the package. :param str artifact_id: Artifact ID of the package. :param str version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed is not None: route_values['feed'] = self._serialize.url('feed', feed, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if artifact_id is not None: route_values['artifactId'] = self._serialize.url('artifact_id', artifact_id, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') response = self._send(http_method='GET', location_id='f67e10eb-1254-4953-add7-d49b83a16c9f', version='5.0-preview.1', route_values=route_values) return self._deserialize('MavenPackageVersionDeletionState', response) def restore_package_version_from_recycle_bin(self, package_version_details, feed, group_id, artifact_id, version): """RestorePackageVersionFromRecycleBin. [Preview API] Restore a package version from the recycle bin to its associated feed. :param :class:` ` package_version_details: Set the 'Deleted' property to false to restore the package. :param str feed: Name or ID of the feed. :param str group_id: Group ID of the package. :param str artifact_id: Artifact ID of the package. :param str version: Version of the package. """ route_values = {} if feed is not None: route_values['feed'] = self._serialize.url('feed', feed, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if artifact_id is not None: route_values['artifactId'] = self._serialize.url('artifact_id', artifact_id, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') content = self._serialize.body(package_version_details, 'MavenRecycleBinPackageVersionDetails') self._send(http_method='PATCH', location_id='f67e10eb-1254-4953-add7-d49b83a16c9f', version='5.0-preview.1', route_values=route_values, content=content) def get_package_version(self, feed, group_id, artifact_id, version, show_deleted=None): """GetPackageVersion. [Preview API] Get information about a package version. :param str feed: Name or ID of the feed. :param str group_id: Group ID of the package. :param str artifact_id: Artifact ID of the package. :param str version: Version of the package. :param bool show_deleted: True to show information for deleted packages. :rtype: :class:` ` """ route_values = {} if feed is not None: route_values['feed'] = self._serialize.url('feed', feed, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if artifact_id is not None: route_values['artifactId'] = self._serialize.url('artifact_id', artifact_id, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') query_parameters = {} if show_deleted is not None: query_parameters['showDeleted'] = self._serialize.query('show_deleted', show_deleted, 'bool') response = self._send(http_method='GET', location_id='180ed967-377a-4112-986b-607adb14ded4', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Package', response) def package_delete(self, feed, group_id, artifact_id, version): """PackageDelete. [Preview API] Delete a package version from the feed and move it to the feed's recycle bin. :param str feed: Name or ID of the feed. :param str group_id: Group ID of the package. :param str artifact_id: Artifact ID of the package. :param str version: Version of the package. """ route_values = {} if feed is not None: route_values['feed'] = self._serialize.url('feed', feed, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if artifact_id is not None: route_values['artifactId'] = self._serialize.url('artifact_id', artifact_id, 'str') if version is not None: route_values['version'] = self._serialize.url('version', version, 'str') self._send(http_method='DELETE', location_id='180ed967-377a-4112-986b-607adb14ded4', version='5.0-preview.1', route_values=route_values) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/maven/models.py000066400000000000000000000656261360605530400320370ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class BatchOperationData(Model): """BatchOperationData. """ _attribute_map = { } def __init__(self): super(BatchOperationData, self).__init__() class MavenDistributionManagement(Model): """MavenDistributionManagement. :param repository: :type repository: :class:`MavenRepository ` :param snapshot_repository: :type snapshot_repository: :class:`MavenSnapshotRepository ` """ _attribute_map = { 'repository': {'key': 'repository', 'type': 'MavenRepository'}, 'snapshot_repository': {'key': 'snapshotRepository', 'type': 'MavenSnapshotRepository'} } def __init__(self, repository=None, snapshot_repository=None): super(MavenDistributionManagement, self).__init__() self.repository = repository self.snapshot_repository = snapshot_repository class MavenMinimalPackageDetails(Model): """MavenMinimalPackageDetails. :param artifact: Package artifact ID :type artifact: str :param group: Package group ID :type group: str :param version: Package version :type version: str """ _attribute_map = { 'artifact': {'key': 'artifact', 'type': 'str'}, 'group': {'key': 'group', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, artifact=None, group=None, version=None): super(MavenMinimalPackageDetails, self).__init__() self.artifact = artifact self.group = group self.version = version class MavenPackage(Model): """MavenPackage. :param artifact_id: :type artifact_id: str :param artifact_index: :type artifact_index: :class:`ReferenceLink ` :param artifact_metadata: :type artifact_metadata: :class:`ReferenceLink ` :param deleted_date: :type deleted_date: datetime :param files: :type files: :class:`ReferenceLinks ` :param group_id: :type group_id: str :param pom: :type pom: :class:`MavenPomMetadata ` :param requested_file: :type requested_file: :class:`ReferenceLink ` :param snapshot_metadata: :type snapshot_metadata: :class:`ReferenceLink ` :param version: :type version: str :param versions: :type versions: :class:`ReferenceLinks ` :param versions_index: :type versions_index: :class:`ReferenceLink ` """ _attribute_map = { 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'artifact_index': {'key': 'artifactIndex', 'type': 'ReferenceLink'}, 'artifact_metadata': {'key': 'artifactMetadata', 'type': 'ReferenceLink'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'files': {'key': 'files', 'type': 'ReferenceLinks'}, 'group_id': {'key': 'groupId', 'type': 'str'}, 'pom': {'key': 'pom', 'type': 'MavenPomMetadata'}, 'requested_file': {'key': 'requestedFile', 'type': 'ReferenceLink'}, 'snapshot_metadata': {'key': 'snapshotMetadata', 'type': 'ReferenceLink'}, 'version': {'key': 'version', 'type': 'str'}, 'versions': {'key': 'versions', 'type': 'ReferenceLinks'}, 'versions_index': {'key': 'versionsIndex', 'type': 'ReferenceLink'} } def __init__(self, artifact_id=None, artifact_index=None, artifact_metadata=None, deleted_date=None, files=None, group_id=None, pom=None, requested_file=None, snapshot_metadata=None, version=None, versions=None, versions_index=None): super(MavenPackage, self).__init__() self.artifact_id = artifact_id self.artifact_index = artifact_index self.artifact_metadata = artifact_metadata self.deleted_date = deleted_date self.files = files self.group_id = group_id self.pom = pom self.requested_file = requested_file self.snapshot_metadata = snapshot_metadata self.version = version self.versions = versions self.versions_index = versions_index class MavenPackagesBatchRequest(Model): """MavenPackagesBatchRequest. :param data: Data required to perform the operation. This is optional based on type of operation. Use BatchPromoteData if performing a promote operation. :type data: :class:`BatchOperationData ` :param operation: Type of operation that needs to be performed on packages. :type operation: object :param packages: The packages onto which the operation will be performed. :type packages: list of :class:`MavenMinimalPackageDetails ` """ _attribute_map = { 'data': {'key': 'data', 'type': 'BatchOperationData'}, 'operation': {'key': 'operation', 'type': 'object'}, 'packages': {'key': 'packages', 'type': '[MavenMinimalPackageDetails]'} } def __init__(self, data=None, operation=None, packages=None): super(MavenPackagesBatchRequest, self).__init__() self.data = data self.operation = operation self.packages = packages class MavenPackageVersionDeletionState(Model): """MavenPackageVersionDeletionState. :param artifact_id: Artifact Id of the package. :type artifact_id: str :param deleted_date: UTC date the package was deleted. :type deleted_date: datetime :param group_id: Group Id of the package. :type group_id: str :param version: Version of the package. :type version: str """ _attribute_map = { 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'group_id': {'key': 'groupId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, artifact_id=None, deleted_date=None, group_id=None, version=None): super(MavenPackageVersionDeletionState, self).__init__() self.artifact_id = artifact_id self.deleted_date = deleted_date self.group_id = group_id self.version = version class MavenPomBuild(Model): """MavenPomBuild. :param plugins: :type plugins: list of :class:`Plugin ` """ _attribute_map = { 'plugins': {'key': 'plugins', 'type': '[Plugin]'} } def __init__(self, plugins=None): super(MavenPomBuild, self).__init__() self.plugins = plugins class MavenPomCi(Model): """MavenPomCi. :param notifiers: :type notifiers: list of :class:`MavenPomCiNotifier ` :param system: :type system: str :param url: :type url: str """ _attribute_map = { 'notifiers': {'key': 'notifiers', 'type': '[MavenPomCiNotifier]'}, 'system': {'key': 'system', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, notifiers=None, system=None, url=None): super(MavenPomCi, self).__init__() self.notifiers = notifiers self.system = system self.url = url class MavenPomCiNotifier(Model): """MavenPomCiNotifier. :param configuration: :type configuration: list of str :param send_on_error: :type send_on_error: str :param send_on_failure: :type send_on_failure: str :param send_on_success: :type send_on_success: str :param send_on_warning: :type send_on_warning: str :param type: :type type: str """ _attribute_map = { 'configuration': {'key': 'configuration', 'type': '[str]'}, 'send_on_error': {'key': 'sendOnError', 'type': 'str'}, 'send_on_failure': {'key': 'sendOnFailure', 'type': 'str'}, 'send_on_success': {'key': 'sendOnSuccess', 'type': 'str'}, 'send_on_warning': {'key': 'sendOnWarning', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, configuration=None, send_on_error=None, send_on_failure=None, send_on_success=None, send_on_warning=None, type=None): super(MavenPomCiNotifier, self).__init__() self.configuration = configuration self.send_on_error = send_on_error self.send_on_failure = send_on_failure self.send_on_success = send_on_success self.send_on_warning = send_on_warning self.type = type class MavenPomDependencyManagement(Model): """MavenPomDependencyManagement. :param dependencies: :type dependencies: list of :class:`MavenPomDependency ` """ _attribute_map = { 'dependencies': {'key': 'dependencies', 'type': '[MavenPomDependency]'} } def __init__(self, dependencies=None): super(MavenPomDependencyManagement, self).__init__() self.dependencies = dependencies class MavenPomGav(Model): """MavenPomGav. :param artifact_id: :type artifact_id: str :param group_id: :type group_id: str :param version: :type version: str """ _attribute_map = { 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'group_id': {'key': 'groupId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, artifact_id=None, group_id=None, version=None): super(MavenPomGav, self).__init__() self.artifact_id = artifact_id self.group_id = group_id self.version = version class MavenPomIssueManagement(Model): """MavenPomIssueManagement. :param system: :type system: str :param url: :type url: str """ _attribute_map = { 'system': {'key': 'system', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, system=None, url=None): super(MavenPomIssueManagement, self).__init__() self.system = system self.url = url class MavenPomMailingList(Model): """MavenPomMailingList. :param archive: :type archive: str :param name: :type name: str :param other_archives: :type other_archives: list of str :param post: :type post: str :param subscribe: :type subscribe: str :param unsubscribe: :type unsubscribe: str """ _attribute_map = { 'archive': {'key': 'archive', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'other_archives': {'key': 'otherArchives', 'type': '[str]'}, 'post': {'key': 'post', 'type': 'str'}, 'subscribe': {'key': 'subscribe', 'type': 'str'}, 'unsubscribe': {'key': 'unsubscribe', 'type': 'str'} } def __init__(self, archive=None, name=None, other_archives=None, post=None, subscribe=None, unsubscribe=None): super(MavenPomMailingList, self).__init__() self.archive = archive self.name = name self.other_archives = other_archives self.post = post self.subscribe = subscribe self.unsubscribe = unsubscribe class MavenPomMetadata(MavenPomGav): """MavenPomMetadata. :param artifact_id: :type artifact_id: str :param group_id: :type group_id: str :param version: :type version: str :param build: :type build: :class:`MavenPomBuild ` :param ci_management: :type ci_management: :class:`MavenPomCi ` :param contributors: :type contributors: list of :class:`MavenPomPerson ` :param dependencies: :type dependencies: list of :class:`MavenPomDependency ` :param dependency_management: :type dependency_management: :class:`MavenPomDependencyManagement ` :param description: :type description: str :param developers: :type developers: list of :class:`MavenPomPerson ` :param distribution_management: :type distribution_management: :class:`MavenDistributionManagement ` :param inception_year: :type inception_year: str :param issue_management: :type issue_management: :class:`MavenPomIssueManagement ` :param licenses: :type licenses: list of :class:`MavenPomLicense ` :param mailing_lists: :type mailing_lists: list of :class:`MavenPomMailingList ` :param model_version: :type model_version: str :param modules: :type modules: list of str :param name: :type name: str :param organization: :type organization: :class:`MavenPomOrganization ` :param packaging: :type packaging: str :param parent: :type parent: :class:`MavenPomParent ` :param prerequisites: :type prerequisites: dict :param properties: :type properties: dict :param scm: :type scm: :class:`MavenPomScm ` :param url: :type url: str """ _attribute_map = { 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'group_id': {'key': 'groupId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'build': {'key': 'build', 'type': 'MavenPomBuild'}, 'ci_management': {'key': 'ciManagement', 'type': 'MavenPomCi'}, 'contributors': {'key': 'contributors', 'type': '[MavenPomPerson]'}, 'dependencies': {'key': 'dependencies', 'type': '[MavenPomDependency]'}, 'dependency_management': {'key': 'dependencyManagement', 'type': 'MavenPomDependencyManagement'}, 'description': {'key': 'description', 'type': 'str'}, 'developers': {'key': 'developers', 'type': '[MavenPomPerson]'}, 'distribution_management': {'key': 'distributionManagement', 'type': 'MavenDistributionManagement'}, 'inception_year': {'key': 'inceptionYear', 'type': 'str'}, 'issue_management': {'key': 'issueManagement', 'type': 'MavenPomIssueManagement'}, 'licenses': {'key': 'licenses', 'type': '[MavenPomLicense]'}, 'mailing_lists': {'key': 'mailingLists', 'type': '[MavenPomMailingList]'}, 'model_version': {'key': 'modelVersion', 'type': 'str'}, 'modules': {'key': 'modules', 'type': '[str]'}, 'name': {'key': 'name', 'type': 'str'}, 'organization': {'key': 'organization', 'type': 'MavenPomOrganization'}, 'packaging': {'key': 'packaging', 'type': 'str'}, 'parent': {'key': 'parent', 'type': 'MavenPomParent'}, 'prerequisites': {'key': 'prerequisites', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'scm': {'key': 'scm', 'type': 'MavenPomScm'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, artifact_id=None, group_id=None, version=None, build=None, ci_management=None, contributors=None, dependencies=None, dependency_management=None, description=None, developers=None, distribution_management=None, inception_year=None, issue_management=None, licenses=None, mailing_lists=None, model_version=None, modules=None, name=None, organization=None, packaging=None, parent=None, prerequisites=None, properties=None, scm=None, url=None): super(MavenPomMetadata, self).__init__(artifact_id=artifact_id, group_id=group_id, version=version) self.build = build self.ci_management = ci_management self.contributors = contributors self.dependencies = dependencies self.dependency_management = dependency_management self.description = description self.developers = developers self.distribution_management = distribution_management self.inception_year = inception_year self.issue_management = issue_management self.licenses = licenses self.mailing_lists = mailing_lists self.model_version = model_version self.modules = modules self.name = name self.organization = organization self.packaging = packaging self.parent = parent self.prerequisites = prerequisites self.properties = properties self.scm = scm self.url = url class MavenPomOrganization(Model): """MavenPomOrganization. :param name: :type name: str :param url: :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, url=None): super(MavenPomOrganization, self).__init__() self.name = name self.url = url class MavenPomParent(MavenPomGav): """MavenPomParent. :param artifact_id: :type artifact_id: str :param group_id: :type group_id: str :param version: :type version: str :param relative_path: :type relative_path: str """ _attribute_map = { 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'group_id': {'key': 'groupId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'relative_path': {'key': 'relativePath', 'type': 'str'} } def __init__(self, artifact_id=None, group_id=None, version=None, relative_path=None): super(MavenPomParent, self).__init__(artifact_id=artifact_id, group_id=group_id, version=version) self.relative_path = relative_path class MavenPomPerson(Model): """MavenPomPerson. :param email: :type email: str :param id: :type id: str :param name: :type name: str :param organization: :type organization: str :param organization_url: :type organization_url: str :param roles: :type roles: list of str :param timezone: :type timezone: str :param url: :type url: str """ _attribute_map = { 'email': {'key': 'email', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'organization': {'key': 'organization', 'type': 'str'}, 'organization_url': {'key': 'organizationUrl', 'type': 'str'}, 'roles': {'key': 'roles', 'type': '[str]'}, 'timezone': {'key': 'timezone', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, email=None, id=None, name=None, organization=None, organization_url=None, roles=None, timezone=None, url=None): super(MavenPomPerson, self).__init__() self.email = email self.id = id self.name = name self.organization = organization self.organization_url = organization_url self.roles = roles self.timezone = timezone self.url = url class MavenPomScm(Model): """MavenPomScm. :param connection: :type connection: str :param developer_connection: :type developer_connection: str :param tag: :type tag: str :param url: :type url: str """ _attribute_map = { 'connection': {'key': 'connection', 'type': 'str'}, 'developer_connection': {'key': 'developerConnection', 'type': 'str'}, 'tag': {'key': 'tag', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, connection=None, developer_connection=None, tag=None, url=None): super(MavenPomScm, self).__init__() self.connection = connection self.developer_connection = developer_connection self.tag = tag self.url = url class MavenRecycleBinPackageVersionDetails(Model): """MavenRecycleBinPackageVersionDetails. :param deleted: Setting to false will undo earlier deletion and restore the package to feed. :type deleted: bool """ _attribute_map = { 'deleted': {'key': 'deleted', 'type': 'bool'} } def __init__(self, deleted=None): super(MavenRecycleBinPackageVersionDetails, self).__init__() self.deleted = deleted class MavenRepository(Model): """MavenRepository. :param unique_version: :type unique_version: bool """ _attribute_map = { 'unique_version': {'key': 'uniqueVersion', 'type': 'bool'} } def __init__(self, unique_version=None): super(MavenRepository, self).__init__() self.unique_version = unique_version class MavenSnapshotRepository(MavenRepository): """MavenSnapshotRepository. :param unique_version: :type unique_version: bool """ _attribute_map = { 'unique_version': {'key': 'uniqueVersion', 'type': 'bool'}, } def __init__(self, unique_version=None): super(MavenSnapshotRepository, self).__init__(unique_version=unique_version) class Package(Model): """Package. :param _links: Related REST links. :type _links: :class:`ReferenceLinks ` :param deleted_date: If and when the package was deleted. :type deleted_date: datetime :param id: Package Id. :type id: str :param name: The display name of the package. :type name: str :param permanently_deleted_date: If and when the package was permanently deleted. :type permanently_deleted_date: datetime :param version: The version of the package. :type version: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'permanently_deleted_date': {'key': 'permanentlyDeletedDate', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, _links=None, deleted_date=None, id=None, name=None, permanently_deleted_date=None, version=None): super(Package, self).__init__() self._links = _links self.deleted_date = deleted_date self.id = id self.name = name self.permanently_deleted_date = permanently_deleted_date self.version = version class Plugin(MavenPomGav): """Plugin. :param artifact_id: :type artifact_id: str :param group_id: :type group_id: str :param version: :type version: str :param configuration: :type configuration: :class:`PluginConfiguration ` """ _attribute_map = { 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'group_id': {'key': 'groupId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'configuration': {'key': 'configuration', 'type': 'PluginConfiguration'} } def __init__(self, artifact_id=None, group_id=None, version=None, configuration=None): super(Plugin, self).__init__(artifact_id=artifact_id, group_id=group_id, version=version) self.configuration = configuration class PluginConfiguration(Model): """PluginConfiguration. :param goal_prefix: :type goal_prefix: str """ _attribute_map = { 'goal_prefix': {'key': 'goalPrefix', 'type': 'str'} } def __init__(self, goal_prefix=None): super(PluginConfiguration, self).__init__() self.goal_prefix = goal_prefix class ReferenceLink(Model): """ReferenceLink. :param href: :type href: str """ _attribute_map = { 'href': {'key': 'href', 'type': 'str'} } def __init__(self, href=None): super(ReferenceLink, self).__init__() self.href = href class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class MavenPomDependency(MavenPomGav): """MavenPomDependency. :param artifact_id: :type artifact_id: str :param group_id: :type group_id: str :param version: :type version: str :param optional: :type optional: bool :param scope: :type scope: str :param type: :type type: str """ _attribute_map = { 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'group_id': {'key': 'groupId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'optional': {'key': 'optional', 'type': 'bool'}, 'scope': {'key': 'scope', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, artifact_id=None, group_id=None, version=None, optional=None, scope=None, type=None): super(MavenPomDependency, self).__init__(artifact_id=artifact_id, group_id=group_id, version=version) self.optional = optional self.scope = scope self.type = type class MavenPomLicense(MavenPomOrganization): """MavenPomLicense. :param name: :type name: str :param url: :type url: str :param distribution: :type distribution: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'distribution': {'key': 'distribution', 'type': 'str'} } def __init__(self, name=None, url=None, distribution=None): super(MavenPomLicense, self).__init__(name=name, url=url) self.distribution = distribution __all__ = [ 'BatchOperationData', 'MavenDistributionManagement', 'MavenMinimalPackageDetails', 'MavenPackage', 'MavenPackagesBatchRequest', 'MavenPackageVersionDeletionState', 'MavenPomBuild', 'MavenPomCi', 'MavenPomCiNotifier', 'MavenPomDependencyManagement', 'MavenPomGav', 'MavenPomIssueManagement', 'MavenPomMailingList', 'MavenPomMetadata', 'MavenPomOrganization', 'MavenPomParent', 'MavenPomPerson', 'MavenPomScm', 'MavenRecycleBinPackageVersionDetails', 'MavenRepository', 'MavenSnapshotRepository', 'Package', 'Plugin', 'PluginConfiguration', 'ReferenceLink', 'ReferenceLinks', 'MavenPomDependency', 'MavenPomLicense', ] member_entitlement_management/000077500000000000000000000000001360605530400350515ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0__init__.py000066400000000000000000000032361360605530400371660ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/member_entitlement_management# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .member_entitlement_management_client import MemberEntitlementManagementClient __all__ = [ 'AccessLevel', 'BaseOperationResult', 'Extension', 'ExtensionSummaryData', 'GraphGroup', 'GraphMember', 'GraphSubject', 'GraphSubjectBase', 'GraphUser', 'Group', 'GroupEntitlement', 'GroupEntitlementOperationReference', 'GroupOperationResult', 'GroupOption', 'JsonPatchOperation', 'LicenseSummaryData', 'MemberEntitlement', 'MemberEntitlementOperationReference', 'MemberEntitlementsPatchResponse', 'MemberEntitlementsPostResponse', 'MemberEntitlementsResponseBase', 'OperationReference', 'OperationResult', 'PagedGraphMemberList', 'PagedList', 'ProjectEntitlement', 'ProjectRef', 'ReferenceLinks', 'SummaryData', 'TeamRef', 'UserEntitlement', 'UserEntitlementOperationReference', 'UserEntitlementOperationResult', 'UserEntitlementsPatchResponse', 'UserEntitlementsPostResponse', 'UserEntitlementsResponseBase', 'UsersSummary', 'MemberEntitlementManagementClient' ] member_entitlement_management_client.py000066400000000000000000000432401360605530400450370ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/member_entitlement_management# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class MemberEntitlementManagementClient(Client): """MemberEntitlementManagement :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(MemberEntitlementManagementClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '68ddce18-2501-45f1-a17b-7931a9922690' def add_group_entitlement(self, group_entitlement, rule_option=None): """AddGroupEntitlement. [Preview API] Create a group entitlement with license rule, extension rule. :param :class:` ` group_entitlement: GroupEntitlement object specifying License Rule, Extensions Rule for the group. Based on the rules the members of the group will be given licenses and extensions. The Group Entitlement can be used to add the group to another project level groups :param str rule_option: RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be created and applied to it’s members (default option) or just be tested :rtype: :class:` ` """ query_parameters = {} if rule_option is not None: query_parameters['ruleOption'] = self._serialize.query('rule_option', rule_option, 'str') content = self._serialize.body(group_entitlement, 'GroupEntitlement') response = self._send(http_method='POST', location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', version='5.0-preview.1', query_parameters=query_parameters, content=content) return self._deserialize('GroupEntitlementOperationReference', response) def delete_group_entitlement(self, group_id, rule_option=None, remove_group_membership=None): """DeleteGroupEntitlement. [Preview API] Delete a group entitlement. :param str group_id: ID of the group to delete. :param str rule_option: RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be deleted and the changes are applied to it’s members (default option) or just be tested :param bool remove_group_membership: Optional parameter that specifies whether the group with the given ID should be removed from all other groups :rtype: :class:` ` """ route_values = {} if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') query_parameters = {} if rule_option is not None: query_parameters['ruleOption'] = self._serialize.query('rule_option', rule_option, 'str') if remove_group_membership is not None: query_parameters['removeGroupMembership'] = self._serialize.query('remove_group_membership', remove_group_membership, 'bool') response = self._send(http_method='DELETE', location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('GroupEntitlementOperationReference', response) def get_group_entitlement(self, group_id): """GetGroupEntitlement. [Preview API] Get a group entitlement. :param str group_id: ID of the group. :rtype: :class:` ` """ route_values = {} if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') response = self._send(http_method='GET', location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', version='5.0-preview.1', route_values=route_values) return self._deserialize('GroupEntitlement', response) def get_group_entitlements(self): """GetGroupEntitlements. [Preview API] Get the group entitlements for an account. :rtype: [GroupEntitlement] """ response = self._send(http_method='GET', location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', version='5.0-preview.1') return self._deserialize('[GroupEntitlement]', self._unwrap_collection(response)) def update_group_entitlement(self, document, group_id, rule_option=None): """UpdateGroupEntitlement. [Preview API] Update entitlements (License Rule, Extensions Rule, Project memberships etc.) for a group. :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform on the group. :param str group_id: ID of the group. :param str rule_option: RuleOption [ApplyGroupRule/TestApplyGroupRule] - specifies if the rules defined in group entitlement should be updated and the changes are applied to it’s members (default option) or just be tested :rtype: :class:` ` """ route_values = {} if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') query_parameters = {} if rule_option is not None: query_parameters['ruleOption'] = self._serialize.query('rule_option', rule_option, 'str') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='2280bffa-58a2-49da-822e-0764a1bb44f7', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/json-patch+json') return self._deserialize('GroupEntitlementOperationReference', response) def add_member_to_group(self, group_id, member_id): """AddMemberToGroup. [Preview API] Add a member to a Group. :param str group_id: Id of the Group. :param str member_id: Id of the member to add. """ route_values = {} if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if member_id is not None: route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') self._send(http_method='PUT', location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8', version='5.0-preview.1', route_values=route_values) def get_group_members(self, group_id, max_results=None, paging_token=None): """GetGroupMembers. [Preview API] Get direct members of a Group. :param str group_id: Id of the Group. :param int max_results: Maximum number of results to retrieve. :param str paging_token: Paging Token from the previous page fetched. If the 'pagingToken' is null, the results would be fetched from the begining of the Members List. :rtype: :class:` ` """ route_values = {} if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') query_parameters = {} if max_results is not None: query_parameters['maxResults'] = self._serialize.query('max_results', max_results, 'int') if paging_token is not None: query_parameters['pagingToken'] = self._serialize.query('paging_token', paging_token, 'str') response = self._send(http_method='GET', location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PagedGraphMemberList', response) def remove_member_from_group(self, group_id, member_id): """RemoveMemberFromGroup. [Preview API] Remove a member from a Group. :param str group_id: Id of the group. :param str member_id: Id of the member to remove. """ route_values = {} if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if member_id is not None: route_values['memberId'] = self._serialize.url('member_id', member_id, 'str') self._send(http_method='DELETE', location_id='45a36e53-5286-4518-aa72-2d29f7acc5d8', version='5.0-preview.1', route_values=route_values) def add_user_entitlement(self, user_entitlement): """AddUserEntitlement. [Preview API] Add a user, assign license and extensions and make them a member of a project group in an account. :param :class:` ` user_entitlement: UserEntitlement object specifying License, Extensions and Project/Team groups the user should be added to. :rtype: :class:` ` """ content = self._serialize.body(user_entitlement, 'UserEntitlement') response = self._send(http_method='POST', location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', version='5.0-preview.2', content=content) return self._deserialize('UserEntitlementsPostResponse', response) def get_user_entitlements(self, top=None, skip=None, filter=None, sort_option=None): """GetUserEntitlements. [Preview API] Get a paged set of user entitlements matching the filter criteria. If no filter is is passed, a page from all the account users is returned. :param int top: Maximum number of the user entitlements to return. Max value is 10000. Default value is 100 :param int skip: Offset: Number of records to skip. Default value is 0 :param str filter: Comma (",") separated list of properties and their values to filter on. Currently, the API only supports filtering by ExtensionId. An example parameter would be filter=extensionId eq search. :param str sort_option: PropertyName and Order (separated by a space ( )) to sort on (e.g. LastAccessDate Desc) :rtype: :class:` ` """ query_parameters = {} if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['skip'] = self._serialize.query('skip', skip, 'int') if filter is not None: query_parameters['filter'] = self._serialize.query('filter', filter, 'str') if sort_option is not None: query_parameters['sortOption'] = self._serialize.query('sort_option', sort_option, 'str') response = self._send(http_method='GET', location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', version='5.0-preview.2', query_parameters=query_parameters) return self._deserialize('PagedGraphMemberList', response) def update_user_entitlements(self, document, do_not_send_invite_for_new_users=None): """UpdateUserEntitlements. [Preview API] Edit the entitlements (License, Extensions, Projects, Teams etc) for one or more users. :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform. :param bool do_not_send_invite_for_new_users: Whether to send email invites to new users or not :rtype: :class:` ` """ query_parameters = {} if do_not_send_invite_for_new_users is not None: query_parameters['doNotSendInviteForNewUsers'] = self._serialize.query('do_not_send_invite_for_new_users', do_not_send_invite_for_new_users, 'bool') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='387f832c-dbf2-4643-88e9-c1aa94dbb737', version='5.0-preview.2', query_parameters=query_parameters, content=content, media_type='application/json-patch+json') return self._deserialize('UserEntitlementOperationReference', response) def delete_user_entitlement(self, user_id): """DeleteUserEntitlement. [Preview API] Delete a user from the account. :param str user_id: ID of the user. """ route_values = {} if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') self._send(http_method='DELETE', location_id='8480c6eb-ce60-47e9-88df-eca3c801638b', version='5.0-preview.2', route_values=route_values) def get_user_entitlement(self, user_id): """GetUserEntitlement. [Preview API] Get User Entitlement for a user. :param str user_id: ID of the user. :rtype: :class:` ` """ route_values = {} if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') response = self._send(http_method='GET', location_id='8480c6eb-ce60-47e9-88df-eca3c801638b', version='5.0-preview.2', route_values=route_values) return self._deserialize('UserEntitlement', response) def update_user_entitlement(self, document, user_id): """UpdateUserEntitlement. [Preview API] Edit the entitlements (License, Extensions, Projects, Teams etc) for a user. :param :class:`<[JsonPatchOperation]> ` document: JsonPatchDocument containing the operations to perform on the user. :param str user_id: ID of the user. :rtype: :class:` ` """ route_values = {} if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='8480c6eb-ce60-47e9-88df-eca3c801638b', version='5.0-preview.2', route_values=route_values, content=content, media_type='application/json-patch+json') return self._deserialize('UserEntitlementsPatchResponse', response) def get_users_summary(self, select=None): """GetUsersSummary. [Preview API] Get summary of Licenses, Extension, Projects, Groups and their assignments in the collection. :param str select: Comma (",") separated list of properties to select. Supported property names are {AccessLevels, Licenses, Extensions, Projects, Groups}. :rtype: :class:` ` """ query_parameters = {} if select is not None: query_parameters['select'] = self._serialize.query('select', select, 'str') response = self._send(http_method='GET', location_id='5ae55b13-c9dd-49d1-957e-6e76c152e3d9', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('UsersSummary', response) models.py000066400000000000000000001635451360605530400367240ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/member_entitlement_management# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AccessLevel(Model): """AccessLevel. :param account_license_type: Type of Account License (e.g. Express, Stakeholder etc.) :type account_license_type: object :param assignment_source: Assignment Source of the License (e.g. Group, Unknown etc. :type assignment_source: object :param license_display_name: Display name of the License :type license_display_name: str :param licensing_source: Licensing Source (e.g. Account. MSDN etc.) :type licensing_source: object :param msdn_license_type: Type of MSDN License (e.g. Visual Studio Professional, Visual Studio Enterprise etc.) :type msdn_license_type: object :param status: User status in the account :type status: object :param status_message: Status message. :type status_message: str """ _attribute_map = { 'account_license_type': {'key': 'accountLicenseType', 'type': 'object'}, 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, 'license_display_name': {'key': 'licenseDisplayName', 'type': 'str'}, 'licensing_source': {'key': 'licensingSource', 'type': 'object'}, 'msdn_license_type': {'key': 'msdnLicenseType', 'type': 'object'}, 'status': {'key': 'status', 'type': 'object'}, 'status_message': {'key': 'statusMessage', 'type': 'str'} } def __init__(self, account_license_type=None, assignment_source=None, license_display_name=None, licensing_source=None, msdn_license_type=None, status=None, status_message=None): super(AccessLevel, self).__init__() self.account_license_type = account_license_type self.assignment_source = assignment_source self.license_display_name = license_display_name self.licensing_source = licensing_source self.msdn_license_type = msdn_license_type self.status = status self.status_message = status_message class BaseOperationResult(Model): """BaseOperationResult. :param errors: List of error codes paired with their corresponding error messages :type errors: list of { key: int; value: str } :param is_success: Success status of the operation :type is_success: bool """ _attribute_map = { 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, 'is_success': {'key': 'isSuccess', 'type': 'bool'} } def __init__(self, errors=None, is_success=None): super(BaseOperationResult, self).__init__() self.errors = errors self.is_success = is_success class Extension(Model): """Extension. :param assignment_source: Assignment source for this extension. I.e. explicitly assigned or from a group rule. :type assignment_source: object :param id: Gallery Id of the Extension. :type id: str :param name: Friendly name of this extension. :type name: str :param source: Source of this extension assignment. Ex: msdn, account, none, etc. :type source: object """ _attribute_map = { 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'source': {'key': 'source', 'type': 'object'} } def __init__(self, assignment_source=None, id=None, name=None, source=None): super(Extension, self).__init__() self.assignment_source = assignment_source self.id = id self.name = name self.source = source class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class Group(Model): """Group. :param display_name: Display Name of the Group :type display_name: str :param group_type: Group Type :type group_type: object """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'group_type': {'key': 'groupType', 'type': 'object'} } def __init__(self, display_name=None, group_type=None): super(Group, self).__init__() self.display_name = display_name self.group_type = group_type class GroupEntitlement(Model): """GroupEntitlement. :param extension_rules: Extension Rules. :type extension_rules: list of :class:`Extension ` :param group: Member reference. :type group: :class:`GraphGroup ` :param id: The unique identifier which matches the Id of the GraphMember. :type id: str :param last_executed: [Readonly] The last time the group licensing rule was executed (regardless of whether any changes were made). :type last_executed: datetime :param license_rule: License Rule. :type license_rule: :class:`AccessLevel ` :param members: Group members. Only used when creating a new group. :type members: list of :class:`UserEntitlement ` :param project_entitlements: Relation between a project and the member's effective permissions in that project. :type project_entitlements: list of :class:`ProjectEntitlement ` :param status: The status of the group rule. :type status: object """ _attribute_map = { 'extension_rules': {'key': 'extensionRules', 'type': '[Extension]'}, 'group': {'key': 'group', 'type': 'GraphGroup'}, 'id': {'key': 'id', 'type': 'str'}, 'last_executed': {'key': 'lastExecuted', 'type': 'iso-8601'}, 'license_rule': {'key': 'licenseRule', 'type': 'AccessLevel'}, 'members': {'key': 'members', 'type': '[UserEntitlement]'}, 'project_entitlements': {'key': 'projectEntitlements', 'type': '[ProjectEntitlement]'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, extension_rules=None, group=None, id=None, last_executed=None, license_rule=None, members=None, project_entitlements=None, status=None): super(GroupEntitlement, self).__init__() self.extension_rules = extension_rules self.group = group self.id = id self.last_executed = last_executed self.license_rule = license_rule self.members = members self.project_entitlements = project_entitlements self.status = status class GroupOperationResult(BaseOperationResult): """GroupOperationResult. :param errors: List of error codes paired with their corresponding error messages :type errors: list of { key: int; value: str } :param is_success: Success status of the operation :type is_success: bool :param group_id: Identifier of the Group being acted upon :type group_id: str :param result: Result of the Groupentitlement after the operation :type result: :class:`GroupEntitlement ` """ _attribute_map = { 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, 'is_success': {'key': 'isSuccess', 'type': 'bool'}, 'group_id': {'key': 'groupId', 'type': 'str'}, 'result': {'key': 'result', 'type': 'GroupEntitlement'} } def __init__(self, errors=None, is_success=None, group_id=None, result=None): super(GroupOperationResult, self).__init__(errors=errors, is_success=is_success) self.group_id = group_id self.result = result class GroupOption(Model): """GroupOption. :param access_level: Access Level :type access_level: :class:`AccessLevel ` :param group: Group :type group: :class:`Group ` """ _attribute_map = { 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, 'group': {'key': 'group', 'type': 'Group'} } def __init__(self, access_level=None, group=None): super(GroupOption, self).__init__() self.access_level = access_level self.group = group class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class MemberEntitlementsResponseBase(Model): """MemberEntitlementsResponseBase. :param is_success: True if all operations were successful. :type is_success: bool :param member_entitlement: Result of the member entitlement after the operations. have been applied :type member_entitlement: :class:`MemberEntitlement ` """ _attribute_map = { 'is_success': {'key': 'isSuccess', 'type': 'bool'}, 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement'} } def __init__(self, is_success=None, member_entitlement=None): super(MemberEntitlementsResponseBase, self).__init__() self.is_success = is_success self.member_entitlement = member_entitlement class OperationReference(Model): """OperationReference. :param id: Unique identifier for the operation. :type id: str :param plugin_id: Unique identifier for the plugin. :type plugin_id: str :param status: The current status of the operation. :type status: object :param url: URL to get the full operation object. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'plugin_id': {'key': 'pluginId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, plugin_id=None, status=None, url=None): super(OperationReference, self).__init__() self.id = id self.plugin_id = plugin_id self.status = status self.url = url class OperationResult(Model): """OperationResult. :param errors: List of error codes paired with their corresponding error messages. :type errors: list of { key: int; value: str } :param is_success: Success status of the operation. :type is_success: bool :param member_id: Identifier of the Member being acted upon. :type member_id: str :param result: Result of the MemberEntitlement after the operation. :type result: :class:`MemberEntitlement ` """ _attribute_map = { 'errors': {'key': 'errors', 'type': '[{ key: int; value: str }]'}, 'is_success': {'key': 'isSuccess', 'type': 'bool'}, 'member_id': {'key': 'memberId', 'type': 'str'}, 'result': {'key': 'result', 'type': 'MemberEntitlement'} } def __init__(self, errors=None, is_success=None, member_id=None, result=None): super(OperationResult, self).__init__() self.errors = errors self.is_success = is_success self.member_id = member_id self.result = result class PagedList(Model): """PagedList. :param continuation_token: :type continuation_token: str :param items: :type items: list of object :param total_count: :type total_count: int """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, 'items': {'key': 'items', 'type': '[object]'}, 'total_count': {'key': 'totalCount', 'type': 'int'} } def __init__(self, continuation_token=None, items=None, total_count=None): super(PagedList, self).__init__() self.continuation_token = continuation_token self.items = items self.total_count = total_count class ProjectEntitlement(Model): """ProjectEntitlement. :param assignment_source: Assignment Source (e.g. Group or Unknown). :type assignment_source: object :param group: Project Group (e.g. Contributor, Reader etc.) :type group: :class:`Group ` :param is_project_permission_inherited: Whether the user is inheriting permissions to a project through a VSTS or AAD group membership. :type is_project_permission_inherited: bool :param project_ref: Project Ref :type project_ref: :class:`ProjectRef ` :param team_refs: Team Ref. :type team_refs: list of :class:`TeamRef ` """ _attribute_map = { 'assignment_source': {'key': 'assignmentSource', 'type': 'object'}, 'group': {'key': 'group', 'type': 'Group'}, 'is_project_permission_inherited': {'key': 'isProjectPermissionInherited', 'type': 'bool'}, 'project_ref': {'key': 'projectRef', 'type': 'ProjectRef'}, 'team_refs': {'key': 'teamRefs', 'type': '[TeamRef]'} } def __init__(self, assignment_source=None, group=None, is_project_permission_inherited=None, project_ref=None, team_refs=None): super(ProjectEntitlement, self).__init__() self.assignment_source = assignment_source self.group = group self.is_project_permission_inherited = is_project_permission_inherited self.project_ref = project_ref self.team_refs = team_refs class ProjectRef(Model): """ProjectRef. :param id: Project ID. :type id: str :param name: Project Name. :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(ProjectRef, self).__init__() self.id = id self.name = name class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class SummaryData(Model): """SummaryData. :param assigned: Count of Licenses already assigned. :type assigned: int :param available: Available Count. :type available: int :param included_quantity: Quantity :type included_quantity: int :param total: Total Count. :type total: int """ _attribute_map = { 'assigned': {'key': 'assigned', 'type': 'int'}, 'available': {'key': 'available', 'type': 'int'}, 'included_quantity': {'key': 'includedQuantity', 'type': 'int'}, 'total': {'key': 'total', 'type': 'int'} } def __init__(self, assigned=None, available=None, included_quantity=None, total=None): super(SummaryData, self).__init__() self.assigned = assigned self.available = available self.included_quantity = included_quantity self.total = total class TeamRef(Model): """TeamRef. :param id: Team ID :type id: str :param name: Team Name :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(TeamRef, self).__init__() self.id = id self.name = name class UserEntitlement(Model): """UserEntitlement. :param access_level: User's access level denoted by a license. :type access_level: :class:`AccessLevel ` :param extensions: User's extensions. :type extensions: list of :class:`Extension ` :param group_assignments: [Readonly] GroupEntitlements that this user belongs to. :type group_assignments: list of :class:`GroupEntitlement ` :param id: The unique identifier which matches the Id of the Identity associated with the GraphMember. :type id: str :param last_accessed_date: [Readonly] Date the user last accessed the collection. :type last_accessed_date: datetime :param project_entitlements: Relation between a project and the user's effective permissions in that project. :type project_entitlements: list of :class:`ProjectEntitlement ` :param user: User reference. :type user: :class:`GraphUser ` """ _attribute_map = { 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, 'extensions': {'key': 'extensions', 'type': '[Extension]'}, 'group_assignments': {'key': 'groupAssignments', 'type': '[GroupEntitlement]'}, 'id': {'key': 'id', 'type': 'str'}, 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, 'project_entitlements': {'key': 'projectEntitlements', 'type': '[ProjectEntitlement]'}, 'user': {'key': 'user', 'type': 'GraphUser'} } def __init__(self, access_level=None, extensions=None, group_assignments=None, id=None, last_accessed_date=None, project_entitlements=None, user=None): super(UserEntitlement, self).__init__() self.access_level = access_level self.extensions = extensions self.group_assignments = group_assignments self.id = id self.last_accessed_date = last_accessed_date self.project_entitlements = project_entitlements self.user = user class UserEntitlementOperationReference(OperationReference): """UserEntitlementOperationReference. :param id: Unique identifier for the operation. :type id: str :param plugin_id: Unique identifier for the plugin. :type plugin_id: str :param status: The current status of the operation. :type status: object :param url: URL to get the full operation object. :type url: str :param completed: Operation completed with success or failure. :type completed: bool :param have_results_succeeded: True if all operations were successful. :type have_results_succeeded: bool :param results: List of results for each operation. :type results: list of :class:`UserEntitlementOperationResult ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'plugin_id': {'key': 'pluginId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'completed': {'key': 'completed', 'type': 'bool'}, 'have_results_succeeded': {'key': 'haveResultsSucceeded', 'type': 'bool'}, 'results': {'key': 'results', 'type': '[UserEntitlementOperationResult]'} } def __init__(self, id=None, plugin_id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): super(UserEntitlementOperationReference, self).__init__(id=id, plugin_id=plugin_id, status=status, url=url) self.completed = completed self.have_results_succeeded = have_results_succeeded self.results = results class UserEntitlementOperationResult(Model): """UserEntitlementOperationResult. :param errors: List of error codes paired with their corresponding error messages. :type errors: list of { key: int; value: str } :param is_success: Success status of the operation. :type is_success: bool :param result: Result of the MemberEntitlement after the operation. :type result: :class:`UserEntitlement ` :param user_id: Identifier of the Member being acted upon. :type user_id: str """ _attribute_map = { 'errors': {'key': 'errors', 'type': 'object'}, 'is_success': {'key': 'isSuccess', 'type': 'bool'}, 'result': {'key': 'result', 'type': 'UserEntitlement'}, 'user_id': {'key': 'userId', 'type': 'str'} } def __init__(self, errors=None, is_success=None, result=None, user_id=None): super(UserEntitlementOperationResult, self).__init__() self.errors = errors self.is_success = is_success self.result = result self.user_id = user_id class UserEntitlementsResponseBase(Model): """UserEntitlementsResponseBase. :param is_success: True if all operations were successful. :type is_success: bool :param user_entitlement: Result of the user entitlement after the operations have been applied. :type user_entitlement: :class:`UserEntitlement ` """ _attribute_map = { 'is_success': {'key': 'isSuccess', 'type': 'bool'}, 'user_entitlement': {'key': 'userEntitlement', 'type': 'UserEntitlement'} } def __init__(self, is_success=None, user_entitlement=None): super(UserEntitlementsResponseBase, self).__init__() self.is_success = is_success self.user_entitlement = user_entitlement class UsersSummary(Model): """UsersSummary. :param available_access_levels: Available Access Levels. :type available_access_levels: list of :class:`AccessLevel ` :param extensions: Summary of Extensions in the account. :type extensions: list of :class:`ExtensionSummaryData ` :param group_options: Group Options. :type group_options: list of :class:`GroupOption ` :param licenses: Summary of Licenses in the Account. :type licenses: list of :class:`LicenseSummaryData ` :param project_refs: Summary of Projects in the Account. :type project_refs: list of :class:`ProjectRef ` """ _attribute_map = { 'available_access_levels': {'key': 'availableAccessLevels', 'type': '[AccessLevel]'}, 'extensions': {'key': 'extensions', 'type': '[ExtensionSummaryData]'}, 'group_options': {'key': 'groupOptions', 'type': '[GroupOption]'}, 'licenses': {'key': 'licenses', 'type': '[LicenseSummaryData]'}, 'project_refs': {'key': 'projectRefs', 'type': '[ProjectRef]'} } def __init__(self, available_access_levels=None, extensions=None, group_options=None, licenses=None, project_refs=None): super(UsersSummary, self).__init__() self.available_access_levels = available_access_levels self.extensions = extensions self.group_options = group_options self.licenses = licenses self.project_refs = project_refs class ExtensionSummaryData(SummaryData): """ExtensionSummaryData. :param assigned: Count of Licenses already assigned. :type assigned: int :param available: Available Count. :type available: int :param included_quantity: Quantity :type included_quantity: int :param total: Total Count. :type total: int :param assigned_through_subscription: Count of Extension Licenses assigned to users through msdn. :type assigned_through_subscription: int :param extension_id: Gallery Id of the Extension :type extension_id: str :param extension_name: Friendly name of this extension :type extension_name: str :param is_trial_version: Whether its a Trial Version. :type is_trial_version: bool :param minimum_license_required: Minimum License Required for the Extension. :type minimum_license_required: object :param remaining_trial_days: Days remaining for the Trial to expire. :type remaining_trial_days: int :param trial_expiry_date: Date on which the Trial expires. :type trial_expiry_date: datetime """ _attribute_map = { 'assigned': {'key': 'assigned', 'type': 'int'}, 'available': {'key': 'available', 'type': 'int'}, 'included_quantity': {'key': 'includedQuantity', 'type': 'int'}, 'total': {'key': 'total', 'type': 'int'}, 'assigned_through_subscription': {'key': 'assignedThroughSubscription', 'type': 'int'}, 'extension_id': {'key': 'extensionId', 'type': 'str'}, 'extension_name': {'key': 'extensionName', 'type': 'str'}, 'is_trial_version': {'key': 'isTrialVersion', 'type': 'bool'}, 'minimum_license_required': {'key': 'minimumLicenseRequired', 'type': 'object'}, 'remaining_trial_days': {'key': 'remainingTrialDays', 'type': 'int'}, 'trial_expiry_date': {'key': 'trialExpiryDate', 'type': 'iso-8601'} } def __init__(self, assigned=None, available=None, included_quantity=None, total=None, assigned_through_subscription=None, extension_id=None, extension_name=None, is_trial_version=None, minimum_license_required=None, remaining_trial_days=None, trial_expiry_date=None): super(ExtensionSummaryData, self).__init__(assigned=assigned, available=available, included_quantity=included_quantity, total=total) self.assigned_through_subscription = assigned_through_subscription self.extension_id = extension_id self.extension_name = extension_name self.is_trial_version = is_trial_version self.minimum_license_required = minimum_license_required self.remaining_trial_days = remaining_trial_days self.trial_expiry_date = trial_expiry_date class GraphSubject(GraphSubjectBase): """GraphSubject. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. :type legacy_descriptor: str :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) :type origin: str :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. :type origin_id: str :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). :type subject_kind: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'subject_kind': {'key': 'subjectKind', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None): super(GraphSubject, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.legacy_descriptor = legacy_descriptor self.origin = origin self.origin_id = origin_id self.subject_kind = subject_kind class GroupEntitlementOperationReference(OperationReference): """GroupEntitlementOperationReference. :param id: Unique identifier for the operation. :type id: str :param plugin_id: Unique identifier for the plugin. :type plugin_id: str :param status: The current status of the operation. :type status: object :param url: URL to get the full operation object. :type url: str :param completed: Operation completed with success or failure. :type completed: bool :param have_results_succeeded: True if all operations were successful. :type have_results_succeeded: bool :param results: List of results for each operation. :type results: list of :class:`GroupOperationResult ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'plugin_id': {'key': 'pluginId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'completed': {'key': 'completed', 'type': 'bool'}, 'have_results_succeeded': {'key': 'haveResultsSucceeded', 'type': 'bool'}, 'results': {'key': 'results', 'type': '[GroupOperationResult]'} } def __init__(self, id=None, plugin_id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): super(GroupEntitlementOperationReference, self).__init__(id=id, plugin_id=plugin_id, status=status, url=url) self.completed = completed self.have_results_succeeded = have_results_succeeded self.results = results class LicenseSummaryData(SummaryData): """LicenseSummaryData. :param assigned: Count of Licenses already assigned. :type assigned: int :param available: Available Count. :type available: int :param included_quantity: Quantity :type included_quantity: int :param total: Total Count. :type total: int :param account_license_type: Type of Account License. :type account_license_type: object :param disabled: Count of Disabled Licenses. :type disabled: int :param is_purchasable: Designates if this license quantity can be changed through purchase :type is_purchasable: bool :param license_name: Name of the License. :type license_name: str :param msdn_license_type: Type of MSDN License. :type msdn_license_type: object :param next_billing_date: Specifies the date when billing will charge for paid licenses :type next_billing_date: datetime :param source: Source of the License. :type source: object :param total_after_next_billing_date: Total license count after next billing cycle :type total_after_next_billing_date: int """ _attribute_map = { 'assigned': {'key': 'assigned', 'type': 'int'}, 'available': {'key': 'available', 'type': 'int'}, 'included_quantity': {'key': 'includedQuantity', 'type': 'int'}, 'total': {'key': 'total', 'type': 'int'}, 'account_license_type': {'key': 'accountLicenseType', 'type': 'object'}, 'disabled': {'key': 'disabled', 'type': 'int'}, 'is_purchasable': {'key': 'isPurchasable', 'type': 'bool'}, 'license_name': {'key': 'licenseName', 'type': 'str'}, 'msdn_license_type': {'key': 'msdnLicenseType', 'type': 'object'}, 'next_billing_date': {'key': 'nextBillingDate', 'type': 'iso-8601'}, 'source': {'key': 'source', 'type': 'object'}, 'total_after_next_billing_date': {'key': 'totalAfterNextBillingDate', 'type': 'int'} } def __init__(self, assigned=None, available=None, included_quantity=None, total=None, account_license_type=None, disabled=None, is_purchasable=None, license_name=None, msdn_license_type=None, next_billing_date=None, source=None, total_after_next_billing_date=None): super(LicenseSummaryData, self).__init__(assigned=assigned, available=available, included_quantity=included_quantity, total=total) self.account_license_type = account_license_type self.disabled = disabled self.is_purchasable = is_purchasable self.license_name = license_name self.msdn_license_type = msdn_license_type self.next_billing_date = next_billing_date self.source = source self.total_after_next_billing_date = total_after_next_billing_date class MemberEntitlement(UserEntitlement): """MemberEntitlement. :param access_level: User's access level denoted by a license. :type access_level: :class:`AccessLevel ` :param extensions: User's extensions. :type extensions: list of :class:`Extension ` :param group_assignments: [Readonly] GroupEntitlements that this user belongs to. :type group_assignments: list of :class:`GroupEntitlement ` :param id: The unique identifier which matches the Id of the Identity associated with the GraphMember. :type id: str :param last_accessed_date: [Readonly] Date the user last accessed the collection. :type last_accessed_date: datetime :param project_entitlements: Relation between a project and the user's effective permissions in that project. :type project_entitlements: list of :class:`ProjectEntitlement ` :param user: User reference. :type user: :class:`GraphUser ` :param member: Member reference :type member: :class:`GraphMember ` """ _attribute_map = { 'access_level': {'key': 'accessLevel', 'type': 'AccessLevel'}, 'extensions': {'key': 'extensions', 'type': '[Extension]'}, 'group_assignments': {'key': 'groupAssignments', 'type': '[GroupEntitlement]'}, 'id': {'key': 'id', 'type': 'str'}, 'last_accessed_date': {'key': 'lastAccessedDate', 'type': 'iso-8601'}, 'project_entitlements': {'key': 'projectEntitlements', 'type': '[ProjectEntitlement]'}, 'user': {'key': 'user', 'type': 'GraphUser'}, 'member': {'key': 'member', 'type': 'GraphMember'} } def __init__(self, access_level=None, extensions=None, group_assignments=None, id=None, last_accessed_date=None, project_entitlements=None, user=None, member=None): super(MemberEntitlement, self).__init__(access_level=access_level, extensions=extensions, group_assignments=group_assignments, id=id, last_accessed_date=last_accessed_date, project_entitlements=project_entitlements, user=user) self.member = member class MemberEntitlementOperationReference(OperationReference): """MemberEntitlementOperationReference. :param id: Unique identifier for the operation. :type id: str :param plugin_id: Unique identifier for the plugin. :type plugin_id: str :param status: The current status of the operation. :type status: object :param url: URL to get the full operation object. :type url: str :param completed: Operation completed with success or failure :type completed: bool :param have_results_succeeded: True if all operations were successful :type have_results_succeeded: bool :param results: List of results for each operation :type results: list of :class:`OperationResult ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'plugin_id': {'key': 'pluginId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'completed': {'key': 'completed', 'type': 'bool'}, 'have_results_succeeded': {'key': 'haveResultsSucceeded', 'type': 'bool'}, 'results': {'key': 'results', 'type': '[OperationResult]'} } def __init__(self, id=None, plugin_id=None, status=None, url=None, completed=None, have_results_succeeded=None, results=None): super(MemberEntitlementOperationReference, self).__init__(id=id, plugin_id=plugin_id, status=status, url=url) self.completed = completed self.have_results_succeeded = have_results_succeeded self.results = results class MemberEntitlementsPatchResponse(MemberEntitlementsResponseBase): """MemberEntitlementsPatchResponse. :param is_success: True if all operations were successful. :type is_success: bool :param member_entitlement: Result of the member entitlement after the operations. have been applied :type member_entitlement: :class:`MemberEntitlement ` :param operation_results: List of results for each operation :type operation_results: list of :class:`OperationResult ` """ _attribute_map = { 'is_success': {'key': 'isSuccess', 'type': 'bool'}, 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement'}, 'operation_results': {'key': 'operationResults', 'type': '[OperationResult]'} } def __init__(self, is_success=None, member_entitlement=None, operation_results=None): super(MemberEntitlementsPatchResponse, self).__init__(is_success=is_success, member_entitlement=member_entitlement) self.operation_results = operation_results class MemberEntitlementsPostResponse(MemberEntitlementsResponseBase): """MemberEntitlementsPostResponse. :param is_success: True if all operations were successful. :type is_success: bool :param member_entitlement: Result of the member entitlement after the operations. have been applied :type member_entitlement: :class:`MemberEntitlement ` :param operation_result: Operation result :type operation_result: :class:`OperationResult ` """ _attribute_map = { 'is_success': {'key': 'isSuccess', 'type': 'bool'}, 'member_entitlement': {'key': 'memberEntitlement', 'type': 'MemberEntitlement'}, 'operation_result': {'key': 'operationResult', 'type': 'OperationResult'} } def __init__(self, is_success=None, member_entitlement=None, operation_result=None): super(MemberEntitlementsPostResponse, self).__init__(is_success=is_success, member_entitlement=member_entitlement) self.operation_result = operation_result class PagedGraphMemberList(PagedList): """PagedGraphMemberList. :param members: :type members: list of :class:`UserEntitlement ` """ _attribute_map = { 'members': {'key': 'members', 'type': '[UserEntitlement]'} } def __init__(self, members=None): super(PagedGraphMemberList, self).__init__() self.members = members class UserEntitlementsPatchResponse(UserEntitlementsResponseBase): """UserEntitlementsPatchResponse. :param is_success: True if all operations were successful. :type is_success: bool :param user_entitlement: Result of the user entitlement after the operations have been applied. :type user_entitlement: :class:`UserEntitlement ` :param operation_results: List of results for each operation. :type operation_results: list of :class:`UserEntitlementOperationResult ` """ _attribute_map = { 'is_success': {'key': 'isSuccess', 'type': 'bool'}, 'user_entitlement': {'key': 'userEntitlement', 'type': 'UserEntitlement'}, 'operation_results': {'key': 'operationResults', 'type': '[UserEntitlementOperationResult]'} } def __init__(self, is_success=None, user_entitlement=None, operation_results=None): super(UserEntitlementsPatchResponse, self).__init__(is_success=is_success, user_entitlement=user_entitlement) self.operation_results = operation_results class UserEntitlementsPostResponse(UserEntitlementsResponseBase): """UserEntitlementsPostResponse. :param is_success: True if all operations were successful. :type is_success: bool :param user_entitlement: Result of the user entitlement after the operations have been applied. :type user_entitlement: :class:`UserEntitlement ` :param operation_result: Operation result. :type operation_result: :class:`UserEntitlementOperationResult ` """ _attribute_map = { 'is_success': {'key': 'isSuccess', 'type': 'bool'}, 'user_entitlement': {'key': 'userEntitlement', 'type': 'UserEntitlement'}, 'operation_result': {'key': 'operationResult', 'type': 'UserEntitlementOperationResult'} } def __init__(self, is_success=None, user_entitlement=None, operation_result=None): super(UserEntitlementsPostResponse, self).__init__(is_success=is_success, user_entitlement=user_entitlement) self.operation_result = operation_result class GraphMember(GraphSubject): """GraphMember. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. :type legacy_descriptor: str :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) :type origin: str :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. :type origin_id: str :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). :type subject_kind: str :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc) :type domain: str :param mail_address: The email address of record for a given graph member. This may be different than the principal name. :type mail_address: str :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS. :type principal_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, 'mail_address': {'key': 'mailAddress', 'type': 'str'}, 'principal_name': {'key': 'principalName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, domain=None, mail_address=None, principal_name=None): super(GraphMember, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind) self.domain = domain self.mail_address = mail_address self.principal_name = principal_name class GraphUser(GraphMember): """GraphUser. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. :type legacy_descriptor: str :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) :type origin: str :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. :type origin_id: str :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). :type subject_kind: str :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc) :type domain: str :param mail_address: The email address of record for a given graph member. This may be different than the principal name. :type mail_address: str :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS. :type principal_name: str :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param metadata_update_date: :type metadata_update_date: datetime :param meta_type: The meta type of the user in the origin, such as "member", "guest", etc. See UserMetaType for the set of possible values. :type meta_type: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, 'mail_address': {'key': 'mailAddress', 'type': 'str'}, 'principal_name': {'key': 'principalName', 'type': 'str'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'metadata_update_date': {'key': 'metadataUpdateDate', 'type': 'iso-8601'}, 'meta_type': {'key': 'metaType', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, domain=None, mail_address=None, principal_name=None, is_deleted_in_origin=None, metadata_update_date=None, meta_type=None): super(GraphUser, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind, domain=domain, mail_address=mail_address, principal_name=principal_name) self.is_deleted_in_origin = is_deleted_in_origin self.metadata_update_date = metadata_update_date self.meta_type = meta_type class GraphGroup(GraphMember): """GraphGroup. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param legacy_descriptor: [Internal Use Only] The legacy descriptor is here in case you need to access old version IMS using identity descriptor. :type legacy_descriptor: str :param origin: The type of source provider for the origin identifier (ex:AD, AAD, MSA) :type origin: str :param origin_id: The unique identifier from the system of origin. Typically a sid, object id or Guid. Linking and unlinking operations can cause this value to change for a user because the user is not backed by a different provider and has a different unique id in the new provider. :type origin_id: str :param subject_kind: This field identifies the type of the graph subject (ex: Group, Scope, User). :type subject_kind: str :param domain: This represents the name of the container of origin for a graph member. (For MSA this is "Windows Live ID", for AD the name of the domain, for AAD the tenantID of the directory, for VSTS groups the ScopeId, etc) :type domain: str :param mail_address: The email address of record for a given graph member. This may be different than the principal name. :type mail_address: str :param principal_name: This is the PrincipalName of this graph member from the source provider. The source provider may change this field over time and it is not guaranteed to be immutable for the life of the graph member by VSTS. :type principal_name: str :param description: A short phrase to help human readers disambiguate groups with similar names :type description: str :param is_cross_project: :type is_cross_project: bool :param is_deleted: :type is_deleted: bool :param is_global_scope: :type is_global_scope: bool :param is_restricted_visible: :type is_restricted_visible: bool :param local_scope_id: :type local_scope_id: str :param scope_id: :type scope_id: str :param scope_name: :type scope_name: str :param scope_type: :type scope_type: str :param securing_host_id: :type securing_host_id: str :param special_type: :type special_type: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'legacy_descriptor': {'key': 'legacyDescriptor', 'type': 'str'}, 'origin': {'key': 'origin', 'type': 'str'}, 'origin_id': {'key': 'originId', 'type': 'str'}, 'subject_kind': {'key': 'subjectKind', 'type': 'str'}, 'domain': {'key': 'domain', 'type': 'str'}, 'mail_address': {'key': 'mailAddress', 'type': 'str'}, 'principal_name': {'key': 'principalName', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'is_cross_project': {'key': 'isCrossProject', 'type': 'bool'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'is_global_scope': {'key': 'isGlobalScope', 'type': 'bool'}, 'is_restricted_visible': {'key': 'isRestrictedVisible', 'type': 'bool'}, 'local_scope_id': {'key': 'localScopeId', 'type': 'str'}, 'scope_id': {'key': 'scopeId', 'type': 'str'}, 'scope_name': {'key': 'scopeName', 'type': 'str'}, 'scope_type': {'key': 'scopeType', 'type': 'str'}, 'securing_host_id': {'key': 'securingHostId', 'type': 'str'}, 'special_type': {'key': 'specialType', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, legacy_descriptor=None, origin=None, origin_id=None, subject_kind=None, domain=None, mail_address=None, principal_name=None, description=None, is_cross_project=None, is_deleted=None, is_global_scope=None, is_restricted_visible=None, local_scope_id=None, scope_id=None, scope_name=None, scope_type=None, securing_host_id=None, special_type=None): super(GraphGroup, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, legacy_descriptor=legacy_descriptor, origin=origin, origin_id=origin_id, subject_kind=subject_kind, domain=domain, mail_address=mail_address, principal_name=principal_name) self.description = description self.is_cross_project = is_cross_project self.is_deleted = is_deleted self.is_global_scope = is_global_scope self.is_restricted_visible = is_restricted_visible self.local_scope_id = local_scope_id self.scope_id = scope_id self.scope_name = scope_name self.scope_type = scope_type self.securing_host_id = securing_host_id self.special_type = special_type __all__ = [ 'AccessLevel', 'BaseOperationResult', 'Extension', 'GraphSubjectBase', 'Group', 'GroupEntitlement', 'GroupOperationResult', 'GroupOption', 'JsonPatchOperation', 'MemberEntitlementsResponseBase', 'OperationReference', 'OperationResult', 'PagedList', 'ProjectEntitlement', 'ProjectRef', 'ReferenceLinks', 'SummaryData', 'TeamRef', 'UserEntitlement', 'UserEntitlementOperationReference', 'UserEntitlementOperationResult', 'UserEntitlementsResponseBase', 'UsersSummary', 'ExtensionSummaryData', 'GraphSubject', 'GroupEntitlementOperationReference', 'LicenseSummaryData', 'MemberEntitlement', 'MemberEntitlementOperationReference', 'MemberEntitlementsPatchResponse', 'MemberEntitlementsPostResponse', 'PagedGraphMemberList', 'UserEntitlementsPatchResponse', 'UserEntitlementsPostResponse', 'GraphMember', 'GraphUser', 'GraphGroup', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/notification/000077500000000000000000000000001360605530400315435ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/notification/__init__.py000066400000000000000000000050641360605530400336610ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .notification_client import NotificationClient __all__ = [ 'ArtifactFilter', 'BaseSubscriptionFilter', 'BatchNotificationOperation', 'EventActor', 'EventScope', 'EventsEvaluationResult', 'EventTransformRequest', 'EventTransformResult', 'ExpressionFilterClause', 'ExpressionFilterGroup', 'ExpressionFilterModel', 'FieldInputValues', 'FieldValuesQuery', 'GraphSubjectBase', 'IdentityRef', 'INotificationDiagnosticLog', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'ISubscriptionChannel', 'ISubscriptionFilter', 'NotificationAdminSettings', 'NotificationAdminSettingsUpdateParameters', 'NotificationDiagnosticLogMessage', 'NotificationEventField', 'NotificationEventFieldOperator', 'NotificationEventFieldType', 'NotificationEventPublisher', 'NotificationEventRole', 'NotificationEventType', 'NotificationEventTypeCategory', 'NotificationQueryCondition', 'NotificationReason', 'NotificationsEvaluationResult', 'NotificationStatistic', 'NotificationStatisticsQuery', 'NotificationStatisticsQueryConditions', 'NotificationSubscriber', 'NotificationSubscriberUpdateParameters', 'NotificationSubscription', 'NotificationSubscriptionCreateParameters', 'NotificationSubscriptionTemplate', 'NotificationSubscriptionUpdateParameters', 'OperatorConstraint', 'ReferenceLinks', 'SubscriptionAdminSettings', 'SubscriptionChannelWithAddress', 'SubscriptionDiagnostics', 'SubscriptionEvaluationRequest', 'SubscriptionEvaluationResult', 'SubscriptionEvaluationSettings', 'SubscriptionManagement', 'SubscriptionQuery', 'SubscriptionQueryCondition', 'SubscriptionScope', 'SubscriptionTracing', 'SubscriptionUserSettings', 'UpdateSubscripitonDiagnosticsParameters', 'UpdateSubscripitonTracingParameters', 'ValueDefinition', 'VssNotificationEvent', 'NotificationClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/notification/models.py000066400000000000000000002141751360605530400334120ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class BaseSubscriptionFilter(Model): """BaseSubscriptionFilter. :param event_type: :type event_type: str :param type: :type type: str """ _attribute_map = { 'event_type': {'key': 'eventType', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, event_type=None, type=None): super(BaseSubscriptionFilter, self).__init__() self.event_type = event_type self.type = type class BatchNotificationOperation(Model): """BatchNotificationOperation. :param notification_operation: :type notification_operation: object :param notification_query_conditions: :type notification_query_conditions: list of :class:`NotificationQueryCondition ` """ _attribute_map = { 'notification_operation': {'key': 'notificationOperation', 'type': 'object'}, 'notification_query_conditions': {'key': 'notificationQueryConditions', 'type': '[NotificationQueryCondition]'} } def __init__(self, notification_operation=None, notification_query_conditions=None): super(BatchNotificationOperation, self).__init__() self.notification_operation = notification_operation self.notification_query_conditions = notification_query_conditions class EventActor(Model): """EventActor. :param id: Required: This is the identity of the user for the specified role. :type id: str :param role: Required: The event specific name of a role. :type role: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'role': {'key': 'role', 'type': 'str'} } def __init__(self, id=None, role=None): super(EventActor, self).__init__() self.id = id self.role = role class EventScope(Model): """EventScope. :param id: Required: This is the identity of the scope for the type. :type id: str :param name: Optional: The display name of the scope :type name: str :param type: Required: The event specific type of a scope. :type type: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, id=None, name=None, type=None): super(EventScope, self).__init__() self.id = id self.name = name self.type = type class EventsEvaluationResult(Model): """EventsEvaluationResult. :param count: Count of events evaluated. :type count: int :param matched_count: Count of matched events. :type matched_count: int """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'matched_count': {'key': 'matchedCount', 'type': 'int'} } def __init__(self, count=None, matched_count=None): super(EventsEvaluationResult, self).__init__() self.count = count self.matched_count = matched_count class EventTransformRequest(Model): """EventTransformRequest. :param event_payload: Event payload. :type event_payload: str :param event_type: Event type. :type event_type: str :param system_inputs: System inputs. :type system_inputs: dict """ _attribute_map = { 'event_payload': {'key': 'eventPayload', 'type': 'str'}, 'event_type': {'key': 'eventType', 'type': 'str'}, 'system_inputs': {'key': 'systemInputs', 'type': '{str}'} } def __init__(self, event_payload=None, event_type=None, system_inputs=None): super(EventTransformRequest, self).__init__() self.event_payload = event_payload self.event_type = event_type self.system_inputs = system_inputs class EventTransformResult(Model): """EventTransformResult. :param content: Transformed html content. :type content: str :param data: Calculated data. :type data: object :param system_inputs: Calculated system inputs. :type system_inputs: dict """ _attribute_map = { 'content': {'key': 'content', 'type': 'str'}, 'data': {'key': 'data', 'type': 'object'}, 'system_inputs': {'key': 'systemInputs', 'type': '{str}'} } def __init__(self, content=None, data=None, system_inputs=None): super(EventTransformResult, self).__init__() self.content = content self.data = data self.system_inputs = system_inputs class ExpressionFilterClause(Model): """ExpressionFilterClause. :param field_name: :type field_name: str :param index: The order in which this clause appeared in the filter query :type index: int :param logical_operator: Logical Operator 'AND', 'OR' or NULL (only for the first clause in the filter) :type logical_operator: str :param operator: :type operator: str :param value: :type value: str """ _attribute_map = { 'field_name': {'key': 'fieldName', 'type': 'str'}, 'index': {'key': 'index', 'type': 'int'}, 'logical_operator': {'key': 'logicalOperator', 'type': 'str'}, 'operator': {'key': 'operator', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, field_name=None, index=None, logical_operator=None, operator=None, value=None): super(ExpressionFilterClause, self).__init__() self.field_name = field_name self.index = index self.logical_operator = logical_operator self.operator = operator self.value = value class ExpressionFilterGroup(Model): """ExpressionFilterGroup. :param end: The index of the last FilterClause in this group :type end: int :param level: Level of the group, since groups can be nested for each nested group the level will increase by 1 :type level: int :param start: The index of the first FilterClause in this group :type start: int """ _attribute_map = { 'end': {'key': 'end', 'type': 'int'}, 'level': {'key': 'level', 'type': 'int'}, 'start': {'key': 'start', 'type': 'int'} } def __init__(self, end=None, level=None, start=None): super(ExpressionFilterGroup, self).__init__() self.end = end self.level = level self.start = start class ExpressionFilterModel(Model): """ExpressionFilterModel. :param clauses: Flat list of clauses in this subscription :type clauses: list of :class:`ExpressionFilterClause ` :param groups: Grouping of clauses in the subscription :type groups: list of :class:`ExpressionFilterGroup ` :param max_group_level: Max depth of the Subscription tree :type max_group_level: int """ _attribute_map = { 'clauses': {'key': 'clauses', 'type': '[ExpressionFilterClause]'}, 'groups': {'key': 'groups', 'type': '[ExpressionFilterGroup]'}, 'max_group_level': {'key': 'maxGroupLevel', 'type': 'int'} } def __init__(self, clauses=None, groups=None, max_group_level=None): super(ExpressionFilterModel, self).__init__() self.clauses = clauses self.groups = groups self.max_group_level = max_group_level class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class INotificationDiagnosticLog(Model): """INotificationDiagnosticLog. :param activity_id: :type activity_id: str :param description: :type description: str :param end_time: :type end_time: datetime :param id: :type id: str :param log_type: :type log_type: str :param messages: :type messages: list of :class:`NotificationDiagnosticLogMessage ` :param properties: :type properties: dict :param source: :type source: str :param start_time: :type start_time: datetime """ _attribute_map = { 'activity_id': {'key': 'activityId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'end_time': {'key': 'endTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'log_type': {'key': 'logType', 'type': 'str'}, 'messages': {'key': 'messages', 'type': '[NotificationDiagnosticLogMessage]'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'source': {'key': 'source', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'} } def __init__(self, activity_id=None, description=None, end_time=None, id=None, log_type=None, messages=None, properties=None, source=None, start_time=None): super(INotificationDiagnosticLog, self).__init__() self.activity_id = activity_id self.description = description self.end_time = end_time self.id = id self.log_type = log_type self.messages = messages self.properties = properties self.source = source self.start_time = start_time class InputValue(Model): """InputValue. :param data: Any other data about this input :type data: dict :param display_value: The text to show for the display of this value :type display_value: str :param value: The value to store for this input :type value: str """ _attribute_map = { 'data': {'key': 'data', 'type': '{object}'}, 'display_value': {'key': 'displayValue', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, data=None, display_value=None, value=None): super(InputValue, self).__init__() self.data = data self.display_value = display_value self.value = value class InputValues(Model): """InputValues. :param default_value: The default value to use for this input :type default_value: str :param error: Errors encountered while computing dynamic values. :type error: :class:`InputValuesError ` :param input_id: The id of the input :type input_id: str :param is_disabled: Should this input be disabled :type is_disabled: bool :param is_limited_to_possible_values: Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) :type is_limited_to_possible_values: bool :param is_read_only: Should this input be made read-only :type is_read_only: bool :param possible_values: Possible values that this input can take :type possible_values: list of :class:`InputValue ` """ _attribute_map = { 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'error': {'key': 'error', 'type': 'InputValuesError'}, 'input_id': {'key': 'inputId', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'is_limited_to_possible_values': {'key': 'isLimitedToPossibleValues', 'type': 'bool'}, 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, 'possible_values': {'key': 'possibleValues', 'type': '[InputValue]'} } def __init__(self, default_value=None, error=None, input_id=None, is_disabled=None, is_limited_to_possible_values=None, is_read_only=None, possible_values=None): super(InputValues, self).__init__() self.default_value = default_value self.error = error self.input_id = input_id self.is_disabled = is_disabled self.is_limited_to_possible_values = is_limited_to_possible_values self.is_read_only = is_read_only self.possible_values = possible_values class InputValuesError(Model): """InputValuesError. :param message: The error message. :type message: str """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'} } def __init__(self, message=None): super(InputValuesError, self).__init__() self.message = message class InputValuesQuery(Model): """InputValuesQuery. :param current_values: :type current_values: dict :param input_values: The input values to return on input, and the result from the consumer on output. :type input_values: list of :class:`InputValues ` :param resource: Subscription containing information about the publisher/consumer and the current input values :type resource: object """ _attribute_map = { 'current_values': {'key': 'currentValues', 'type': '{str}'}, 'input_values': {'key': 'inputValues', 'type': '[InputValues]'}, 'resource': {'key': 'resource', 'type': 'object'} } def __init__(self, current_values=None, input_values=None, resource=None): super(InputValuesQuery, self).__init__() self.current_values = current_values self.input_values = input_values self.resource = resource class ISubscriptionChannel(Model): """ISubscriptionChannel. :param type: :type type: str """ _attribute_map = { 'type': {'key': 'type', 'type': 'str'} } def __init__(self, type=None): super(ISubscriptionChannel, self).__init__() self.type = type class ISubscriptionFilter(Model): """ISubscriptionFilter. :param event_type: :type event_type: str :param type: :type type: str """ _attribute_map = { 'event_type': {'key': 'eventType', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, event_type=None, type=None): super(ISubscriptionFilter, self).__init__() self.event_type = event_type self.type = type class NotificationAdminSettings(Model): """NotificationAdminSettings. :param default_group_delivery_preference: The default group delivery preference for groups in this collection :type default_group_delivery_preference: object """ _attribute_map = { 'default_group_delivery_preference': {'key': 'defaultGroupDeliveryPreference', 'type': 'object'} } def __init__(self, default_group_delivery_preference=None): super(NotificationAdminSettings, self).__init__() self.default_group_delivery_preference = default_group_delivery_preference class NotificationAdminSettingsUpdateParameters(Model): """NotificationAdminSettingsUpdateParameters. :param default_group_delivery_preference: :type default_group_delivery_preference: object """ _attribute_map = { 'default_group_delivery_preference': {'key': 'defaultGroupDeliveryPreference', 'type': 'object'} } def __init__(self, default_group_delivery_preference=None): super(NotificationAdminSettingsUpdateParameters, self).__init__() self.default_group_delivery_preference = default_group_delivery_preference class NotificationDiagnosticLogMessage(Model): """NotificationDiagnosticLogMessage. :param level: Corresponds to .Net TraceLevel enumeration :type level: int :param message: :type message: str :param time: :type time: object """ _attribute_map = { 'level': {'key': 'level', 'type': 'int'}, 'message': {'key': 'message', 'type': 'str'}, 'time': {'key': 'time', 'type': 'object'} } def __init__(self, level=None, message=None, time=None): super(NotificationDiagnosticLogMessage, self).__init__() self.level = level self.message = message self.time = time class NotificationEventField(Model): """NotificationEventField. :param field_type: Gets or sets the type of this field. :type field_type: :class:`NotificationEventFieldType ` :param id: Gets or sets the unique identifier of this field. :type id: str :param name: Gets or sets the name of this field. :type name: str :param path: Gets or sets the path to the field in the event object. This path can be either Json Path or XPath, depending on if the event will be serialized into Json or XML :type path: str :param supported_scopes: Gets or sets the scopes that this field supports. If not specified then the event type scopes apply. :type supported_scopes: list of str """ _attribute_map = { 'field_type': {'key': 'fieldType', 'type': 'NotificationEventFieldType'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'supported_scopes': {'key': 'supportedScopes', 'type': '[str]'} } def __init__(self, field_type=None, id=None, name=None, path=None, supported_scopes=None): super(NotificationEventField, self).__init__() self.field_type = field_type self.id = id self.name = name self.path = path self.supported_scopes = supported_scopes class NotificationEventFieldOperator(Model): """NotificationEventFieldOperator. :param display_name: Gets or sets the display name of an operator :type display_name: str :param id: Gets or sets the id of an operator :type id: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'} } def __init__(self, display_name=None, id=None): super(NotificationEventFieldOperator, self).__init__() self.display_name = display_name self.id = id class NotificationEventFieldType(Model): """NotificationEventFieldType. :param id: Gets or sets the unique identifier of this field type. :type id: str :param operator_constraints: :type operator_constraints: list of :class:`OperatorConstraint ` :param operators: Gets or sets the list of operators that this type supports. :type operators: list of :class:`NotificationEventFieldOperator ` :param subscription_field_type: :type subscription_field_type: object :param value: Gets or sets the value definition of this field like the getValuesMethod and template to display in the UI :type value: :class:`ValueDefinition ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'operator_constraints': {'key': 'operatorConstraints', 'type': '[OperatorConstraint]'}, 'operators': {'key': 'operators', 'type': '[NotificationEventFieldOperator]'}, 'subscription_field_type': {'key': 'subscriptionFieldType', 'type': 'object'}, 'value': {'key': 'value', 'type': 'ValueDefinition'} } def __init__(self, id=None, operator_constraints=None, operators=None, subscription_field_type=None, value=None): super(NotificationEventFieldType, self).__init__() self.id = id self.operator_constraints = operator_constraints self.operators = operators self.subscription_field_type = subscription_field_type self.value = value class NotificationEventPublisher(Model): """NotificationEventPublisher. :param id: :type id: str :param subscription_management_info: :type subscription_management_info: :class:`SubscriptionManagement ` :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'subscription_management_info': {'key': 'subscriptionManagementInfo', 'type': 'SubscriptionManagement'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, subscription_management_info=None, url=None): super(NotificationEventPublisher, self).__init__() self.id = id self.subscription_management_info = subscription_management_info self.url = url class NotificationEventRole(Model): """NotificationEventRole. :param id: Gets or sets an Id for that role, this id is used by the event. :type id: str :param name: Gets or sets the Name for that role, this name is used for UI display. :type name: str :param supports_groups: Gets or sets whether this role can be a group or just an individual user :type supports_groups: bool """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'supports_groups': {'key': 'supportsGroups', 'type': 'bool'} } def __init__(self, id=None, name=None, supports_groups=None): super(NotificationEventRole, self).__init__() self.id = id self.name = name self.supports_groups = supports_groups class NotificationEventType(Model): """NotificationEventType. :param category: :type category: :class:`NotificationEventTypeCategory ` :param color: Gets or sets the color representing this event type. Example: rgb(128,245,211) or #fafafa :type color: str :param custom_subscriptions_allowed: :type custom_subscriptions_allowed: bool :param event_publisher: :type event_publisher: :class:`NotificationEventPublisher ` :param fields: :type fields: dict :param has_initiator: :type has_initiator: bool :param icon: Gets or sets the icon representing this event type. Can be a URL or a CSS class. Example: css://some-css-class :type icon: str :param id: Gets or sets the unique identifier of this event definition. :type id: str :param name: Gets or sets the name of this event definition. :type name: str :param roles: :type roles: list of :class:`NotificationEventRole ` :param supported_scopes: Gets or sets the scopes that this event type supports :type supported_scopes: list of str :param url: Gets or sets the rest end point to get this event type details (fields, fields types) :type url: str """ _attribute_map = { 'category': {'key': 'category', 'type': 'NotificationEventTypeCategory'}, 'color': {'key': 'color', 'type': 'str'}, 'custom_subscriptions_allowed': {'key': 'customSubscriptionsAllowed', 'type': 'bool'}, 'event_publisher': {'key': 'eventPublisher', 'type': 'NotificationEventPublisher'}, 'fields': {'key': 'fields', 'type': '{NotificationEventField}'}, 'has_initiator': {'key': 'hasInitiator', 'type': 'bool'}, 'icon': {'key': 'icon', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'roles': {'key': 'roles', 'type': '[NotificationEventRole]'}, 'supported_scopes': {'key': 'supportedScopes', 'type': '[str]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, category=None, color=None, custom_subscriptions_allowed=None, event_publisher=None, fields=None, has_initiator=None, icon=None, id=None, name=None, roles=None, supported_scopes=None, url=None): super(NotificationEventType, self).__init__() self.category = category self.color = color self.custom_subscriptions_allowed = custom_subscriptions_allowed self.event_publisher = event_publisher self.fields = fields self.has_initiator = has_initiator self.icon = icon self.id = id self.name = name self.roles = roles self.supported_scopes = supported_scopes self.url = url class NotificationEventTypeCategory(Model): """NotificationEventTypeCategory. :param id: Gets or sets the unique identifier of this category. :type id: str :param name: Gets or sets the friendly name of this category. :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(NotificationEventTypeCategory, self).__init__() self.id = id self.name = name class NotificationQueryCondition(Model): """NotificationQueryCondition. :param event_initiator: :type event_initiator: str :param event_type: :type event_type: str :param subscriber: :type subscriber: str :param subscription_id: :type subscription_id: str """ _attribute_map = { 'event_initiator': {'key': 'eventInitiator', 'type': 'str'}, 'event_type': {'key': 'eventType', 'type': 'str'}, 'subscriber': {'key': 'subscriber', 'type': 'str'}, 'subscription_id': {'key': 'subscriptionId', 'type': 'str'} } def __init__(self, event_initiator=None, event_type=None, subscriber=None, subscription_id=None): super(NotificationQueryCondition, self).__init__() self.event_initiator = event_initiator self.event_type = event_type self.subscriber = subscriber self.subscription_id = subscription_id class NotificationReason(Model): """NotificationReason. :param notification_reason_type: :type notification_reason_type: object :param target_identities: :type target_identities: list of :class:`IdentityRef ` """ _attribute_map = { 'notification_reason_type': {'key': 'notificationReasonType', 'type': 'object'}, 'target_identities': {'key': 'targetIdentities', 'type': '[IdentityRef]'} } def __init__(self, notification_reason_type=None, target_identities=None): super(NotificationReason, self).__init__() self.notification_reason_type = notification_reason_type self.target_identities = target_identities class NotificationsEvaluationResult(Model): """NotificationsEvaluationResult. :param count: Count of generated notifications :type count: int """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'} } def __init__(self, count=None): super(NotificationsEvaluationResult, self).__init__() self.count = count class NotificationStatistic(Model): """NotificationStatistic. :param date: :type date: datetime :param hit_count: :type hit_count: int :param path: :type path: str :param type: :type type: object :param user: :type user: :class:`IdentityRef ` """ _attribute_map = { 'date': {'key': 'date', 'type': 'iso-8601'}, 'hit_count': {'key': 'hitCount', 'type': 'int'}, 'path': {'key': 'path', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'}, 'user': {'key': 'user', 'type': 'IdentityRef'} } def __init__(self, date=None, hit_count=None, path=None, type=None, user=None): super(NotificationStatistic, self).__init__() self.date = date self.hit_count = hit_count self.path = path self.type = type self.user = user class NotificationStatisticsQuery(Model): """NotificationStatisticsQuery. :param conditions: :type conditions: list of :class:`NotificationStatisticsQueryConditions ` """ _attribute_map = { 'conditions': {'key': 'conditions', 'type': '[NotificationStatisticsQueryConditions]'} } def __init__(self, conditions=None): super(NotificationStatisticsQuery, self).__init__() self.conditions = conditions class NotificationStatisticsQueryConditions(Model): """NotificationStatisticsQueryConditions. :param end_date: :type end_date: datetime :param hit_count_minimum: :type hit_count_minimum: int :param path: :type path: str :param start_date: :type start_date: datetime :param type: :type type: object :param user: :type user: :class:`IdentityRef ` """ _attribute_map = { 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, 'hit_count_minimum': {'key': 'hitCountMinimum', 'type': 'int'}, 'path': {'key': 'path', 'type': 'str'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'object'}, 'user': {'key': 'user', 'type': 'IdentityRef'} } def __init__(self, end_date=None, hit_count_minimum=None, path=None, start_date=None, type=None, user=None): super(NotificationStatisticsQueryConditions, self).__init__() self.end_date = end_date self.hit_count_minimum = hit_count_minimum self.path = path self.start_date = start_date self.type = type self.user = user class NotificationSubscriber(Model): """NotificationSubscriber. :param delivery_preference: Indicates how the subscriber should be notified by default. :type delivery_preference: object :param flags: :type flags: object :param id: Identifier of the subscriber. :type id: str :param preferred_email_address: Preferred email address of the subscriber. A null or empty value indicates no preferred email address has been set. :type preferred_email_address: str """ _attribute_map = { 'delivery_preference': {'key': 'deliveryPreference', 'type': 'object'}, 'flags': {'key': 'flags', 'type': 'object'}, 'id': {'key': 'id', 'type': 'str'}, 'preferred_email_address': {'key': 'preferredEmailAddress', 'type': 'str'} } def __init__(self, delivery_preference=None, flags=None, id=None, preferred_email_address=None): super(NotificationSubscriber, self).__init__() self.delivery_preference = delivery_preference self.flags = flags self.id = id self.preferred_email_address = preferred_email_address class NotificationSubscriberUpdateParameters(Model): """NotificationSubscriberUpdateParameters. :param delivery_preference: New delivery preference for the subscriber (indicates how the subscriber should be notified). :type delivery_preference: object :param preferred_email_address: New preferred email address for the subscriber. Specify an empty string to clear the current address. :type preferred_email_address: str """ _attribute_map = { 'delivery_preference': {'key': 'deliveryPreference', 'type': 'object'}, 'preferred_email_address': {'key': 'preferredEmailAddress', 'type': 'str'} } def __init__(self, delivery_preference=None, preferred_email_address=None): super(NotificationSubscriberUpdateParameters, self).__init__() self.delivery_preference = delivery_preference self.preferred_email_address = preferred_email_address class NotificationSubscription(Model): """NotificationSubscription. :param _links: Links to related resources, APIs, and views for the subscription. :type _links: :class:`ReferenceLinks ` :param admin_settings: Admin-managed settings for the subscription. Only applies when the subscriber is a group. :type admin_settings: :class:`SubscriptionAdminSettings ` :param channel: Channel for delivering notifications triggered by the subscription. :type channel: :class:`ISubscriptionChannel ` :param description: Description of the subscription. Typically describes filter criteria which helps identity the subscription. :type description: str :param diagnostics: Diagnostics for this subscription. :type diagnostics: :class:`SubscriptionDiagnostics ` :param extended_properties: Any extra properties like detailed description for different contexts, user/group contexts :type extended_properties: dict :param filter: Matching criteria for the subscription. ExpressionFilter :type filter: :class:`ISubscriptionFilter ` :param flags: Read-only indicators that further describe the subscription. :type flags: object :param id: Subscription identifier. :type id: str :param last_modified_by: User that last modified (or created) the subscription. :type last_modified_by: :class:`IdentityRef ` :param modified_date: Date when the subscription was last modified. If the subscription has not been updated since it was created, this value will indicate when the subscription was created. :type modified_date: datetime :param permissions: The permissions the user have for this subscriptions. :type permissions: object :param scope: The container in which events must be published from in order to be matched by the subscription. If empty, the scope is the current host (typically an account or project collection). For example, a subscription scoped to project A will not produce notifications for events published from project B. :type scope: :class:`SubscriptionScope ` :param status: Status of the subscription. Typically indicates whether the subscription is enabled or not. :type status: object :param status_message: Message that provides more details about the status of the subscription. :type status_message: str :param subscriber: User or group that will receive notifications for events matching the subscription's filter criteria. :type subscriber: :class:`IdentityRef ` :param url: REST API URL of the subscriotion. :type url: str :param user_settings: User-managed settings for the subscription. Only applies when the subscriber is a group. Typically used to indicate whether the calling user is opted in or out of a group subscription. :type user_settings: :class:`SubscriptionUserSettings ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'admin_settings': {'key': 'adminSettings', 'type': 'SubscriptionAdminSettings'}, 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, 'description': {'key': 'description', 'type': 'str'}, 'diagnostics': {'key': 'diagnostics', 'type': 'SubscriptionDiagnostics'}, 'extended_properties': {'key': 'extendedProperties', 'type': '{str}'}, 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, 'flags': {'key': 'flags', 'type': 'object'}, 'id': {'key': 'id', 'type': 'str'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, 'permissions': {'key': 'permissions', 'type': 'object'}, 'scope': {'key': 'scope', 'type': 'SubscriptionScope'}, 'status': {'key': 'status', 'type': 'object'}, 'status_message': {'key': 'statusMessage', 'type': 'str'}, 'subscriber': {'key': 'subscriber', 'type': 'IdentityRef'}, 'url': {'key': 'url', 'type': 'str'}, 'user_settings': {'key': 'userSettings', 'type': 'SubscriptionUserSettings'} } def __init__(self, _links=None, admin_settings=None, channel=None, description=None, diagnostics=None, extended_properties=None, filter=None, flags=None, id=None, last_modified_by=None, modified_date=None, permissions=None, scope=None, status=None, status_message=None, subscriber=None, url=None, user_settings=None): super(NotificationSubscription, self).__init__() self._links = _links self.admin_settings = admin_settings self.channel = channel self.description = description self.diagnostics = diagnostics self.extended_properties = extended_properties self.filter = filter self.flags = flags self.id = id self.last_modified_by = last_modified_by self.modified_date = modified_date self.permissions = permissions self.scope = scope self.status = status self.status_message = status_message self.subscriber = subscriber self.url = url self.user_settings = user_settings class NotificationSubscriptionCreateParameters(Model): """NotificationSubscriptionCreateParameters. :param channel: Channel for delivering notifications triggered by the new subscription. :type channel: :class:`ISubscriptionChannel ` :param description: Brief description for the new subscription. Typically describes filter criteria which helps identity the subscription. :type description: str :param filter: Matching criteria for the new subscription. ExpressionFilter :type filter: :class:`ISubscriptionFilter ` :param scope: The container in which events must be published from in order to be matched by the new subscription. If not specified, defaults to the current host (typically an account or project collection). For example, a subscription scoped to project A will not produce notifications for events published from project B. :type scope: :class:`SubscriptionScope ` :param subscriber: User or group that will receive notifications for events matching the subscription's filter criteria. If not specified, defaults to the calling user. :type subscriber: :class:`IdentityRef ` """ _attribute_map = { 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, 'description': {'key': 'description', 'type': 'str'}, 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, 'scope': {'key': 'scope', 'type': 'SubscriptionScope'}, 'subscriber': {'key': 'subscriber', 'type': 'IdentityRef'} } def __init__(self, channel=None, description=None, filter=None, scope=None, subscriber=None): super(NotificationSubscriptionCreateParameters, self).__init__() self.channel = channel self.description = description self.filter = filter self.scope = scope self.subscriber = subscriber class NotificationSubscriptionTemplate(Model): """NotificationSubscriptionTemplate. :param description: :type description: str :param filter: :type filter: :class:`ISubscriptionFilter ` :param id: :type id: str :param notification_event_information: :type notification_event_information: :class:`NotificationEventType ` :param type: :type type: object """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, 'id': {'key': 'id', 'type': 'str'}, 'notification_event_information': {'key': 'notificationEventInformation', 'type': 'NotificationEventType'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, description=None, filter=None, id=None, notification_event_information=None, type=None): super(NotificationSubscriptionTemplate, self).__init__() self.description = description self.filter = filter self.id = id self.notification_event_information = notification_event_information self.type = type class NotificationSubscriptionUpdateParameters(Model): """NotificationSubscriptionUpdateParameters. :param admin_settings: Admin-managed settings for the subscription. Only applies to subscriptions where the subscriber is a group. :type admin_settings: :class:`SubscriptionAdminSettings ` :param channel: Channel for delivering notifications triggered by the subscription. :type channel: :class:`ISubscriptionChannel ` :param description: Updated description for the subscription. Typically describes filter criteria which helps identity the subscription. :type description: str :param filter: Matching criteria for the subscription. ExpressionFilter :type filter: :class:`ISubscriptionFilter ` :param scope: The container in which events must be published from in order to be matched by the new subscription. If not specified, defaults to the current host (typically the current account or project collection). For example, a subscription scoped to project A will not produce notifications for events published from project B. :type scope: :class:`SubscriptionScope ` :param status: Updated status for the subscription. Typically used to enable or disable a subscription. :type status: object :param status_message: Optional message that provides more details about the updated status. :type status_message: str :param user_settings: User-managed settings for the subscription. Only applies to subscriptions where the subscriber is a group. Typically used to opt-in or opt-out a user from a group subscription. :type user_settings: :class:`SubscriptionUserSettings ` """ _attribute_map = { 'admin_settings': {'key': 'adminSettings', 'type': 'SubscriptionAdminSettings'}, 'channel': {'key': 'channel', 'type': 'ISubscriptionChannel'}, 'description': {'key': 'description', 'type': 'str'}, 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, 'scope': {'key': 'scope', 'type': 'SubscriptionScope'}, 'status': {'key': 'status', 'type': 'object'}, 'status_message': {'key': 'statusMessage', 'type': 'str'}, 'user_settings': {'key': 'userSettings', 'type': 'SubscriptionUserSettings'} } def __init__(self, admin_settings=None, channel=None, description=None, filter=None, scope=None, status=None, status_message=None, user_settings=None): super(NotificationSubscriptionUpdateParameters, self).__init__() self.admin_settings = admin_settings self.channel = channel self.description = description self.filter = filter self.scope = scope self.status = status self.status_message = status_message self.user_settings = user_settings class OperatorConstraint(Model): """OperatorConstraint. :param operator: :type operator: str :param supported_scopes: Gets or sets the list of scopes that this type supports. :type supported_scopes: list of str """ _attribute_map = { 'operator': {'key': 'operator', 'type': 'str'}, 'supported_scopes': {'key': 'supportedScopes', 'type': '[str]'} } def __init__(self, operator=None, supported_scopes=None): super(OperatorConstraint, self).__init__() self.operator = operator self.supported_scopes = supported_scopes class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class SubscriptionAdminSettings(Model): """SubscriptionAdminSettings. :param block_user_opt_out: If true, members of the group subscribed to the associated subscription cannot opt (choose not to get notified) :type block_user_opt_out: bool """ _attribute_map = { 'block_user_opt_out': {'key': 'blockUserOptOut', 'type': 'bool'} } def __init__(self, block_user_opt_out=None): super(SubscriptionAdminSettings, self).__init__() self.block_user_opt_out = block_user_opt_out class SubscriptionChannelWithAddress(Model): """SubscriptionChannelWithAddress. :param address: :type address: str :param type: :type type: str :param use_custom_address: :type use_custom_address: bool """ _attribute_map = { 'address': {'key': 'address', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'use_custom_address': {'key': 'useCustomAddress', 'type': 'bool'} } def __init__(self, address=None, type=None, use_custom_address=None): super(SubscriptionChannelWithAddress, self).__init__() self.address = address self.type = type self.use_custom_address = use_custom_address class SubscriptionDiagnostics(Model): """SubscriptionDiagnostics. :param delivery_results: :type delivery_results: :class:`SubscriptionTracing ` :param delivery_tracing: :type delivery_tracing: :class:`SubscriptionTracing ` :param evaluation_tracing: :type evaluation_tracing: :class:`SubscriptionTracing ` """ _attribute_map = { 'delivery_results': {'key': 'deliveryResults', 'type': 'SubscriptionTracing'}, 'delivery_tracing': {'key': 'deliveryTracing', 'type': 'SubscriptionTracing'}, 'evaluation_tracing': {'key': 'evaluationTracing', 'type': 'SubscriptionTracing'} } def __init__(self, delivery_results=None, delivery_tracing=None, evaluation_tracing=None): super(SubscriptionDiagnostics, self).__init__() self.delivery_results = delivery_results self.delivery_tracing = delivery_tracing self.evaluation_tracing = evaluation_tracing class SubscriptionEvaluationRequest(Model): """SubscriptionEvaluationRequest. :param min_events_created_date: The min created date for the events used for matching in UTC. Use all events created since this date :type min_events_created_date: datetime :param subscription_create_parameters: User or group that will receive notifications for events matching the subscription's filter criteria. If not specified, defaults to the calling user. :type subscription_create_parameters: :class:`NotificationSubscriptionCreateParameters ` """ _attribute_map = { 'min_events_created_date': {'key': 'minEventsCreatedDate', 'type': 'iso-8601'}, 'subscription_create_parameters': {'key': 'subscriptionCreateParameters', 'type': 'NotificationSubscriptionCreateParameters'} } def __init__(self, min_events_created_date=None, subscription_create_parameters=None): super(SubscriptionEvaluationRequest, self).__init__() self.min_events_created_date = min_events_created_date self.subscription_create_parameters = subscription_create_parameters class SubscriptionEvaluationResult(Model): """SubscriptionEvaluationResult. :param evaluation_job_status: Subscription evaluation job status :type evaluation_job_status: object :param events: Subscription evaluation events results. :type events: :class:`EventsEvaluationResult ` :param id: The requestId which is the subscription evaluation jobId :type id: str :param notifications: Subscription evaluation notification results. :type notifications: :class:`NotificationsEvaluationResult ` """ _attribute_map = { 'evaluation_job_status': {'key': 'evaluationJobStatus', 'type': 'object'}, 'events': {'key': 'events', 'type': 'EventsEvaluationResult'}, 'id': {'key': 'id', 'type': 'str'}, 'notifications': {'key': 'notifications', 'type': 'NotificationsEvaluationResult'} } def __init__(self, evaluation_job_status=None, events=None, id=None, notifications=None): super(SubscriptionEvaluationResult, self).__init__() self.evaluation_job_status = evaluation_job_status self.events = events self.id = id self.notifications = notifications class SubscriptionEvaluationSettings(Model): """SubscriptionEvaluationSettings. :param enabled: Indicates whether subscription evaluation before saving is enabled or not :type enabled: bool :param interval: Time interval to check on subscription evaluation job in seconds :type interval: int :param threshold: Threshold on the number of notifications for considering a subscription too noisy :type threshold: int :param time_out: Time out for the subscription evaluation check in seconds :type time_out: int """ _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'interval': {'key': 'interval', 'type': 'int'}, 'threshold': {'key': 'threshold', 'type': 'int'}, 'time_out': {'key': 'timeOut', 'type': 'int'} } def __init__(self, enabled=None, interval=None, threshold=None, time_out=None): super(SubscriptionEvaluationSettings, self).__init__() self.enabled = enabled self.interval = interval self.threshold = threshold self.time_out = time_out class SubscriptionManagement(Model): """SubscriptionManagement. :param service_instance_type: :type service_instance_type: str :param url: :type url: str """ _attribute_map = { 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, service_instance_type=None, url=None): super(SubscriptionManagement, self).__init__() self.service_instance_type = service_instance_type self.url = url class SubscriptionQuery(Model): """SubscriptionQuery. :param conditions: One or more conditions to query on. If more than 2 conditions are specified, the combined results of each condition is returned (i.e. conditions are logically OR'ed). :type conditions: list of :class:`SubscriptionQueryCondition ` :param query_flags: Flags the refine the types of subscriptions that will be returned from the query. :type query_flags: object """ _attribute_map = { 'conditions': {'key': 'conditions', 'type': '[SubscriptionQueryCondition]'}, 'query_flags': {'key': 'queryFlags', 'type': 'object'} } def __init__(self, conditions=None, query_flags=None): super(SubscriptionQuery, self).__init__() self.conditions = conditions self.query_flags = query_flags class SubscriptionQueryCondition(Model): """SubscriptionQueryCondition. :param filter: Filter conditions that matching subscriptions must have. Typically only the filter's type and event type are used for matching. :type filter: :class:`ISubscriptionFilter ` :param flags: Flags to specify the the type subscriptions to query for. :type flags: object :param scope: Scope that matching subscriptions must have. :type scope: str :param subscriber_id: ID of the subscriber (user or group) that matching subscriptions must be subscribed to. :type subscriber_id: str :param subscription_id: ID of the subscription to query for. :type subscription_id: str """ _attribute_map = { 'filter': {'key': 'filter', 'type': 'ISubscriptionFilter'}, 'flags': {'key': 'flags', 'type': 'object'}, 'scope': {'key': 'scope', 'type': 'str'}, 'subscriber_id': {'key': 'subscriberId', 'type': 'str'}, 'subscription_id': {'key': 'subscriptionId', 'type': 'str'} } def __init__(self, filter=None, flags=None, scope=None, subscriber_id=None, subscription_id=None): super(SubscriptionQueryCondition, self).__init__() self.filter = filter self.flags = flags self.scope = scope self.subscriber_id = subscriber_id self.subscription_id = subscription_id class SubscriptionScope(EventScope): """SubscriptionScope. :param id: Required: This is the identity of the scope for the type. :type id: str :param name: Optional: The display name of the scope :type name: str :param type: Required: The event specific type of a scope. :type type: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, } def __init__(self, id=None, name=None, type=None): super(SubscriptionScope, self).__init__(id=id, name=name, type=type) class SubscriptionTracing(Model): """SubscriptionTracing. :param enabled: :type enabled: bool :param end_date: Trace until the specified end date. :type end_date: datetime :param max_traced_entries: The maximum number of result details to trace. :type max_traced_entries: int :param start_date: The date and time tracing started. :type start_date: datetime :param traced_entries: Trace until remaining count reaches 0. :type traced_entries: int """ _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, 'max_traced_entries': {'key': 'maxTracedEntries', 'type': 'int'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'traced_entries': {'key': 'tracedEntries', 'type': 'int'} } def __init__(self, enabled=None, end_date=None, max_traced_entries=None, start_date=None, traced_entries=None): super(SubscriptionTracing, self).__init__() self.enabled = enabled self.end_date = end_date self.max_traced_entries = max_traced_entries self.start_date = start_date self.traced_entries = traced_entries class SubscriptionUserSettings(Model): """SubscriptionUserSettings. :param opted_out: Indicates whether the user will receive notifications for the associated group subscription. :type opted_out: bool """ _attribute_map = { 'opted_out': {'key': 'optedOut', 'type': 'bool'} } def __init__(self, opted_out=None): super(SubscriptionUserSettings, self).__init__() self.opted_out = opted_out class UpdateSubscripitonDiagnosticsParameters(Model): """UpdateSubscripitonDiagnosticsParameters. :param delivery_results: :type delivery_results: :class:`UpdateSubscripitonTracingParameters ` :param delivery_tracing: :type delivery_tracing: :class:`UpdateSubscripitonTracingParameters ` :param evaluation_tracing: :type evaluation_tracing: :class:`UpdateSubscripitonTracingParameters ` """ _attribute_map = { 'delivery_results': {'key': 'deliveryResults', 'type': 'UpdateSubscripitonTracingParameters'}, 'delivery_tracing': {'key': 'deliveryTracing', 'type': 'UpdateSubscripitonTracingParameters'}, 'evaluation_tracing': {'key': 'evaluationTracing', 'type': 'UpdateSubscripitonTracingParameters'} } def __init__(self, delivery_results=None, delivery_tracing=None, evaluation_tracing=None): super(UpdateSubscripitonDiagnosticsParameters, self).__init__() self.delivery_results = delivery_results self.delivery_tracing = delivery_tracing self.evaluation_tracing = evaluation_tracing class UpdateSubscripitonTracingParameters(Model): """UpdateSubscripitonTracingParameters. :param enabled: :type enabled: bool """ _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'} } def __init__(self, enabled=None): super(UpdateSubscripitonTracingParameters, self).__init__() self.enabled = enabled class ValueDefinition(Model): """ValueDefinition. :param data_source: Gets or sets the data source. :type data_source: list of :class:`InputValue ` :param end_point: Gets or sets the rest end point. :type end_point: str :param result_template: Gets or sets the result template. :type result_template: str """ _attribute_map = { 'data_source': {'key': 'dataSource', 'type': '[InputValue]'}, 'end_point': {'key': 'endPoint', 'type': 'str'}, 'result_template': {'key': 'resultTemplate', 'type': 'str'} } def __init__(self, data_source=None, end_point=None, result_template=None): super(ValueDefinition, self).__init__() self.data_source = data_source self.end_point = end_point self.result_template = result_template class VssNotificationEvent(Model): """VssNotificationEvent. :param actors: Optional: A list of actors which are additional identities with corresponding roles that are relevant to the event. :type actors: list of :class:`EventActor ` :param artifact_uris: Optional: A list of artifacts referenced or impacted by this event. :type artifact_uris: list of str :param data: Required: The event payload. If Data is a string, it must be in Json or XML format. Otherwise it must have a serialization format attribute. :type data: object :param event_type: Required: The name of the event. This event must be registered in the context it is being fired. :type event_type: str :param expires_in: How long before the event expires and will be cleaned up. The default is to use the system default. :type expires_in: object :param item_id: The id of the item, artifact, extension, project, etc. :type item_id: str :param process_delay: How long to wait before processing this event. The default is to process immediately. :type process_delay: object :param scopes: Optional: A list of scopes which are are relevant to the event. :type scopes: list of :class:`EventScope ` :param source_event_created_time: This is the time the original source event for this VssNotificationEvent was created. For example, for something like a build completion notification SourceEventCreatedTime should be the time the build finished not the time this event was raised. :type source_event_created_time: datetime """ _attribute_map = { 'actors': {'key': 'actors', 'type': '[EventActor]'}, 'artifact_uris': {'key': 'artifactUris', 'type': '[str]'}, 'data': {'key': 'data', 'type': 'object'}, 'event_type': {'key': 'eventType', 'type': 'str'}, 'expires_in': {'key': 'expiresIn', 'type': 'object'}, 'item_id': {'key': 'itemId', 'type': 'str'}, 'process_delay': {'key': 'processDelay', 'type': 'object'}, 'scopes': {'key': 'scopes', 'type': '[EventScope]'}, 'source_event_created_time': {'key': 'sourceEventCreatedTime', 'type': 'iso-8601'} } def __init__(self, actors=None, artifact_uris=None, data=None, event_type=None, expires_in=None, item_id=None, process_delay=None, scopes=None, source_event_created_time=None): super(VssNotificationEvent, self).__init__() self.actors = actors self.artifact_uris = artifact_uris self.data = data self.event_type = event_type self.expires_in = expires_in self.item_id = item_id self.process_delay = process_delay self.scopes = scopes self.source_event_created_time = source_event_created_time class ArtifactFilter(BaseSubscriptionFilter): """ArtifactFilter. :param event_type: :type event_type: str :param artifact_id: :type artifact_id: str :param artifact_type: :type artifact_type: str :param artifact_uri: :type artifact_uri: str :param type: :type type: str """ _attribute_map = { 'event_type': {'key': 'eventType', 'type': 'str'}, 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'artifact_type': {'key': 'artifactType', 'type': 'str'}, 'artifact_uri': {'key': 'artifactUri', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, event_type=None, artifact_id=None, artifact_type=None, artifact_uri=None, type=None): super(ArtifactFilter, self).__init__(event_type=event_type) self.artifact_id = artifact_id self.artifact_type = artifact_type self.artifact_uri = artifact_uri self.type = type class FieldInputValues(InputValues): """FieldInputValues. :param default_value: The default value to use for this input :type default_value: str :param error: Errors encountered while computing dynamic values. :type error: :class:`InputValuesError ` :param input_id: The id of the input :type input_id: str :param is_disabled: Should this input be disabled :type is_disabled: bool :param is_limited_to_possible_values: Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) :type is_limited_to_possible_values: bool :param is_read_only: Should this input be made read-only :type is_read_only: bool :param possible_values: Possible values that this input can take :type possible_values: list of :class:`InputValue ` :param operators: :type operators: str """ _attribute_map = { 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'error': {'key': 'error', 'type': 'InputValuesError'}, 'input_id': {'key': 'inputId', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'is_limited_to_possible_values': {'key': 'isLimitedToPossibleValues', 'type': 'bool'}, 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, 'possible_values': {'key': 'possibleValues', 'type': '[InputValue]'}, 'operators': {'key': 'operators', 'type': 'str'} } def __init__(self, default_value=None, error=None, input_id=None, is_disabled=None, is_limited_to_possible_values=None, is_read_only=None, possible_values=None, operators=None): super(FieldInputValues, self).__init__(default_value=default_value, error=error, input_id=input_id, is_disabled=is_disabled, is_limited_to_possible_values=is_limited_to_possible_values, is_read_only=is_read_only, possible_values=possible_values) self.operators = operators class FieldValuesQuery(InputValuesQuery): """FieldValuesQuery. :param current_values: :type current_values: dict :param resource: Subscription containing information about the publisher/consumer and the current input values :type resource: object :param input_values: :type input_values: list of :class:`FieldInputValues ` :param scope: :type scope: str """ _attribute_map = { 'current_values': {'key': 'currentValues', 'type': '{str}'}, 'resource': {'key': 'resource', 'type': 'object'}, 'input_values': {'key': 'inputValues', 'type': '[FieldInputValues]'}, 'scope': {'key': 'scope', 'type': 'str'} } def __init__(self, current_values=None, resource=None, input_values=None, scope=None): super(FieldValuesQuery, self).__init__(current_values=current_values, resource=resource) self.input_values = input_values self.scope = scope __all__ = [ 'BaseSubscriptionFilter', 'BatchNotificationOperation', 'EventActor', 'EventScope', 'EventsEvaluationResult', 'EventTransformRequest', 'EventTransformResult', 'ExpressionFilterClause', 'ExpressionFilterGroup', 'ExpressionFilterModel', 'GraphSubjectBase', 'IdentityRef', 'INotificationDiagnosticLog', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'ISubscriptionChannel', 'ISubscriptionFilter', 'NotificationAdminSettings', 'NotificationAdminSettingsUpdateParameters', 'NotificationDiagnosticLogMessage', 'NotificationEventField', 'NotificationEventFieldOperator', 'NotificationEventFieldType', 'NotificationEventPublisher', 'NotificationEventRole', 'NotificationEventType', 'NotificationEventTypeCategory', 'NotificationQueryCondition', 'NotificationReason', 'NotificationsEvaluationResult', 'NotificationStatistic', 'NotificationStatisticsQuery', 'NotificationStatisticsQueryConditions', 'NotificationSubscriber', 'NotificationSubscriberUpdateParameters', 'NotificationSubscription', 'NotificationSubscriptionCreateParameters', 'NotificationSubscriptionTemplate', 'NotificationSubscriptionUpdateParameters', 'OperatorConstraint', 'ReferenceLinks', 'SubscriptionAdminSettings', 'SubscriptionChannelWithAddress', 'SubscriptionDiagnostics', 'SubscriptionEvaluationRequest', 'SubscriptionEvaluationResult', 'SubscriptionEvaluationSettings', 'SubscriptionManagement', 'SubscriptionQuery', 'SubscriptionQueryCondition', 'SubscriptionScope', 'SubscriptionTracing', 'SubscriptionUserSettings', 'UpdateSubscripitonDiagnosticsParameters', 'UpdateSubscripitonTracingParameters', 'ValueDefinition', 'VssNotificationEvent', 'ArtifactFilter', 'FieldInputValues', 'FieldValuesQuery', ] notification_client.py000066400000000000000000000421571360605530400360730ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/notification# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class NotificationClient(Client): """Notification :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(NotificationClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def list_logs(self, source, entry_id=None, start_time=None, end_time=None): """ListLogs. [Preview API] List diagnostic logs this service. :param str source: :param str entry_id: :param datetime start_time: :param datetime end_time: :rtype: [INotificationDiagnosticLog] """ route_values = {} if source is not None: route_values['source'] = self._serialize.url('source', source, 'str') if entry_id is not None: route_values['entryId'] = self._serialize.url('entry_id', entry_id, 'str') query_parameters = {} if start_time is not None: query_parameters['startTime'] = self._serialize.query('start_time', start_time, 'iso-8601') if end_time is not None: query_parameters['endTime'] = self._serialize.query('end_time', end_time, 'iso-8601') response = self._send(http_method='GET', location_id='991842f3-eb16-4aea-ac81-81353ef2b75c', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[INotificationDiagnosticLog]', self._unwrap_collection(response)) def get_subscription_diagnostics(self, subscription_id): """GetSubscriptionDiagnostics. [Preview API] :param str subscription_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') response = self._send(http_method='GET', location_id='20f1929d-4be7-4c2e-a74e-d47640ff3418', version='5.0-preview.1', route_values=route_values) return self._deserialize('SubscriptionDiagnostics', response) def update_subscription_diagnostics(self, update_parameters, subscription_id): """UpdateSubscriptionDiagnostics. [Preview API] :param :class:` ` update_parameters: :param str subscription_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') content = self._serialize.body(update_parameters, 'UpdateSubscripitonDiagnosticsParameters') response = self._send(http_method='PUT', location_id='20f1929d-4be7-4c2e-a74e-d47640ff3418', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('SubscriptionDiagnostics', response) def publish_event(self, notification_event): """PublishEvent. [Preview API] Publish an event. :param :class:` ` notification_event: :rtype: :class:` ` """ content = self._serialize.body(notification_event, 'VssNotificationEvent') response = self._send(http_method='POST', location_id='14c57b7a-c0e6-4555-9f51-e067188fdd8e', version='5.0-preview.1', content=content) return self._deserialize('VssNotificationEvent', response) def get_event_type(self, event_type): """GetEventType. [Preview API] Get a specific event type. :param str event_type: :rtype: :class:` ` """ route_values = {} if event_type is not None: route_values['eventType'] = self._serialize.url('event_type', event_type, 'str') response = self._send(http_method='GET', location_id='cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21', version='5.0-preview.1', route_values=route_values) return self._deserialize('NotificationEventType', response) def list_event_types(self, publisher_id=None): """ListEventTypes. [Preview API] List available event types for this service. Optionally filter by only event types for the specified publisher. :param str publisher_id: Limit to event types for this publisher :rtype: [NotificationEventType] """ query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='cc84fb5f-6247-4c7a-aeae-e5a3c3fddb21', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[NotificationEventType]', self._unwrap_collection(response)) def get_settings(self): """GetSettings. [Preview API] :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='cbe076d8-2803-45ff-8d8d-44653686ea2a', version='5.0-preview.1') return self._deserialize('NotificationAdminSettings', response) def update_settings(self, update_parameters): """UpdateSettings. [Preview API] :param :class:` ` update_parameters: :rtype: :class:` ` """ content = self._serialize.body(update_parameters, 'NotificationAdminSettingsUpdateParameters') response = self._send(http_method='PATCH', location_id='cbe076d8-2803-45ff-8d8d-44653686ea2a', version='5.0-preview.1', content=content) return self._deserialize('NotificationAdminSettings', response) def get_subscriber(self, subscriber_id): """GetSubscriber. [Preview API] :param str subscriber_id: :rtype: :class:` ` """ route_values = {} if subscriber_id is not None: route_values['subscriberId'] = self._serialize.url('subscriber_id', subscriber_id, 'str') response = self._send(http_method='GET', location_id='4d5caff1-25ba-430b-b808-7a1f352cc197', version='5.0-preview.1', route_values=route_values) return self._deserialize('NotificationSubscriber', response) def update_subscriber(self, update_parameters, subscriber_id): """UpdateSubscriber. [Preview API] :param :class:` ` update_parameters: :param str subscriber_id: :rtype: :class:` ` """ route_values = {} if subscriber_id is not None: route_values['subscriberId'] = self._serialize.url('subscriber_id', subscriber_id, 'str') content = self._serialize.body(update_parameters, 'NotificationSubscriberUpdateParameters') response = self._send(http_method='PATCH', location_id='4d5caff1-25ba-430b-b808-7a1f352cc197', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('NotificationSubscriber', response) def query_subscriptions(self, subscription_query): """QuerySubscriptions. [Preview API] Query for subscriptions. A subscription is returned if it matches one or more of the specified conditions. :param :class:` ` subscription_query: :rtype: [NotificationSubscription] """ content = self._serialize.body(subscription_query, 'SubscriptionQuery') response = self._send(http_method='POST', location_id='6864db85-08c0-4006-8e8e-cc1bebe31675', version='5.0-preview.1', content=content) return self._deserialize('[NotificationSubscription]', self._unwrap_collection(response)) def create_subscription(self, create_parameters): """CreateSubscription. [Preview API] Create a new subscription. :param :class:` ` create_parameters: :rtype: :class:` ` """ content = self._serialize.body(create_parameters, 'NotificationSubscriptionCreateParameters') response = self._send(http_method='POST', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.0-preview.1', content=content) return self._deserialize('NotificationSubscription', response) def delete_subscription(self, subscription_id): """DeleteSubscription. [Preview API] Delete a subscription. :param str subscription_id: """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') self._send(http_method='DELETE', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.0-preview.1', route_values=route_values) def get_subscription(self, subscription_id, query_flags=None): """GetSubscription. [Preview API] Get a notification subscription by its ID. :param str subscription_id: :param str query_flags: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') query_parameters = {} if query_flags is not None: query_parameters['queryFlags'] = self._serialize.query('query_flags', query_flags, 'str') response = self._send(http_method='GET', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('NotificationSubscription', response) def list_subscriptions(self, target_id=None, ids=None, query_flags=None): """ListSubscriptions. [Preview API] Get a list of notification subscriptions, either by subscription IDs or by all subscriptions for a given user or group. :param str target_id: User or Group ID :param [str] ids: List of subscription IDs :param str query_flags: :rtype: [NotificationSubscription] """ query_parameters = {} if target_id is not None: query_parameters['targetId'] = self._serialize.query('target_id', target_id, 'str') if ids is not None: ids = ",".join(ids) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') if query_flags is not None: query_parameters['queryFlags'] = self._serialize.query('query_flags', query_flags, 'str') response = self._send(http_method='GET', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[NotificationSubscription]', self._unwrap_collection(response)) def update_subscription(self, update_parameters, subscription_id): """UpdateSubscription. [Preview API] Update an existing subscription. Depending on the type of subscription and permissions, the caller can update the description, filter settings, channel (delivery) settings and more. :param :class:` ` update_parameters: :param str subscription_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') content = self._serialize.body(update_parameters, 'NotificationSubscriptionUpdateParameters') response = self._send(http_method='PATCH', location_id='70f911d6-abac-488c-85b3-a206bf57e165', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('NotificationSubscription', response) def get_subscription_templates(self): """GetSubscriptionTemplates. [Preview API] Get available subscription templates. :rtype: [NotificationSubscriptionTemplate] """ response = self._send(http_method='GET', location_id='fa5d24ba-7484-4f3d-888d-4ec6b1974082', version='5.0-preview.1') return self._deserialize('[NotificationSubscriptionTemplate]', self._unwrap_collection(response)) def update_subscription_user_settings(self, user_settings, subscription_id, user_id): """UpdateSubscriptionUserSettings. [Preview API] Update the specified user's settings for the specified subscription. This API is typically used to opt in or out of a shared subscription. User settings can only be applied to shared subscriptions, like team subscriptions or default subscriptions. :param :class:` ` user_settings: :param str subscription_id: :param str user_id: ID of the user :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') if user_id is not None: route_values['userId'] = self._serialize.url('user_id', user_id, 'str') content = self._serialize.body(user_settings, 'SubscriptionUserSettings') response = self._send(http_method='PUT', location_id='ed5a3dff-aeb5-41b1-b4f7-89e66e58b62e', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('SubscriptionUserSettings', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/npm/000077500000000000000000000000001360605530400276475ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/npm/__init__.py000066400000000000000000000016731360605530400317670ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .npm_client import NpmClient __all__ = [ 'BatchDeprecateData', 'BatchOperationData', 'JsonPatchOperation', 'MinimalPackageDetails', 'NpmPackagesBatchRequest', 'NpmPackageVersionDeletionState', 'NpmRecycleBinPackageVersionDetails', 'Package', 'PackageVersionDetails', 'ReferenceLinks', 'UpstreamSourceInfo', 'NpmClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/npm/models.py000066400000000000000000000216441360605530400315130ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class BatchOperationData(Model): """BatchOperationData. """ _attribute_map = { } def __init__(self): super(BatchOperationData, self).__init__() class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class MinimalPackageDetails(Model): """MinimalPackageDetails. :param id: Package name. :type id: str :param version: Package version. :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, version=None): super(MinimalPackageDetails, self).__init__() self.id = id self.version = version class NpmPackagesBatchRequest(Model): """NpmPackagesBatchRequest. :param data: Data required to perform the operation. This is optional based on type of operation. Use BatchPromoteData if performing a promote operation. :type data: :class:`BatchOperationData ` :param operation: Type of operation that needs to be performed on packages. :type operation: object :param packages: The packages onto which the operation will be performed. :type packages: list of :class:`MinimalPackageDetails ` """ _attribute_map = { 'data': {'key': 'data', 'type': 'BatchOperationData'}, 'operation': {'key': 'operation', 'type': 'object'}, 'packages': {'key': 'packages', 'type': '[MinimalPackageDetails]'} } def __init__(self, data=None, operation=None, packages=None): super(NpmPackagesBatchRequest, self).__init__() self.data = data self.operation = operation self.packages = packages class NpmPackageVersionDeletionState(Model): """NpmPackageVersionDeletionState. :param name: Name of the package. :type name: str :param unpublished_date: UTC date the package was unpublished. :type unpublished_date: datetime :param version: Version of the package. :type version: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'unpublished_date': {'key': 'unpublishedDate', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, name=None, unpublished_date=None, version=None): super(NpmPackageVersionDeletionState, self).__init__() self.name = name self.unpublished_date = unpublished_date self.version = version class NpmRecycleBinPackageVersionDetails(Model): """NpmRecycleBinPackageVersionDetails. :param deleted: Setting to false will undo earlier deletion and restore the package to feed. :type deleted: bool """ _attribute_map = { 'deleted': {'key': 'deleted', 'type': 'bool'} } def __init__(self, deleted=None): super(NpmRecycleBinPackageVersionDetails, self).__init__() self.deleted = deleted class Package(Model): """Package. :param _links: Related REST links. :type _links: :class:`ReferenceLinks ` :param deprecate_message: Deprecated message, if any, for the package. :type deprecate_message: str :param id: Package Id. :type id: str :param name: The display name of the package. :type name: str :param permanently_deleted_date: If and when the package was permanently deleted. :type permanently_deleted_date: datetime :param source_chain: The history of upstream sources for this package. The first source in the list is the immediate source from which this package was saved. :type source_chain: list of :class:`UpstreamSourceInfo ` :param unpublished_date: If and when the package was deleted. :type unpublished_date: datetime :param version: The version of the package. :type version: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'deprecate_message': {'key': 'deprecateMessage', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'permanently_deleted_date': {'key': 'permanentlyDeletedDate', 'type': 'iso-8601'}, 'source_chain': {'key': 'sourceChain', 'type': '[UpstreamSourceInfo]'}, 'unpublished_date': {'key': 'unpublishedDate', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, _links=None, deprecate_message=None, id=None, name=None, permanently_deleted_date=None, source_chain=None, unpublished_date=None, version=None): super(Package, self).__init__() self._links = _links self.deprecate_message = deprecate_message self.id = id self.name = name self.permanently_deleted_date = permanently_deleted_date self.source_chain = source_chain self.unpublished_date = unpublished_date self.version = version class PackageVersionDetails(Model): """PackageVersionDetails. :param deprecate_message: Indicates the deprecate message of a package version :type deprecate_message: str :param views: The view to which the package version will be added :type views: :class:`JsonPatchOperation ` """ _attribute_map = { 'deprecate_message': {'key': 'deprecateMessage', 'type': 'str'}, 'views': {'key': 'views', 'type': 'JsonPatchOperation'} } def __init__(self, deprecate_message=None, views=None): super(PackageVersionDetails, self).__init__() self.deprecate_message = deprecate_message self.views = views class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class UpstreamSourceInfo(Model): """UpstreamSourceInfo. :param id: Identity of the upstream source. :type id: str :param location: Locator for connecting to the upstream source. :type location: str :param name: Display name. :type name: str :param source_type: Source type, such as Public or Internal. :type source_type: object """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'source_type': {'key': 'sourceType', 'type': 'object'} } def __init__(self, id=None, location=None, name=None, source_type=None): super(UpstreamSourceInfo, self).__init__() self.id = id self.location = location self.name = name self.source_type = source_type class BatchDeprecateData(BatchOperationData): """BatchDeprecateData. :param message: Deprecate message that will be added to packages :type message: str """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'} } def __init__(self, message=None): super(BatchDeprecateData, self).__init__() self.message = message __all__ = [ 'BatchOperationData', 'JsonPatchOperation', 'MinimalPackageDetails', 'NpmPackagesBatchRequest', 'NpmPackageVersionDeletionState', 'NpmRecycleBinPackageVersionDetails', 'Package', 'PackageVersionDetails', 'ReferenceLinks', 'UpstreamSourceInfo', 'BatchDeprecateData', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/npm/npm_client.py000066400000000000000000000576751360605530400323750ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class NpmClient(Client): """Npm :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(NpmClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '4c83cfc1-f33a-477e-a789-29d38ffca52e' def get_content_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, **kwargs): """GetContentScopedPackage. [Preview API] :param str feed_id: :param str package_scope: :param str unscoped_package_name: :param str package_version: :rtype: object """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_scope is not None: route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') if unscoped_package_name is not None: route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='09a4eafd-123a-495c-979c-0eda7bdb9a14', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_content_unscoped_package(self, feed_id, package_name, package_version, **kwargs): """GetContentUnscopedPackage. [Preview API] Get an unscoped npm package. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: object """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='75caa482-cb1e-47cd-9f2c-c048a4b7a43e', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def update_packages(self, batch_request, feed_id): """UpdatePackages. [Preview API] Update several packages from a single feed in a single request. The updates to the packages do not happen atomically. :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. :param str feed_id: Name or ID of the feed. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') content = self._serialize.body(batch_request, 'NpmPackagesBatchRequest') self._send(http_method='POST', location_id='06f34005-bbb2-41f4-88f5-23e03a99bb12', version='5.0-preview.1', route_values=route_values, content=content) def get_readme_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version, **kwargs): """GetReadmeScopedPackage. [Preview API] Get the Readme for a package version with an npm scope. :param str feed_id: Name or ID of the feed. :param str package_scope: Scope of the package (the 'scope' part of @scope\name) :param str unscoped_package_name: Name of the package (the 'name' part of @scope\name) :param str package_version: Version of the package. :rtype: object """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_scope is not None: route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') if unscoped_package_name is not None: route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='6d4db777-7e4a-43b2-afad-779a1d197301', version='5.0-preview.1', route_values=route_values, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_readme_unscoped_package(self, feed_id, package_name, package_version, **kwargs): """GetReadmeUnscopedPackage. [Preview API] Get the Readme for a package version that has no npm scope. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: object """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='1099a396-b310-41d4-a4b6-33d134ce3fcf', version='5.0-preview.1', route_values=route_values, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def delete_scoped_package_version_from_recycle_bin(self, feed_id, package_scope, unscoped_package_name, package_version): """DeleteScopedPackageVersionFromRecycleBin. [Preview API] Delete a package version with an npm scope from the recycle bin. :param str feed_id: Name or ID of the feed. :param str package_scope: Scope of the package (the 'scope' part of @scope/name). :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_scope is not None: route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') if unscoped_package_name is not None: route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') self._send(http_method='DELETE', location_id='220f45eb-94a5-432c-902a-5b8c6372e415', version='5.0-preview.1', route_values=route_values) def get_scoped_package_version_metadata_from_recycle_bin(self, feed_id, package_scope, unscoped_package_name, package_version): """GetScopedPackageVersionMetadataFromRecycleBin. [Preview API] Get information about a scoped package version in the recycle bin. :param str feed_id: Name or ID of the feed. :param str package_scope: Scope of the package (the 'scope' part of @scope/name) :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_scope is not None: route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') if unscoped_package_name is not None: route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='220f45eb-94a5-432c-902a-5b8c6372e415', version='5.0-preview.1', route_values=route_values) return self._deserialize('NpmPackageVersionDeletionState', response) def restore_scoped_package_version_from_recycle_bin(self, package_version_details, feed_id, package_scope, unscoped_package_name, package_version): """RestoreScopedPackageVersionFromRecycleBin. [Preview API] Restore a package version with an npm scope from the recycle bin to its feed. :param :class:` ` package_version_details: :param str feed_id: Name or ID of the feed. :param str package_scope: Scope of the package (the 'scope' part of @scope/name). :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_scope is not None: route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') if unscoped_package_name is not None: route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'NpmRecycleBinPackageVersionDetails') self._send(http_method='PATCH', location_id='220f45eb-94a5-432c-902a-5b8c6372e415', version='5.0-preview.1', route_values=route_values, content=content) def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version): """DeletePackageVersionFromRecycleBin. [Preview API] Delete a package version without an npm scope from the recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') self._send(http_method='DELETE', location_id='63a4f31f-e92b-4ee4-bf92-22d485e73bef', version='5.0-preview.1', route_values=route_values) def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version): """GetPackageVersionMetadataFromRecycleBin. [Preview API] Get information about an unscoped package version in the recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='63a4f31f-e92b-4ee4-bf92-22d485e73bef', version='5.0-preview.1', route_values=route_values) return self._deserialize('NpmPackageVersionDeletionState', response) def restore_package_version_from_recycle_bin(self, package_version_details, feed_id, package_name, package_version): """RestorePackageVersionFromRecycleBin. [Preview API] Restore a package version without an npm scope from the recycle bin to its feed. :param :class:` ` package_version_details: :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'NpmRecycleBinPackageVersionDetails') self._send(http_method='PATCH', location_id='63a4f31f-e92b-4ee4-bf92-22d485e73bef', version='5.0-preview.1', route_values=route_values, content=content) def get_scoped_package_info(self, feed_id, package_scope, unscoped_package_name, package_version): """GetScopedPackageInfo. [Preview API] Get information about a scoped package version (such as @scope/name). :param str feed_id: Name or ID of the feed. :param str package_scope: Scope of the package (the 'scope' part of @scope/name). :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_scope is not None: route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') if unscoped_package_name is not None: route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='e93d9ec3-4022-401e-96b0-83ea5d911e09', version='5.0-preview.1', route_values=route_values) return self._deserialize('Package', response) def unpublish_scoped_package(self, feed_id, package_scope, unscoped_package_name, package_version): """UnpublishScopedPackage. [Preview API] Unpublish a scoped package version (such as @scope/name). :param str feed_id: Name or ID of the feed. :param str package_scope: Scope of the package (the 'scope' part of @scope/name). :param str unscoped_package_name: Name of the package (the 'name' part of @scope/name). :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_scope is not None: route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') if unscoped_package_name is not None: route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='DELETE', location_id='e93d9ec3-4022-401e-96b0-83ea5d911e09', version='5.0-preview.1', route_values=route_values) return self._deserialize('Package', response) def update_scoped_package(self, package_version_details, feed_id, package_scope, unscoped_package_name, package_version): """UpdateScopedPackage. [Preview API] :param :class:` ` package_version_details: :param str feed_id: :param str package_scope: :param str unscoped_package_name: :param str package_version: :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_scope is not None: route_values['packageScope'] = self._serialize.url('package_scope', package_scope, 'str') if unscoped_package_name is not None: route_values['unscopedPackageName'] = self._serialize.url('unscoped_package_name', unscoped_package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'PackageVersionDetails') response = self._send(http_method='PATCH', location_id='e93d9ec3-4022-401e-96b0-83ea5d911e09', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Package', response) def get_package_info(self, feed_id, package_name, package_version): """GetPackageInfo. [Preview API] Get information about an unscoped package version. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='ed579d62-67c9-4271-be66-9b029af5bcf9', version='5.0-preview.1', route_values=route_values) return self._deserialize('Package', response) def unpublish_package(self, feed_id, package_name, package_version): """UnpublishPackage. [Preview API] Unpublish an unscoped package version. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='DELETE', location_id='ed579d62-67c9-4271-be66-9b029af5bcf9', version='5.0-preview.1', route_values=route_values) return self._deserialize('Package', response) def update_package(self, package_version_details, feed_id, package_name, package_version): """UpdatePackage. [Preview API] :param :class:` ` package_version_details: :param str feed_id: :param str package_name: :param str package_version: :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'PackageVersionDetails') response = self._send(http_method='PATCH', location_id='ed579d62-67c9-4271-be66-9b029af5bcf9', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Package', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/nuget/000077500000000000000000000000001360605530400301775ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/nuget/__init__.py000066400000000000000000000017021360605530400323100ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .nuget_client import NuGetClient __all__ = [ 'BatchListData', 'BatchOperationData', 'JsonPatchOperation', 'MinimalPackageDetails', 'NuGetPackagesBatchRequest', 'NuGetPackageVersionDeletionState', 'NuGetRecycleBinPackageVersionDetails', 'Package', 'PackageVersionDetails', 'ReferenceLinks', 'UpstreamSourceInfo', 'NuGetClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/nuget/models.py000066400000000000000000000210461360605530400320370ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class BatchOperationData(Model): """BatchOperationData. """ _attribute_map = { } def __init__(self): super(BatchOperationData, self).__init__() class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class MinimalPackageDetails(Model): """MinimalPackageDetails. :param id: Package name. :type id: str :param version: Package version. :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, version=None): super(MinimalPackageDetails, self).__init__() self.id = id self.version = version class NuGetPackagesBatchRequest(Model): """NuGetPackagesBatchRequest. :param data: Data required to perform the operation. This is optional based on the type of the operation. Use BatchPromoteData if performing a promote operation. :type data: :class:`BatchOperationData ` :param operation: Type of operation that needs to be performed on packages. :type operation: object :param packages: The packages onto which the operation will be performed. :type packages: list of :class:`MinimalPackageDetails ` """ _attribute_map = { 'data': {'key': 'data', 'type': 'BatchOperationData'}, 'operation': {'key': 'operation', 'type': 'object'}, 'packages': {'key': 'packages', 'type': '[MinimalPackageDetails]'} } def __init__(self, data=None, operation=None, packages=None): super(NuGetPackagesBatchRequest, self).__init__() self.data = data self.operation = operation self.packages = packages class NuGetPackageVersionDeletionState(Model): """NuGetPackageVersionDeletionState. :param deleted_date: Utc date the package was deleted. :type deleted_date: datetime :param name: Name of the package. :type name: str :param version: Version of the package. :type version: str """ _attribute_map = { 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, deleted_date=None, name=None, version=None): super(NuGetPackageVersionDeletionState, self).__init__() self.deleted_date = deleted_date self.name = name self.version = version class NuGetRecycleBinPackageVersionDetails(Model): """NuGetRecycleBinPackageVersionDetails. :param deleted: Setting to false will undo earlier deletion and restore the package to feed. :type deleted: bool """ _attribute_map = { 'deleted': {'key': 'deleted', 'type': 'bool'} } def __init__(self, deleted=None): super(NuGetRecycleBinPackageVersionDetails, self).__init__() self.deleted = deleted class Package(Model): """Package. :param _links: Related REST links. :type _links: :class:`ReferenceLinks ` :param deleted_date: If and when the package was deleted. :type deleted_date: datetime :param id: Package Id. :type id: str :param name: The display name of the package. :type name: str :param permanently_deleted_date: If and when the package was permanently deleted. :type permanently_deleted_date: datetime :param source_chain: The history of upstream sources for this package. The first source in the list is the immediate source from which this package was saved. :type source_chain: list of :class:`UpstreamSourceInfo ` :param version: The version of the package. :type version: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'permanently_deleted_date': {'key': 'permanentlyDeletedDate', 'type': 'iso-8601'}, 'source_chain': {'key': 'sourceChain', 'type': '[UpstreamSourceInfo]'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, _links=None, deleted_date=None, id=None, name=None, permanently_deleted_date=None, source_chain=None, version=None): super(Package, self).__init__() self._links = _links self.deleted_date = deleted_date self.id = id self.name = name self.permanently_deleted_date = permanently_deleted_date self.source_chain = source_chain self.version = version class PackageVersionDetails(Model): """PackageVersionDetails. :param listed: Indicates the listing state of a package :type listed: bool :param views: The view to which the package version will be added :type views: :class:`JsonPatchOperation ` """ _attribute_map = { 'listed': {'key': 'listed', 'type': 'bool'}, 'views': {'key': 'views', 'type': 'JsonPatchOperation'} } def __init__(self, listed=None, views=None): super(PackageVersionDetails, self).__init__() self.listed = listed self.views = views class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class UpstreamSourceInfo(Model): """UpstreamSourceInfo. :param id: Identity of the upstream source. :type id: str :param location: Locator for connecting to the upstream source. :type location: str :param name: Display name. :type name: str :param source_type: Source type, such as Public or Internal. :type source_type: object """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'source_type': {'key': 'sourceType', 'type': 'object'} } def __init__(self, id=None, location=None, name=None, source_type=None): super(UpstreamSourceInfo, self).__init__() self.id = id self.location = location self.name = name self.source_type = source_type class BatchListData(BatchOperationData): """BatchListData. :param listed: The desired listed status for the package versions. :type listed: bool """ _attribute_map = { 'listed': {'key': 'listed', 'type': 'bool'} } def __init__(self, listed=None): super(BatchListData, self).__init__() self.listed = listed __all__ = [ 'BatchOperationData', 'JsonPatchOperation', 'MinimalPackageDetails', 'NuGetPackagesBatchRequest', 'NuGetPackageVersionDeletionState', 'NuGetRecycleBinPackageVersionDetails', 'Package', 'PackageVersionDetails', 'ReferenceLinks', 'UpstreamSourceInfo', 'BatchListData', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/nuget/nuget_client.py000066400000000000000000000267501360605530400332430ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class NuGetClient(Client): """NuGet :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(NuGetClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'b3be7473-68ea-4a81-bfc7-9530baaa19ad' def download_package(self, feed_id, package_name, package_version, source_protocol_version=None, **kwargs): """DownloadPackage. [Preview API] Download a package version directly. This API is intended for manual UI download options, not for programmatic access and scripting. You may be heavily throttled if accessing this api for scripting purposes. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :param str source_protocol_version: Unused :rtype: object """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') query_parameters = {} if source_protocol_version is not None: query_parameters['sourceProtocolVersion'] = self._serialize.query('source_protocol_version', source_protocol_version, 'str') response = self._send(http_method='GET', location_id='6ea81b8c-7386-490b-a71f-6cf23c80b388', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def update_package_versions(self, batch_request, feed_id): """UpdatePackageVersions. [Preview API] Update several packages from a single feed in a single request. The updates to the packages do not happen atomically. :param :class:` ` batch_request: Information about the packages to update, the operation to perform, and its associated data. :param str feed_id: Name or ID of the feed. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') content = self._serialize.body(batch_request, 'NuGetPackagesBatchRequest') self._send(http_method='POST', location_id='00c58ea7-d55f-49de-b59f-983533ae11dc', version='5.0-preview.1', route_values=route_values, content=content) def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version): """DeletePackageVersionFromRecycleBin. [Preview API] Delete a package version from a feed's recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') self._send(http_method='DELETE', location_id='07e88775-e3cb-4408-bbe1-628e036fac8c', version='5.0-preview.1', route_values=route_values) def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version): """GetPackageVersionMetadataFromRecycleBin. [Preview API] View a package version's deletion/recycled status :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='07e88775-e3cb-4408-bbe1-628e036fac8c', version='5.0-preview.1', route_values=route_values) return self._deserialize('NuGetPackageVersionDeletionState', response) def restore_package_version_from_recycle_bin(self, package_version_details, feed_id, package_name, package_version): """RestorePackageVersionFromRecycleBin. [Preview API] Restore a package version from a feed's recycle bin back into the active feed. :param :class:` ` package_version_details: Set the 'Deleted' member to 'false' to apply the restore operation :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'NuGetRecycleBinPackageVersionDetails') self._send(http_method='PATCH', location_id='07e88775-e3cb-4408-bbe1-628e036fac8c', version='5.0-preview.1', route_values=route_values, content=content) def delete_package_version(self, feed_id, package_name, package_version): """DeletePackageVersion. [Preview API] Send a package version from the feed to its paired recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package to delete. :param str package_version: Version of the package to delete. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='DELETE', location_id='36c9353b-e250-4c57-b040-513c186c3905', version='5.0-preview.1', route_values=route_values) return self._deserialize('Package', response) def get_package_version(self, feed_id, package_name, package_version, show_deleted=None): """GetPackageVersion. [Preview API] Get information about a package version. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :param bool show_deleted: True to include deleted packages in the response. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') query_parameters = {} if show_deleted is not None: query_parameters['showDeleted'] = self._serialize.query('show_deleted', show_deleted, 'bool') response = self._send(http_method='GET', location_id='36c9353b-e250-4c57-b040-513c186c3905', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Package', response) def update_package_version(self, package_version_details, feed_id, package_name, package_version): """UpdatePackageVersion. [Preview API] Set mutable state on a package version. :param :class:` ` package_version_details: New state to apply to the referenced package. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package to update. :param str package_version: Version of the package to update. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'PackageVersionDetails') self._send(http_method='PATCH', location_id='36c9353b-e250-4c57-b040-513c186c3905', version='5.0-preview.1', route_values=route_values, content=content) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/operations/000077500000000000000000000000001360605530400312405ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/operations/__init__.py000066400000000000000000000013731360605530400333550ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .operations_client import OperationsClient __all__ = [ 'Operation', 'OperationReference', 'OperationResultReference', 'ReferenceLinks', 'OperationsClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/operations/models.py000066400000000000000000000100631360605530400330750ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class OperationReference(Model): """OperationReference. :param id: Unique identifier for the operation. :type id: str :param plugin_id: Unique identifier for the plugin. :type plugin_id: str :param status: The current status of the operation. :type status: object :param url: URL to get the full operation object. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'plugin_id': {'key': 'pluginId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, plugin_id=None, status=None, url=None): super(OperationReference, self).__init__() self.id = id self.plugin_id = plugin_id self.status = status self.url = url class OperationResultReference(Model): """OperationResultReference. :param result_url: URL to the operation result. :type result_url: str """ _attribute_map = { 'result_url': {'key': 'resultUrl', 'type': 'str'} } def __init__(self, result_url=None): super(OperationResultReference, self).__init__() self.result_url = result_url class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class Operation(OperationReference): """Operation. :param id: Unique identifier for the operation. :type id: str :param plugin_id: Unique identifier for the plugin. :type plugin_id: str :param status: The current status of the operation. :type status: object :param url: URL to get the full operation object. :type url: str :param _links: Links to other related objects. :type _links: :class:`ReferenceLinks ` :param detailed_message: Detailed messaged about the status of an operation. :type detailed_message: str :param result_message: Result message for an operation. :type result_message: str :param result_url: URL to the operation result. :type result_url: :class:`OperationResultReference ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'plugin_id': {'key': 'pluginId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'detailed_message': {'key': 'detailedMessage', 'type': 'str'}, 'result_message': {'key': 'resultMessage', 'type': 'str'}, 'result_url': {'key': 'resultUrl', 'type': 'OperationResultReference'} } def __init__(self, id=None, plugin_id=None, status=None, url=None, _links=None, detailed_message=None, result_message=None, result_url=None): super(Operation, self).__init__(id=id, plugin_id=plugin_id, status=status, url=url) self._links = _links self.detailed_message = detailed_message self.result_message = result_message self.result_url = result_url __all__ = [ 'OperationReference', 'OperationResultReference', 'ReferenceLinks', 'Operation', ] operations_client.py000066400000000000000000000042401360605530400352540ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/operations# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class OperationsClient(Client): """Operations :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(OperationsClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_operation(self, operation_id, plugin_id=None): """GetOperation. Gets an operation from the the operationId using the given pluginId. :param str operation_id: The ID for the operation. :param str plugin_id: The ID for the plugin. :rtype: :class:` ` """ route_values = {} if operation_id is not None: route_values['operationId'] = self._serialize.url('operation_id', operation_id, 'str') query_parameters = {} if plugin_id is not None: query_parameters['pluginId'] = self._serialize.query('plugin_id', plugin_id, 'str') response = self._send(http_method='GET', location_id='9a1b74b4-2ca8-4a9f-8470-c2f2e6fdc949', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Operation', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/policy/000077500000000000000000000000001360605530400303545ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/policy/__init__.py000066400000000000000000000015641360605530400324730ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .policy_client import PolicyClient __all__ = [ 'GraphSubjectBase', 'IdentityRef', 'PolicyConfiguration', 'PolicyConfigurationRef', 'PolicyEvaluationRecord', 'PolicyType', 'PolicyTypeRef', 'ReferenceLinks', 'VersionedPolicyConfigurationRef', 'PolicyClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/policy/models.py000066400000000000000000000330271360605530400322160ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class PolicyConfigurationRef(Model): """PolicyConfigurationRef. :param id: The policy configuration ID. :type id: int :param type: The policy configuration type. :type type: :class:`PolicyTypeRef ` :param url: The URL where the policy configuration can be retrieved. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'PolicyTypeRef'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, type=None, url=None): super(PolicyConfigurationRef, self).__init__() self.id = id self.type = type self.url = url class PolicyEvaluationRecord(Model): """PolicyEvaluationRecord. :param _links: Links to other related objects :type _links: :class:`ReferenceLinks ` :param artifact_id: A string which uniquely identifies the target of a policy evaluation. :type artifact_id: str :param completed_date: Time when this policy finished evaluating on this pull request. :type completed_date: datetime :param configuration: Contains all configuration data for the policy which is being evaluated. :type configuration: :class:`PolicyConfiguration ` :param context: Internal context data of this policy evaluation. :type context: :class:`object ` :param evaluation_id: Guid which uniquely identifies this evaluation record (one policy running on one pull request). :type evaluation_id: str :param started_date: Time when this policy was first evaluated on this pull request. :type started_date: datetime :param status: Status of the policy (Running, Approved, Failed, etc.) :type status: object """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'artifact_id': {'key': 'artifactId', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, 'configuration': {'key': 'configuration', 'type': 'PolicyConfiguration'}, 'context': {'key': 'context', 'type': 'object'}, 'evaluation_id': {'key': 'evaluationId', 'type': 'str'}, 'started_date': {'key': 'startedDate', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, _links=None, artifact_id=None, completed_date=None, configuration=None, context=None, evaluation_id=None, started_date=None, status=None): super(PolicyEvaluationRecord, self).__init__() self._links = _links self.artifact_id = artifact_id self.completed_date = completed_date self.configuration = configuration self.context = context self.evaluation_id = evaluation_id self.started_date = started_date self.status = status class PolicyTypeRef(Model): """PolicyTypeRef. :param display_name: Display name of the policy type. :type display_name: str :param id: The policy type ID. :type id: str :param url: The URL where the policy type can be retrieved. :type url: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, display_name=None, id=None, url=None): super(PolicyTypeRef, self).__init__() self.display_name = display_name self.id = id self.url = url class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class VersionedPolicyConfigurationRef(PolicyConfigurationRef): """VersionedPolicyConfigurationRef. :param id: The policy configuration ID. :type id: int :param type: The policy configuration type. :type type: :class:`PolicyTypeRef ` :param url: The URL where the policy configuration can be retrieved. :type url: str :param revision: The policy configuration revision ID. :type revision: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'PolicyTypeRef'}, 'url': {'key': 'url', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'} } def __init__(self, id=None, type=None, url=None, revision=None): super(VersionedPolicyConfigurationRef, self).__init__(id=id, type=type, url=url) self.revision = revision class PolicyConfiguration(VersionedPolicyConfigurationRef): """PolicyConfiguration. :param id: The policy configuration ID. :type id: int :param type: The policy configuration type. :type type: :class:`PolicyTypeRef ` :param url: The URL where the policy configuration can be retrieved. :type url: str :param revision: The policy configuration revision ID. :type revision: int :param _links: The links to other objects related to this object. :type _links: :class:`ReferenceLinks ` :param created_by: A reference to the identity that created the policy. :type created_by: :class:`IdentityRef ` :param created_date: The date and time when the policy was created. :type created_date: datetime :param is_blocking: Indicates whether the policy is blocking. :type is_blocking: bool :param is_deleted: Indicates whether the policy has been (soft) deleted. :type is_deleted: bool :param is_enabled: Indicates whether the policy is enabled. :type is_enabled: bool :param settings: The policy configuration settings. :type settings: :class:`object ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'PolicyTypeRef'}, 'url': {'key': 'url', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'is_blocking': {'key': 'isBlocking', 'type': 'bool'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'settings': {'key': 'settings', 'type': 'object'} } def __init__(self, id=None, type=None, url=None, revision=None, _links=None, created_by=None, created_date=None, is_blocking=None, is_deleted=None, is_enabled=None, settings=None): super(PolicyConfiguration, self).__init__(id=id, type=type, url=url, revision=revision) self._links = _links self.created_by = created_by self.created_date = created_date self.is_blocking = is_blocking self.is_deleted = is_deleted self.is_enabled = is_enabled self.settings = settings class PolicyType(PolicyTypeRef): """PolicyType. :param display_name: Display name of the policy type. :type display_name: str :param id: The policy type ID. :type id: str :param url: The URL where the policy type can be retrieved. :type url: str :param _links: The links to other objects related to this object. :type _links: :class:`ReferenceLinks ` :param description: Detailed description of the policy type. :type description: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'} } def __init__(self, display_name=None, id=None, url=None, _links=None, description=None): super(PolicyType, self).__init__(display_name=display_name, id=id, url=url) self._links = _links self.description = description __all__ = [ 'GraphSubjectBase', 'IdentityRef', 'PolicyConfigurationRef', 'PolicyEvaluationRecord', 'PolicyTypeRef', 'ReferenceLinks', 'VersionedPolicyConfigurationRef', 'PolicyConfiguration', 'PolicyType', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/policy/policy_client.py000066400000000000000000000353731360605530400335760ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class PolicyClient(Client): """Policy :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(PolicyClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'fb13a388-40dd-4a04-b530-013a739c72ef' def create_policy_configuration(self, configuration, project, configuration_id=None): """CreatePolicyConfiguration. Create a policy configuration of a given policy type. :param :class:` ` configuration: The policy configuration to create. :param str project: Project ID or project name :param int configuration_id: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') content = self._serialize.body(configuration, 'PolicyConfiguration') response = self._send(http_method='POST', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.0', route_values=route_values, content=content) return self._deserialize('PolicyConfiguration', response) def delete_policy_configuration(self, project, configuration_id): """DeletePolicyConfiguration. Delete a policy configuration by its ID. :param str project: Project ID or project name :param int configuration_id: ID of the policy configuration to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') self._send(http_method='DELETE', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.0', route_values=route_values) def get_policy_configuration(self, project, configuration_id): """GetPolicyConfiguration. Get a policy configuration by its ID. :param str project: Project ID or project name :param int configuration_id: ID of the policy configuration :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') response = self._send(http_method='GET', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.0', route_values=route_values) return self._deserialize('PolicyConfiguration', response) def get_policy_configurations(self, project, scope=None, policy_type=None): """GetPolicyConfigurations. Get a list of policy configurations in a project. :param str project: Project ID or project name :param str scope: [Provided for legacy reasons] The scope on which a subset of policies is defined. :param str policy_type: Filter returned policies to only this type :rtype: [PolicyConfiguration] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if scope is not None: query_parameters['scope'] = self._serialize.query('scope', scope, 'str') if policy_type is not None: query_parameters['policyType'] = self._serialize.query('policy_type', policy_type, 'str') response = self._send(http_method='GET', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) def update_policy_configuration(self, configuration, project, configuration_id): """UpdatePolicyConfiguration. Update a policy configuration by its ID. :param :class:` ` configuration: The policy configuration to update. :param str project: Project ID or project name :param int configuration_id: ID of the existing policy configuration to be updated. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') content = self._serialize.body(configuration, 'PolicyConfiguration') response = self._send(http_method='PUT', location_id='dad91cbe-d183-45f8-9c6e-9c1164472121', version='5.0', route_values=route_values, content=content) return self._deserialize('PolicyConfiguration', response) def get_policy_evaluation(self, project, evaluation_id): """GetPolicyEvaluation. [Preview API] Gets the present evaluation state of a policy. :param str project: Project ID or project name :param str evaluation_id: ID of the policy evaluation to be retrieved. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if evaluation_id is not None: route_values['evaluationId'] = self._serialize.url('evaluation_id', evaluation_id, 'str') response = self._send(http_method='GET', location_id='46aecb7a-5d2c-4647-897b-0209505a9fe4', version='5.0-preview.1', route_values=route_values) return self._deserialize('PolicyEvaluationRecord', response) def requeue_policy_evaluation(self, project, evaluation_id): """RequeuePolicyEvaluation. [Preview API] Requeue the policy evaluation. :param str project: Project ID or project name :param str evaluation_id: ID of the policy evaluation to be retrieved. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if evaluation_id is not None: route_values['evaluationId'] = self._serialize.url('evaluation_id', evaluation_id, 'str') response = self._send(http_method='PATCH', location_id='46aecb7a-5d2c-4647-897b-0209505a9fe4', version='5.0-preview.1', route_values=route_values) return self._deserialize('PolicyEvaluationRecord', response) def get_policy_evaluations(self, project, artifact_id, include_not_applicable=None, top=None, skip=None): """GetPolicyEvaluations. [Preview API] Retrieves a list of all the policy evaluation statuses for a specific pull request. :param str project: Project ID or project name :param str artifact_id: A string which uniquely identifies the target of a policy evaluation. :param bool include_not_applicable: Some policies might determine that they do not apply to a specific pull request. Setting this parameter to true will return evaluation records even for policies which don't apply to this pull request. :param int top: The number of policy evaluation records to retrieve. :param int skip: The number of policy evaluation records to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. :rtype: [PolicyEvaluationRecord] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if artifact_id is not None: query_parameters['artifactId'] = self._serialize.query('artifact_id', artifact_id, 'str') if include_not_applicable is not None: query_parameters['includeNotApplicable'] = self._serialize.query('include_not_applicable', include_not_applicable, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='c23ddff5-229c-4d04-a80b-0fdce9f360c8', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[PolicyEvaluationRecord]', self._unwrap_collection(response)) def get_policy_configuration_revision(self, project, configuration_id, revision_id): """GetPolicyConfigurationRevision. Retrieve a specific revision of a given policy by ID. :param str project: Project ID or project name :param int configuration_id: The policy configuration ID. :param int revision_id: The revision ID. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') if revision_id is not None: route_values['revisionId'] = self._serialize.url('revision_id', revision_id, 'int') response = self._send(http_method='GET', location_id='fe1e68a2-60d3-43cb-855b-85e41ae97c95', version='5.0', route_values=route_values) return self._deserialize('PolicyConfiguration', response) def get_policy_configuration_revisions(self, project, configuration_id, top=None, skip=None): """GetPolicyConfigurationRevisions. Retrieve all revisions for a given policy. :param str project: Project ID or project name :param int configuration_id: The policy configuration ID. :param int top: The number of revisions to retrieve. :param int skip: The number of revisions to ignore. For example, to retrieve results 101-150, set top to 50 and skip to 100. :rtype: [PolicyConfiguration] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if configuration_id is not None: route_values['configurationId'] = self._serialize.url('configuration_id', configuration_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='fe1e68a2-60d3-43cb-855b-85e41ae97c95', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[PolicyConfiguration]', self._unwrap_collection(response)) def get_policy_type(self, project, type_id): """GetPolicyType. Retrieve a specific policy type by ID. :param str project: Project ID or project name :param str type_id: The policy ID. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type_id is not None: route_values['typeId'] = self._serialize.url('type_id', type_id, 'str') response = self._send(http_method='GET', location_id='44096322-2d3d-466a-bb30-d1b7de69f61f', version='5.0', route_values=route_values) return self._deserialize('PolicyType', response) def get_policy_types(self, project): """GetPolicyTypes. Retrieve all available policy types. :param str project: Project ID or project name :rtype: [PolicyType] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='44096322-2d3d-466a-bb30-d1b7de69f61f', version='5.0', route_values=route_values) return self._deserialize('[PolicyType]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/profile/000077500000000000000000000000001360605530400305155ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/profile/__init__.py000066400000000000000000000016411360605530400326300ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .profile_client import ProfileClient __all__ = [ 'AttributeDescriptor', 'AttributesContainer', 'Avatar', 'CoreProfileAttribute', 'CreateProfileContext', 'GeoRegion', 'Profile', 'ProfileAttribute', 'ProfileAttributeBase', 'ProfileRegion', 'ProfileRegions', 'RemoteProfile', 'ProfileClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/profile/models.py000066400000000000000000000244271360605530400323630ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AttributeDescriptor(Model): """AttributeDescriptor. :param attribute_name: :type attribute_name: str :param container_name: :type container_name: str """ _attribute_map = { 'attribute_name': {'key': 'attributeName', 'type': 'str'}, 'container_name': {'key': 'containerName', 'type': 'str'} } def __init__(self, attribute_name=None, container_name=None): super(AttributeDescriptor, self).__init__() self.attribute_name = attribute_name self.container_name = container_name class AttributesContainer(Model): """AttributesContainer. :param attributes: :type attributes: dict :param container_name: :type container_name: str :param revision: :type revision: int """ _attribute_map = { 'attributes': {'key': 'attributes', 'type': '{ProfileAttribute}'}, 'container_name': {'key': 'containerName', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'} } def __init__(self, attributes=None, container_name=None, revision=None): super(AttributesContainer, self).__init__() self.attributes = attributes self.container_name = container_name self.revision = revision class Avatar(Model): """Avatar. :param is_auto_generated: :type is_auto_generated: bool :param size: :type size: object :param time_stamp: :type time_stamp: datetime :param value: :type value: str """ _attribute_map = { 'is_auto_generated': {'key': 'isAutoGenerated', 'type': 'bool'}, 'size': {'key': 'size', 'type': 'object'}, 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, is_auto_generated=None, size=None, time_stamp=None, value=None): super(Avatar, self).__init__() self.is_auto_generated = is_auto_generated self.size = size self.time_stamp = time_stamp self.value = value class CreateProfileContext(Model): """CreateProfileContext. :param ci_data: :type ci_data: dict :param contact_with_offers: :type contact_with_offers: bool :param country_name: :type country_name: str :param display_name: :type display_name: str :param email_address: :type email_address: str :param has_account: :type has_account: bool :param language: :type language: str :param phone_number: :type phone_number: str :param profile_state: :type profile_state: object """ _attribute_map = { 'ci_data': {'key': 'ciData', 'type': '{object}'}, 'contact_with_offers': {'key': 'contactWithOffers', 'type': 'bool'}, 'country_name': {'key': 'countryName', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'email_address': {'key': 'emailAddress', 'type': 'str'}, 'has_account': {'key': 'hasAccount', 'type': 'bool'}, 'language': {'key': 'language', 'type': 'str'}, 'phone_number': {'key': 'phoneNumber', 'type': 'str'}, 'profile_state': {'key': 'profileState', 'type': 'object'} } def __init__(self, ci_data=None, contact_with_offers=None, country_name=None, display_name=None, email_address=None, has_account=None, language=None, phone_number=None, profile_state=None): super(CreateProfileContext, self).__init__() self.ci_data = ci_data self.contact_with_offers = contact_with_offers self.country_name = country_name self.display_name = display_name self.email_address = email_address self.has_account = has_account self.language = language self.phone_number = phone_number self.profile_state = profile_state class GeoRegion(Model): """GeoRegion. :param region_code: :type region_code: str """ _attribute_map = { 'region_code': {'key': 'regionCode', 'type': 'str'} } def __init__(self, region_code=None): super(GeoRegion, self).__init__() self.region_code = region_code class Profile(Model): """Profile. :param application_container: :type application_container: :class:`AttributesContainer ` :param core_attributes: :type core_attributes: dict :param core_revision: :type core_revision: int :param id: :type id: str :param profile_state: :type profile_state: object :param revision: :type revision: int :param time_stamp: :type time_stamp: datetime """ _attribute_map = { 'application_container': {'key': 'applicationContainer', 'type': 'AttributesContainer'}, 'core_attributes': {'key': 'coreAttributes', 'type': '{CoreProfileAttribute}'}, 'core_revision': {'key': 'coreRevision', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'profile_state': {'key': 'profileState', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'} } def __init__(self, application_container=None, core_attributes=None, core_revision=None, id=None, profile_state=None, revision=None, time_stamp=None): super(Profile, self).__init__() self.application_container = application_container self.core_attributes = core_attributes self.core_revision = core_revision self.id = id self.profile_state = profile_state self.revision = revision self.time_stamp = time_stamp class ProfileAttributeBase(Model): """ProfileAttributeBase. :param descriptor: :type descriptor: :class:`AttributeDescriptor ` :param revision: :type revision: int :param time_stamp: :type time_stamp: datetime :param value: :type value: object """ _attribute_map = { 'descriptor': {'key': 'descriptor', 'type': 'AttributeDescriptor'}, 'revision': {'key': 'revision', 'type': 'int'}, 'time_stamp': {'key': 'timeStamp', 'type': 'iso-8601'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, descriptor=None, revision=None, time_stamp=None, value=None): super(ProfileAttributeBase, self).__init__() self.descriptor = descriptor self.revision = revision self.time_stamp = time_stamp self.value = value class ProfileRegion(Model): """ProfileRegion. :param code: The two-letter code defined in ISO 3166 for the country/region. :type code: str :param name: Localized country/region name :type name: str """ _attribute_map = { 'code': {'key': 'code', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, code=None, name=None): super(ProfileRegion, self).__init__() self.code = code self.name = name class ProfileRegions(Model): """ProfileRegions. :param notice_contact_consent_requirement_regions: List of country/region code with contact consent requirement type of notice :type notice_contact_consent_requirement_regions: list of str :param opt_out_contact_consent_requirement_regions: List of country/region code with contact consent requirement type of opt-out :type opt_out_contact_consent_requirement_regions: list of str :param regions: List of country/regions :type regions: list of :class:`ProfileRegion ` """ _attribute_map = { 'notice_contact_consent_requirement_regions': {'key': 'noticeContactConsentRequirementRegions', 'type': '[str]'}, 'opt_out_contact_consent_requirement_regions': {'key': 'optOutContactConsentRequirementRegions', 'type': '[str]'}, 'regions': {'key': 'regions', 'type': '[ProfileRegion]'} } def __init__(self, notice_contact_consent_requirement_regions=None, opt_out_contact_consent_requirement_regions=None, regions=None): super(ProfileRegions, self).__init__() self.notice_contact_consent_requirement_regions = notice_contact_consent_requirement_regions self.opt_out_contact_consent_requirement_regions = opt_out_contact_consent_requirement_regions self.regions = regions class RemoteProfile(Model): """RemoteProfile. :param avatar: :type avatar: str :param country_code: :type country_code: str :param display_name: :type display_name: str :param email_address: Primary contact email from from MSA/AAD :type email_address: str """ _attribute_map = { 'avatar': {'key': 'avatar', 'type': 'str'}, 'country_code': {'key': 'countryCode', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'email_address': {'key': 'emailAddress', 'type': 'str'} } def __init__(self, avatar=None, country_code=None, display_name=None, email_address=None): super(RemoteProfile, self).__init__() self.avatar = avatar self.country_code = country_code self.display_name = display_name self.email_address = email_address class CoreProfileAttribute(ProfileAttributeBase): """CoreProfileAttribute. """ _attribute_map = { } def __init__(self): super(CoreProfileAttribute, self).__init__() class ProfileAttribute(ProfileAttributeBase): """ProfileAttribute. """ _attribute_map = { } def __init__(self): super(ProfileAttribute, self).__init__() __all__ = [ 'AttributeDescriptor', 'AttributesContainer', 'Avatar', 'CreateProfileContext', 'GeoRegion', 'Profile', 'ProfileAttributeBase', 'ProfileRegion', 'ProfileRegions', 'RemoteProfile', 'CoreProfileAttribute', 'ProfileAttribute', ] profile_client.py000066400000000000000000000054471360605530400340200ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/profile# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class ProfileClient(Client): """Profile :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ProfileClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '8ccfef3d-2b87-4e99-8ccb-66e343d2daa8' def get_profile(self, id, details=None, with_attributes=None, partition=None, core_attributes=None, force_refresh=None): """GetProfile. Get my profile. :param str id: :param bool details: :param bool with_attributes: :param str partition: :param str core_attributes: :param bool force_refresh: :rtype: :class:` ` """ route_values = {} if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if details is not None: query_parameters['details'] = self._serialize.query('details', details, 'bool') if with_attributes is not None: query_parameters['withAttributes'] = self._serialize.query('with_attributes', with_attributes, 'bool') if partition is not None: query_parameters['partition'] = self._serialize.query('partition', partition, 'str') if core_attributes is not None: query_parameters['coreAttributes'] = self._serialize.query('core_attributes', core_attributes, 'str') if force_refresh is not None: query_parameters['forceRefresh'] = self._serialize.query('force_refresh', force_refresh, 'bool') response = self._send(http_method='GET', location_id='f83735dc-483f-4238-a291-d45f6080a9af', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Profile', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/project_analysis/000077500000000000000000000000001360605530400324265ustar00rootroot00000000000000__init__.py000066400000000000000000000016051360605530400344620ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/project_analysis# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .project_analysis_client import ProjectAnalysisClient __all__ = [ 'CodeChangeTrendItem', 'LanguageMetricsSecuredObject', 'LanguageStatistics', 'ProjectActivityMetrics', 'ProjectLanguageAnalytics', 'RepositoryActivityMetrics', 'RepositoryLanguageAnalytics', 'ProjectAnalysisClient' ] models.py000066400000000000000000000230351360605530400342070ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/project_analysis# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class CodeChangeTrendItem(Model): """CodeChangeTrendItem. :param time: :type time: datetime :param value: :type value: int """ _attribute_map = { 'time': {'key': 'time', 'type': 'iso-8601'}, 'value': {'key': 'value', 'type': 'int'} } def __init__(self, time=None, value=None): super(CodeChangeTrendItem, self).__init__() self.time = time self.value = value class LanguageMetricsSecuredObject(Model): """LanguageMetricsSecuredObject. :param namespace_id: :type namespace_id: str :param project_id: :type project_id: str :param required_permissions: :type required_permissions: int """ _attribute_map = { 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'required_permissions': {'key': 'requiredPermissions', 'type': 'int'} } def __init__(self, namespace_id=None, project_id=None, required_permissions=None): super(LanguageMetricsSecuredObject, self).__init__() self.namespace_id = namespace_id self.project_id = project_id self.required_permissions = required_permissions class LanguageStatistics(LanguageMetricsSecuredObject): """LanguageStatistics. :param namespace_id: :type namespace_id: str :param project_id: :type project_id: str :param required_permissions: :type required_permissions: int :param bytes: :type bytes: long :param files: :type files: int :param files_percentage: :type files_percentage: float :param language_percentage: :type language_percentage: float :param name: :type name: str """ _attribute_map = { 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'required_permissions': {'key': 'requiredPermissions', 'type': 'int'}, 'bytes': {'key': 'bytes', 'type': 'long'}, 'files': {'key': 'files', 'type': 'int'}, 'files_percentage': {'key': 'filesPercentage', 'type': 'float'}, 'language_percentage': {'key': 'languagePercentage', 'type': 'float'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, namespace_id=None, project_id=None, required_permissions=None, bytes=None, files=None, files_percentage=None, language_percentage=None, name=None): super(LanguageStatistics, self).__init__(namespace_id=namespace_id, project_id=project_id, required_permissions=required_permissions) self.bytes = bytes self.files = files self.files_percentage = files_percentage self.language_percentage = language_percentage self.name = name class ProjectActivityMetrics(Model): """ProjectActivityMetrics. :param authors_count: :type authors_count: int :param code_changes_count: :type code_changes_count: int :param code_changes_trend: :type code_changes_trend: list of :class:`CodeChangeTrendItem ` :param project_id: :type project_id: str :param pull_requests_completed_count: :type pull_requests_completed_count: int :param pull_requests_created_count: :type pull_requests_created_count: int """ _attribute_map = { 'authors_count': {'key': 'authorsCount', 'type': 'int'}, 'code_changes_count': {'key': 'codeChangesCount', 'type': 'int'}, 'code_changes_trend': {'key': 'codeChangesTrend', 'type': '[CodeChangeTrendItem]'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'pull_requests_completed_count': {'key': 'pullRequestsCompletedCount', 'type': 'int'}, 'pull_requests_created_count': {'key': 'pullRequestsCreatedCount', 'type': 'int'} } def __init__(self, authors_count=None, code_changes_count=None, code_changes_trend=None, project_id=None, pull_requests_completed_count=None, pull_requests_created_count=None): super(ProjectActivityMetrics, self).__init__() self.authors_count = authors_count self.code_changes_count = code_changes_count self.code_changes_trend = code_changes_trend self.project_id = project_id self.pull_requests_completed_count = pull_requests_completed_count self.pull_requests_created_count = pull_requests_created_count class ProjectLanguageAnalytics(LanguageMetricsSecuredObject): """ProjectLanguageAnalytics. :param namespace_id: :type namespace_id: str :param project_id: :type project_id: str :param required_permissions: :type required_permissions: int :param id: :type id: str :param language_breakdown: :type language_breakdown: list of :class:`LanguageStatistics ` :param repository_language_analytics: :type repository_language_analytics: list of :class:`RepositoryLanguageAnalytics ` :param result_phase: :type result_phase: object :param url: :type url: str """ _attribute_map = { 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'required_permissions': {'key': 'requiredPermissions', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'language_breakdown': {'key': 'languageBreakdown', 'type': '[LanguageStatistics]'}, 'repository_language_analytics': {'key': 'repositoryLanguageAnalytics', 'type': '[RepositoryLanguageAnalytics]'}, 'result_phase': {'key': 'resultPhase', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, namespace_id=None, project_id=None, required_permissions=None, id=None, language_breakdown=None, repository_language_analytics=None, result_phase=None, url=None): super(ProjectLanguageAnalytics, self).__init__(namespace_id=namespace_id, project_id=project_id, required_permissions=required_permissions) self.id = id self.language_breakdown = language_breakdown self.repository_language_analytics = repository_language_analytics self.result_phase = result_phase self.url = url class RepositoryActivityMetrics(Model): """RepositoryActivityMetrics. :param code_changes_count: :type code_changes_count: int :param code_changes_trend: :type code_changes_trend: list of :class:`CodeChangeTrendItem ` :param repository_id: :type repository_id: str """ _attribute_map = { 'code_changes_count': {'key': 'codeChangesCount', 'type': 'int'}, 'code_changes_trend': {'key': 'codeChangesTrend', 'type': '[CodeChangeTrendItem]'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'} } def __init__(self, code_changes_count=None, code_changes_trend=None, repository_id=None): super(RepositoryActivityMetrics, self).__init__() self.code_changes_count = code_changes_count self.code_changes_trend = code_changes_trend self.repository_id = repository_id class RepositoryLanguageAnalytics(LanguageMetricsSecuredObject): """RepositoryLanguageAnalytics. :param namespace_id: :type namespace_id: str :param project_id: :type project_id: str :param required_permissions: :type required_permissions: int :param id: :type id: str :param language_breakdown: :type language_breakdown: list of :class:`LanguageStatistics ` :param name: :type name: str :param result_phase: :type result_phase: object :param updated_time: :type updated_time: datetime """ _attribute_map = { 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'required_permissions': {'key': 'requiredPermissions', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'language_breakdown': {'key': 'languageBreakdown', 'type': '[LanguageStatistics]'}, 'name': {'key': 'name', 'type': 'str'}, 'result_phase': {'key': 'resultPhase', 'type': 'object'}, 'updated_time': {'key': 'updatedTime', 'type': 'iso-8601'} } def __init__(self, namespace_id=None, project_id=None, required_permissions=None, id=None, language_breakdown=None, name=None, result_phase=None, updated_time=None): super(RepositoryLanguageAnalytics, self).__init__(namespace_id=namespace_id, project_id=project_id, required_permissions=required_permissions) self.id = id self.language_breakdown = language_breakdown self.name = name self.result_phase = result_phase self.updated_time = updated_time __all__ = [ 'CodeChangeTrendItem', 'LanguageMetricsSecuredObject', 'LanguageStatistics', 'ProjectActivityMetrics', 'ProjectLanguageAnalytics', 'RepositoryActivityMetrics', 'RepositoryLanguageAnalytics', ] project_analysis_client.py000066400000000000000000000144571360605530400376430ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/project_analysis# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class ProjectAnalysisClient(Client): """ProjectAnalysis :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ProjectAnalysisClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '7658fa33-b1bf-4580-990f-fac5896773d3' def get_project_language_analytics(self, project): """GetProjectLanguageAnalytics. [Preview API] :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='5b02a779-1867-433f-90b7-d23ed5e33e57', version='5.0-preview.1', route_values=route_values) return self._deserialize('ProjectLanguageAnalytics', response) def get_project_activity_metrics(self, project, from_date, aggregation_type): """GetProjectActivityMetrics. [Preview API] :param str project: Project ID or project name :param datetime from_date: :param str aggregation_type: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if from_date is not None: query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'iso-8601') if aggregation_type is not None: query_parameters['aggregationType'] = self._serialize.query('aggregation_type', aggregation_type, 'str') response = self._send(http_method='GET', location_id='e40ae584-9ea6-4f06-a7c7-6284651b466b', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ProjectActivityMetrics', response) def get_git_repositories_activity_metrics(self, project, from_date, aggregation_type, skip, top): """GetGitRepositoriesActivityMetrics. [Preview API] Retrieves git activity metrics for repositories matching a specified criteria. :param str project: Project ID or project name :param datetime from_date: Date from which, the trends are to be fetched. :param str aggregation_type: Bucket size on which, trends are to be aggregated. :param int skip: The number of repositories to ignore. :param int top: The number of repositories for which activity metrics are to be retrieved. :rtype: [RepositoryActivityMetrics] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if from_date is not None: query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'iso-8601') if aggregation_type is not None: query_parameters['aggregationType'] = self._serialize.query('aggregation_type', aggregation_type, 'str') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='df7fbbca-630a-40e3-8aa3-7a3faf66947e', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[RepositoryActivityMetrics]', self._unwrap_collection(response)) def get_repository_activity_metrics(self, project, repository_id, from_date, aggregation_type): """GetRepositoryActivityMetrics. [Preview API] :param str project: Project ID or project name :param str repository_id: :param datetime from_date: :param str aggregation_type: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repository_id is not None: route_values['repositoryId'] = self._serialize.url('repository_id', repository_id, 'str') query_parameters = {} if from_date is not None: query_parameters['fromDate'] = self._serialize.query('from_date', from_date, 'iso-8601') if aggregation_type is not None: query_parameters['aggregationType'] = self._serialize.query('aggregation_type', aggregation_type, 'str') response = self._send(http_method='GET', location_id='df7fbbca-630a-40e3-8aa3-7a3faf66947e', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('RepositoryActivityMetrics', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/provenance/000077500000000000000000000000001360605530400312155ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/provenance/__init__.py000066400000000000000000000013071360605530400333270ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .provenance_client import ProvenanceClient __all__ = [ 'SessionRequest', 'SessionResponse', 'ProvenanceClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/provenance/models.py000066400000000000000000000037201360605530400330540ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class SessionRequest(Model): """SessionRequest. :param data: Generic property bag to store data about the session :type data: dict :param feed: The feed name or id for the session :type feed: str :param source: The type of session If a known value is provided, the Data dictionary will be validated for the presence of properties required by that type :type source: str """ _attribute_map = { 'data': {'key': 'data', 'type': '{str}'}, 'feed': {'key': 'feed', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'} } def __init__(self, data=None, feed=None, source=None): super(SessionRequest, self).__init__() self.data = data self.feed = feed self.source = source class SessionResponse(Model): """SessionResponse. :param session_id: The unique identifier for the session :type session_id: str :param session_name: The name for the session :type session_name: str """ _attribute_map = { 'session_id': {'key': 'sessionId', 'type': 'str'}, 'session_name': {'key': 'sessionName', 'type': 'str'} } def __init__(self, session_id=None, session_name=None): super(SessionResponse, self).__init__() self.session_id = session_id self.session_name = session_name __all__ = [ 'SessionRequest', 'SessionResponse', ] provenance_client.py000066400000000000000000000044131360605530400352100ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/provenance# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class ProvenanceClient(Client): """Provenance :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ProvenanceClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'b40c1171-807a-493a-8f3f-5c26d5e2f5aa' def create_session(self, session_request, protocol): """CreateSession. [Preview API] Creates a session, a wrapper around a feed that can store additional metadata on the packages published to it. :param :class:` ` session_request: The feed and metadata for the session :param str protocol: The protocol that the session will target :rtype: :class:` ` """ route_values = {} if protocol is not None: route_values['protocol'] = self._serialize.url('protocol', protocol, 'str') content = self._serialize.body(session_request, 'SessionRequest') response = self._send(http_method='POST', location_id='503b4e54-ebf4-4d04-8eee-21c00823c2ac', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('SessionResponse', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/py_pi_api/000077500000000000000000000000001360605530400310265ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/py_pi_api/__init__.py000066400000000000000000000016301360605530400331370ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .py_pi_api_client import PyPiApiClient __all__ = [ 'BatchOperationData', 'JsonPatchOperation', 'MinimalPackageDetails', 'Package', 'PackageVersionDetails', 'PyPiPackagesBatchRequest', 'PyPiPackageVersionDeletionState', 'PyPiRecycleBinPackageVersionDetails', 'ReferenceLinks', 'PyPiApiClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/py_pi_api/models.py000066400000000000000000000153201360605530400326640ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class BatchOperationData(Model): """BatchOperationData. """ _attribute_map = { } def __init__(self): super(BatchOperationData, self).__init__() class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class MinimalPackageDetails(Model): """MinimalPackageDetails. :param id: Package name. :type id: str :param version: Package version. :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, version=None): super(MinimalPackageDetails, self).__init__() self.id = id self.version = version class Package(Model): """Package. :param _links: Related REST links. :type _links: :class:`ReferenceLinks ` :param deleted_date: If and when the package was deleted. :type deleted_date: datetime :param id: Package Id. :type id: str :param name: The display name of the package. :type name: str :param permanently_deleted_date: If and when the package was permanently deleted. :type permanently_deleted_date: datetime :param version: The version of the package. :type version: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'permanently_deleted_date': {'key': 'permanentlyDeletedDate', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, _links=None, deleted_date=None, id=None, name=None, permanently_deleted_date=None, version=None): super(Package, self).__init__() self._links = _links self.deleted_date = deleted_date self.id = id self.name = name self.permanently_deleted_date = permanently_deleted_date self.version = version class PackageVersionDetails(Model): """PackageVersionDetails. :param views: The view to which the package version will be added :type views: :class:`JsonPatchOperation ` """ _attribute_map = { 'views': {'key': 'views', 'type': 'JsonPatchOperation'} } def __init__(self, views=None): super(PackageVersionDetails, self).__init__() self.views = views class PyPiPackagesBatchRequest(Model): """PyPiPackagesBatchRequest. :param data: Data required to perform the operation. This is optional based on the type of the operation. Use BatchPromoteData if performing a promote operation. :type data: :class:`BatchOperationData ` :param operation: Type of operation that needs to be performed on packages. :type operation: object :param packages: The packages onto which the operation will be performed. :type packages: list of :class:`MinimalPackageDetails ` """ _attribute_map = { 'data': {'key': 'data', 'type': 'BatchOperationData'}, 'operation': {'key': 'operation', 'type': 'object'}, 'packages': {'key': 'packages', 'type': '[MinimalPackageDetails]'} } def __init__(self, data=None, operation=None, packages=None): super(PyPiPackagesBatchRequest, self).__init__() self.data = data self.operation = operation self.packages = packages class PyPiPackageVersionDeletionState(Model): """PyPiPackageVersionDeletionState. :param deleted_date: UTC date the package was deleted. :type deleted_date: datetime :param name: Name of the package. :type name: str :param version: Version of the package. :type version: str """ _attribute_map = { 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, deleted_date=None, name=None, version=None): super(PyPiPackageVersionDeletionState, self).__init__() self.deleted_date = deleted_date self.name = name self.version = version class PyPiRecycleBinPackageVersionDetails(Model): """PyPiRecycleBinPackageVersionDetails. :param deleted: Setting to false will undo earlier deletion and restore the package to feed. :type deleted: bool """ _attribute_map = { 'deleted': {'key': 'deleted', 'type': 'bool'} } def __init__(self, deleted=None): super(PyPiRecycleBinPackageVersionDetails, self).__init__() self.deleted = deleted class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links __all__ = [ 'BatchOperationData', 'JsonPatchOperation', 'MinimalPackageDetails', 'Package', 'PackageVersionDetails', 'PyPiPackagesBatchRequest', 'PyPiPackageVersionDeletionState', 'PyPiRecycleBinPackageVersionDetails', 'ReferenceLinks', ] py_pi_api_client.py000066400000000000000000000240541360605530400346350ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/py_pi_api# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class PyPiApiClient(Client): """PyPiApi :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(PyPiApiClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '92f0314b-06c5-46e0-abe7-15fd9d13276a' def download_package(self, feed_id, package_name, package_version, file_name): """DownloadPackage. [Preview API] Download a python package file directly. This API is intended for manual UI download options, not for programmatic access and scripting. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :param str file_name: Name of the file in the package :rtype: object """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') if file_name is not None: route_values['fileName'] = self._serialize.url('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='97218bae-a64d-4381-9257-b5b7951f0b98', version='5.0-preview.1', route_values=route_values) return self._deserialize('object', response) def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version): """DeletePackageVersionFromRecycleBin. [Preview API] Delete a package version from the feed, moving it to the recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') self._send(http_method='DELETE', location_id='07143752-3d94-45fd-86c2-0c77ed87847b', version='5.0-preview.1', route_values=route_values) def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version): """GetPackageVersionMetadataFromRecycleBin. [Preview API] Get information about a package version in the recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='07143752-3d94-45fd-86c2-0c77ed87847b', version='5.0-preview.1', route_values=route_values) return self._deserialize('PyPiPackageVersionDeletionState', response) def restore_package_version_from_recycle_bin(self, package_version_details, feed_id, package_name, package_version): """RestorePackageVersionFromRecycleBin. [Preview API] Restore a package version from the recycle bin to its associated feed. :param :class:` ` package_version_details: Set the 'Deleted' state to 'false' to restore the package to its feed. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'PyPiRecycleBinPackageVersionDetails') self._send(http_method='PATCH', location_id='07143752-3d94-45fd-86c2-0c77ed87847b', version='5.0-preview.1', route_values=route_values, content=content) def delete_package_version(self, feed_id, package_name, package_version): """DeletePackageVersion. [Preview API] Delete a package version, moving it to the recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='DELETE', location_id='d146ac7e-9e3f-4448-b956-f9bb3bdf9b2e', version='5.0-preview.1', route_values=route_values) return self._deserialize('Package', response) def get_package_version(self, feed_id, package_name, package_version, show_deleted=None): """GetPackageVersion. [Preview API] Get information about a package version. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :param bool show_deleted: True to show information for deleted package versions. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') query_parameters = {} if show_deleted is not None: query_parameters['showDeleted'] = self._serialize.query('show_deleted', show_deleted, 'bool') response = self._send(http_method='GET', location_id='d146ac7e-9e3f-4448-b956-f9bb3bdf9b2e', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Package', response) def update_package_version(self, package_version_details, feed_id, package_name, package_version): """UpdatePackageVersion. [Preview API] Update state for a package version. :param :class:` ` package_version_details: Details to be updated. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'PackageVersionDetails') self._send(http_method='PATCH', location_id='d146ac7e-9e3f-4448-b956-f9bb3bdf9b2e', version='5.0-preview.1', route_values=route_values, content=content) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/release/000077500000000000000000000000001360605530400304755ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/release/__init__.py000066400000000000000000000062421360605530400326120ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .release_client import ReleaseClient __all__ = [ 'AgentArtifactDefinition', 'ApprovalOptions', 'Artifact', 'ArtifactMetadata', 'ArtifactSourceReference', 'ArtifactTriggerConfiguration', 'ArtifactTypeDefinition', 'ArtifactVersion', 'ArtifactVersionQueryResult', 'AuthorizationHeader', 'AutoTriggerIssue', 'BuildVersion', 'Change', 'Condition', 'ConfigurationVariableValue', 'DataSourceBindingBase', 'DefinitionEnvironmentReference', 'Deployment', 'DeploymentAttempt', 'DeploymentJob', 'DeploymentQueryParameters', 'EmailRecipients', 'EnvironmentExecutionPolicy', 'EnvironmentOptions', 'EnvironmentRetentionPolicy', 'EnvironmentTrigger', 'FavoriteItem', 'Folder', 'GateUpdateMetadata', 'GraphSubjectBase', 'IdentityRef', 'IgnoredGate', 'InputDescriptor', 'InputValidation', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'Issue', 'MailMessage', 'ManualIntervention', 'ManualInterventionUpdateMetadata', 'Metric', 'PipelineProcess', 'ProcessParameters', 'ProjectReference', 'QueuedReleaseData', 'ReferenceLinks', 'Release', 'ReleaseApproval', 'ReleaseApprovalHistory', 'ReleaseCondition', 'ReleaseDefinition', 'ReleaseDefinitionApprovals', 'ReleaseDefinitionApprovalStep', 'ReleaseDefinitionDeployStep', 'ReleaseDefinitionEnvironment', 'ReleaseDefinitionEnvironmentStep', 'ReleaseDefinitionEnvironmentSummary', 'ReleaseDefinitionEnvironmentTemplate', 'ReleaseDefinitionGate', 'ReleaseDefinitionGatesOptions', 'ReleaseDefinitionGatesStep', 'ReleaseDefinitionRevision', 'ReleaseDefinitionShallowReference', 'ReleaseDefinitionSummary', 'ReleaseDefinitionUndeleteParameter', 'ReleaseDeployPhase', 'ReleaseEnvironment', 'ReleaseEnvironmentShallowReference', 'ReleaseEnvironmentUpdateMetadata', 'ReleaseGates', 'ReleaseReference', 'ReleaseRevision', 'ReleaseSchedule', 'ReleaseSettings', 'ReleaseShallowReference', 'ReleaseStartEnvironmentMetadata', 'ReleaseStartMetadata', 'ReleaseTask', 'ReleaseTaskAttachment', 'ReleaseUpdateMetadata', 'ReleaseWorkItemRef', 'RetentionPolicy', 'RetentionSettings', 'SourcePullRequestVersion', 'SummaryMailSection', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskSourceDefinitionBase', 'VariableGroup', 'VariableGroupProviderData', 'VariableValue', 'WorkflowTask', 'WorkflowTaskReference', 'ReleaseClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/release/models.py000066400000000000000000004655321360605530400323510ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AgentArtifactDefinition(Model): """AgentArtifactDefinition. :param alias: :type alias: str :param artifact_type: :type artifact_type: object :param details: :type details: str :param name: :type name: str :param version: :type version: str """ _attribute_map = { 'alias': {'key': 'alias', 'type': 'str'}, 'artifact_type': {'key': 'artifactType', 'type': 'object'}, 'details': {'key': 'details', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, alias=None, artifact_type=None, details=None, name=None, version=None): super(AgentArtifactDefinition, self).__init__() self.alias = alias self.artifact_type = artifact_type self.details = details self.name = name self.version = version class ApprovalOptions(Model): """ApprovalOptions. :param auto_triggered_and_previous_environment_approved_can_be_skipped: :type auto_triggered_and_previous_environment_approved_can_be_skipped: bool :param enforce_identity_revalidation: :type enforce_identity_revalidation: bool :param execution_order: :type execution_order: object :param release_creator_can_be_approver: :type release_creator_can_be_approver: bool :param required_approver_count: :type required_approver_count: int :param timeout_in_minutes: :type timeout_in_minutes: int """ _attribute_map = { 'auto_triggered_and_previous_environment_approved_can_be_skipped': {'key': 'autoTriggeredAndPreviousEnvironmentApprovedCanBeSkipped', 'type': 'bool'}, 'enforce_identity_revalidation': {'key': 'enforceIdentityRevalidation', 'type': 'bool'}, 'execution_order': {'key': 'executionOrder', 'type': 'object'}, 'release_creator_can_be_approver': {'key': 'releaseCreatorCanBeApprover', 'type': 'bool'}, 'required_approver_count': {'key': 'requiredApproverCount', 'type': 'int'}, 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} } def __init__(self, auto_triggered_and_previous_environment_approved_can_be_skipped=None, enforce_identity_revalidation=None, execution_order=None, release_creator_can_be_approver=None, required_approver_count=None, timeout_in_minutes=None): super(ApprovalOptions, self).__init__() self.auto_triggered_and_previous_environment_approved_can_be_skipped = auto_triggered_and_previous_environment_approved_can_be_skipped self.enforce_identity_revalidation = enforce_identity_revalidation self.execution_order = execution_order self.release_creator_can_be_approver = release_creator_can_be_approver self.required_approver_count = required_approver_count self.timeout_in_minutes = timeout_in_minutes class Artifact(Model): """Artifact. :param alias: Gets or sets alias. :type alias: str :param definition_reference: Gets or sets definition reference. e.g. {"project":{"id":"fed755ea-49c5-4399-acea-fd5b5aa90a6c","name":"myProject"},"definition":{"id":"1","name":"mybuildDefinition"},"connection":{"id":"1","name":"myConnection"}} :type definition_reference: dict :param is_primary: Gets or sets as artifact is primary or not. :type is_primary: bool :param is_retained: :type is_retained: bool :param source_id: :type source_id: str :param type: Gets or sets type. It can have value as 'Build', 'Jenkins', 'GitHub', 'Nuget', 'Team Build (external)', 'ExternalTFSBuild', 'Git', 'TFVC', 'ExternalTfsXamlBuild'. :type type: str """ _attribute_map = { 'alias': {'key': 'alias', 'type': 'str'}, 'definition_reference': {'key': 'definitionReference', 'type': '{ArtifactSourceReference}'}, 'is_primary': {'key': 'isPrimary', 'type': 'bool'}, 'is_retained': {'key': 'isRetained', 'type': 'bool'}, 'source_id': {'key': 'sourceId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, alias=None, definition_reference=None, is_primary=None, is_retained=None, source_id=None, type=None): super(Artifact, self).__init__() self.alias = alias self.definition_reference = definition_reference self.is_primary = is_primary self.is_retained = is_retained self.source_id = source_id self.type = type class ArtifactMetadata(Model): """ArtifactMetadata. :param alias: Sets alias of artifact. :type alias: str :param instance_reference: Sets instance reference of artifact. e.g. for build artifact it is build number. :type instance_reference: :class:`BuildVersion ` """ _attribute_map = { 'alias': {'key': 'alias', 'type': 'str'}, 'instance_reference': {'key': 'instanceReference', 'type': 'BuildVersion'} } def __init__(self, alias=None, instance_reference=None): super(ArtifactMetadata, self).__init__() self.alias = alias self.instance_reference = instance_reference class ArtifactSourceReference(Model): """ArtifactSourceReference. :param id: :type id: str :param name: :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(ArtifactSourceReference, self).__init__() self.id = id self.name = name class ArtifactTriggerConfiguration(Model): """ArtifactTriggerConfiguration. :param is_trigger_supported: :type is_trigger_supported: bool :param is_trigger_supported_only_in_hosted: :type is_trigger_supported_only_in_hosted: bool :param is_webhook_supported_at_server_level: :type is_webhook_supported_at_server_level: bool :param payload_hash_header_name: :type payload_hash_header_name: str :param resources: :type resources: dict :param webhook_payload_mapping: :type webhook_payload_mapping: dict """ _attribute_map = { 'is_trigger_supported': {'key': 'isTriggerSupported', 'type': 'bool'}, 'is_trigger_supported_only_in_hosted': {'key': 'isTriggerSupportedOnlyInHosted', 'type': 'bool'}, 'is_webhook_supported_at_server_level': {'key': 'isWebhookSupportedAtServerLevel', 'type': 'bool'}, 'payload_hash_header_name': {'key': 'payloadHashHeaderName', 'type': 'str'}, 'resources': {'key': 'resources', 'type': '{str}'}, 'webhook_payload_mapping': {'key': 'webhookPayloadMapping', 'type': '{str}'} } def __init__(self, is_trigger_supported=None, is_trigger_supported_only_in_hosted=None, is_webhook_supported_at_server_level=None, payload_hash_header_name=None, resources=None, webhook_payload_mapping=None): super(ArtifactTriggerConfiguration, self).__init__() self.is_trigger_supported = is_trigger_supported self.is_trigger_supported_only_in_hosted = is_trigger_supported_only_in_hosted self.is_webhook_supported_at_server_level = is_webhook_supported_at_server_level self.payload_hash_header_name = payload_hash_header_name self.resources = resources self.webhook_payload_mapping = webhook_payload_mapping class ArtifactTypeDefinition(Model): """ArtifactTypeDefinition. :param artifact_trigger_configuration: :type artifact_trigger_configuration: :class:`ArtifactTriggerConfiguration ` :param artifact_type: :type artifact_type: str :param display_name: :type display_name: str :param endpoint_type_id: :type endpoint_type_id: str :param input_descriptors: :type input_descriptors: list of :class:`InputDescriptor ` :param name: :type name: str :param unique_source_identifier: :type unique_source_identifier: str """ _attribute_map = { 'artifact_trigger_configuration': {'key': 'artifactTriggerConfiguration', 'type': 'ArtifactTriggerConfiguration'}, 'artifact_type': {'key': 'artifactType', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'endpoint_type_id': {'key': 'endpointTypeId', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'name': {'key': 'name', 'type': 'str'}, 'unique_source_identifier': {'key': 'uniqueSourceIdentifier', 'type': 'str'} } def __init__(self, artifact_trigger_configuration=None, artifact_type=None, display_name=None, endpoint_type_id=None, input_descriptors=None, name=None, unique_source_identifier=None): super(ArtifactTypeDefinition, self).__init__() self.artifact_trigger_configuration = artifact_trigger_configuration self.artifact_type = artifact_type self.display_name = display_name self.endpoint_type_id = endpoint_type_id self.input_descriptors = input_descriptors self.name = name self.unique_source_identifier = unique_source_identifier class ArtifactVersion(Model): """ArtifactVersion. :param alias: :type alias: str :param default_version: :type default_version: :class:`BuildVersion ` :param error_message: :type error_message: str :param source_id: :type source_id: str :param versions: :type versions: list of :class:`BuildVersion ` """ _attribute_map = { 'alias': {'key': 'alias', 'type': 'str'}, 'default_version': {'key': 'defaultVersion', 'type': 'BuildVersion'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'source_id': {'key': 'sourceId', 'type': 'str'}, 'versions': {'key': 'versions', 'type': '[BuildVersion]'} } def __init__(self, alias=None, default_version=None, error_message=None, source_id=None, versions=None): super(ArtifactVersion, self).__init__() self.alias = alias self.default_version = default_version self.error_message = error_message self.source_id = source_id self.versions = versions class ArtifactVersionQueryResult(Model): """ArtifactVersionQueryResult. :param artifact_versions: :type artifact_versions: list of :class:`ArtifactVersion ` """ _attribute_map = { 'artifact_versions': {'key': 'artifactVersions', 'type': '[ArtifactVersion]'} } def __init__(self, artifact_versions=None): super(ArtifactVersionQueryResult, self).__init__() self.artifact_versions = artifact_versions class AuthorizationHeader(Model): """AuthorizationHeader. :param name: :type name: str :param value: :type value: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, name=None, value=None): super(AuthorizationHeader, self).__init__() self.name = name self.value = value class AutoTriggerIssue(Model): """AutoTriggerIssue. :param issue: :type issue: :class:`Issue ` :param issue_source: :type issue_source: object :param project: :type project: :class:`ProjectReference ` :param release_definition_reference: :type release_definition_reference: :class:`ReleaseDefinitionShallowReference ` :param release_trigger_type: :type release_trigger_type: object """ _attribute_map = { 'issue': {'key': 'issue', 'type': 'Issue'}, 'issue_source': {'key': 'issueSource', 'type': 'object'}, 'project': {'key': 'project', 'type': 'ProjectReference'}, 'release_definition_reference': {'key': 'releaseDefinitionReference', 'type': 'ReleaseDefinitionShallowReference'}, 'release_trigger_type': {'key': 'releaseTriggerType', 'type': 'object'} } def __init__(self, issue=None, issue_source=None, project=None, release_definition_reference=None, release_trigger_type=None): super(AutoTriggerIssue, self).__init__() self.issue = issue self.issue_source = issue_source self.project = project self.release_definition_reference = release_definition_reference self.release_trigger_type = release_trigger_type class BuildVersion(Model): """BuildVersion. :param commit_message: :type commit_message: str :param definition_id: :type definition_id: str :param definition_name: :type definition_name: str :param id: :type id: str :param is_multi_definition_type: :type is_multi_definition_type: bool :param name: :type name: str :param source_branch: :type source_branch: str :param source_pull_request_version: :type source_pull_request_version: :class:`SourcePullRequestVersion ` :param source_repository_id: :type source_repository_id: str :param source_repository_type: :type source_repository_type: str :param source_version: :type source_version: str """ _attribute_map = { 'commit_message': {'key': 'commitMessage', 'type': 'str'}, 'definition_id': {'key': 'definitionId', 'type': 'str'}, 'definition_name': {'key': 'definitionName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_multi_definition_type': {'key': 'isMultiDefinitionType', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, 'source_pull_request_version': {'key': 'sourcePullRequestVersion', 'type': 'SourcePullRequestVersion'}, 'source_repository_id': {'key': 'sourceRepositoryId', 'type': 'str'}, 'source_repository_type': {'key': 'sourceRepositoryType', 'type': 'str'}, 'source_version': {'key': 'sourceVersion', 'type': 'str'} } def __init__(self, commit_message=None, definition_id=None, definition_name=None, id=None, is_multi_definition_type=None, name=None, source_branch=None, source_pull_request_version=None, source_repository_id=None, source_repository_type=None, source_version=None): super(BuildVersion, self).__init__() self.commit_message = commit_message self.definition_id = definition_id self.definition_name = definition_name self.id = id self.is_multi_definition_type = is_multi_definition_type self.name = name self.source_branch = source_branch self.source_pull_request_version = source_pull_request_version self.source_repository_id = source_repository_id self.source_repository_type = source_repository_type self.source_version = source_version class Change(Model): """Change. :param author: The author of the change. :type author: :class:`IdentityRef ` :param change_type: The type of source. "TfsVersionControl", "TfsGit", etc. :type change_type: str :param display_uri: The location of a user-friendly representation of the resource. :type display_uri: str :param id: Something that identifies the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset id. :type id: str :param location: The location of the full representation of the resource. :type location: str :param message: A description of the change. This might be a commit message or changeset description. :type message: str :param pushed_by: The person or process that pushed the change. :type pushed_by: :class:`IdentityRef ` :param pusher: The person or process that pushed the change. :type pusher: str :param timestamp: A timestamp for the change. :type timestamp: datetime """ _attribute_map = { 'author': {'key': 'author', 'type': 'IdentityRef'}, 'change_type': {'key': 'changeType', 'type': 'str'}, 'display_uri': {'key': 'displayUri', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'pushed_by': {'key': 'pushedBy', 'type': 'IdentityRef'}, 'pusher': {'key': 'pusher', 'type': 'str'}, 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'} } def __init__(self, author=None, change_type=None, display_uri=None, id=None, location=None, message=None, pushed_by=None, pusher=None, timestamp=None): super(Change, self).__init__() self.author = author self.change_type = change_type self.display_uri = display_uri self.id = id self.location = location self.message = message self.pushed_by = pushed_by self.pusher = pusher self.timestamp = timestamp class Condition(Model): """Condition. :param condition_type: Gets or sets the condition type. :type condition_type: object :param name: Gets or sets the name of the condition. e.g. 'ReleaseStarted'. :type name: str :param value: Gets or set value of the condition. :type value: str """ _attribute_map = { 'condition_type': {'key': 'conditionType', 'type': 'object'}, 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, condition_type=None, name=None, value=None): super(Condition, self).__init__() self.condition_type = condition_type self.name = name self.value = value class ConfigurationVariableValue(Model): """ConfigurationVariableValue. :param allow_override: Gets or sets if a variable can be overridden at deployment time or not. :type allow_override: bool :param is_secret: Gets or sets as variable is secret or not. :type is_secret: bool :param value: Gets or sets value of the configuration variable. :type value: str """ _attribute_map = { 'allow_override': {'key': 'allowOverride', 'type': 'bool'}, 'is_secret': {'key': 'isSecret', 'type': 'bool'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, allow_override=None, is_secret=None, value=None): super(ConfigurationVariableValue, self).__init__() self.allow_override = allow_override self.is_secret = is_secret self.value = value class DataSourceBindingBase(Model): """DataSourceBindingBase. :param callback_context_template: Pagination format supported by this data source(ContinuationToken/SkipTop). :type callback_context_template: str :param callback_required_template: Subsequent calls needed? :type callback_required_template: str :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: Defines the initial value of the query params :type initial_context_template: str :param parameters: Gets or sets the parameters for the data source. :type parameters: dict :param result_selector: Gets or sets the result selector. :type result_selector: str :param result_template: Gets or sets the result template. :type result_template: str :param target: Gets or sets the target of the data source. :type target: str """ _attribute_map = { 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'}, 'result_template': {'key': 'resultTemplate', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, callback_context_template=None, callback_required_template=None, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, initial_context_template=None, parameters=None, result_selector=None, result_template=None, target=None): super(DataSourceBindingBase, self).__init__() self.callback_context_template = callback_context_template self.callback_required_template = callback_required_template self.data_source_name = data_source_name self.endpoint_id = endpoint_id self.endpoint_url = endpoint_url self.headers = headers self.initial_context_template = initial_context_template self.parameters = parameters self.result_selector = result_selector self.result_template = result_template self.target = target class DefinitionEnvironmentReference(Model): """DefinitionEnvironmentReference. :param definition_environment_id: :type definition_environment_id: int :param definition_environment_name: :type definition_environment_name: str :param release_definition_id: :type release_definition_id: int :param release_definition_name: :type release_definition_name: str """ _attribute_map = { 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, 'definition_environment_name': {'key': 'definitionEnvironmentName', 'type': 'str'}, 'release_definition_id': {'key': 'releaseDefinitionId', 'type': 'int'}, 'release_definition_name': {'key': 'releaseDefinitionName', 'type': 'str'} } def __init__(self, definition_environment_id=None, definition_environment_name=None, release_definition_id=None, release_definition_name=None): super(DefinitionEnvironmentReference, self).__init__() self.definition_environment_id = definition_environment_id self.definition_environment_name = definition_environment_name self.release_definition_id = release_definition_id self.release_definition_name = release_definition_name class Deployment(Model): """Deployment. :param _links: Gets links to access the deployment. :type _links: :class:`ReferenceLinks ` :param attempt: Gets attempt number. :type attempt: int :param completed_on: Gets the date on which deployment is complete. :type completed_on: datetime :param conditions: Gets the list of condition associated with deployment. :type conditions: list of :class:`Condition ` :param definition_environment_id: Gets release definition environment id. :type definition_environment_id: int :param deployment_status: Gets status of the deployment. :type deployment_status: object :param id: Gets the unique identifier for deployment. :type id: int :param last_modified_by: Gets the identity who last modified the deployment. :type last_modified_by: :class:`IdentityRef ` :param last_modified_on: Gets the date on which deployment is last modified. :type last_modified_on: datetime :param operation_status: Gets operation status of deployment. :type operation_status: object :param post_deploy_approvals: Gets list of PostDeployApprovals. :type post_deploy_approvals: list of :class:`ReleaseApproval ` :param pre_deploy_approvals: Gets list of PreDeployApprovals. :type pre_deploy_approvals: list of :class:`ReleaseApproval ` :param project_reference: Gets or sets project reference. :type project_reference: :class:`ProjectReference ` :param queued_on: Gets the date on which deployment is queued. :type queued_on: datetime :param reason: Gets reason of deployment. :type reason: object :param release: Gets the reference of release. :type release: :class:`ReleaseReference ` :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which the deployment is associated. :type release_definition: :class:`ReleaseDefinitionShallowReference ` :param release_environment: Gets releaseEnvironmentReference which specifies the reference of the release environment to which the deployment is associated. :type release_environment: :class:`ReleaseEnvironmentShallowReference ` :param requested_by: Gets the identity who requested. :type requested_by: :class:`IdentityRef ` :param requested_for: Gets the identity for whom deployment is requested. :type requested_for: :class:`IdentityRef ` :param scheduled_deployment_time: Gets the date on which deployment is scheduled. :type scheduled_deployment_time: datetime :param started_on: Gets the date on which deployment is started. :type started_on: datetime """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'attempt': {'key': 'attempt', 'type': 'int'}, 'completed_on': {'key': 'completedOn', 'type': 'iso-8601'}, 'conditions': {'key': 'conditions', 'type': '[Condition]'}, 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, 'deployment_status': {'key': 'deploymentStatus', 'type': 'object'}, 'id': {'key': 'id', 'type': 'int'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, 'operation_status': {'key': 'operationStatus', 'type': 'object'}, 'post_deploy_approvals': {'key': 'postDeployApprovals', 'type': '[ReleaseApproval]'}, 'pre_deploy_approvals': {'key': 'preDeployApprovals', 'type': '[ReleaseApproval]'}, 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, 'queued_on': {'key': 'queuedOn', 'type': 'iso-8601'}, 'reason': {'key': 'reason', 'type': 'object'}, 'release': {'key': 'release', 'type': 'ReleaseReference'}, 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, 'release_environment': {'key': 'releaseEnvironment', 'type': 'ReleaseEnvironmentShallowReference'}, 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, 'requested_for': {'key': 'requestedFor', 'type': 'IdentityRef'}, 'scheduled_deployment_time': {'key': 'scheduledDeploymentTime', 'type': 'iso-8601'}, 'started_on': {'key': 'startedOn', 'type': 'iso-8601'} } def __init__(self, _links=None, attempt=None, completed_on=None, conditions=None, definition_environment_id=None, deployment_status=None, id=None, last_modified_by=None, last_modified_on=None, operation_status=None, post_deploy_approvals=None, pre_deploy_approvals=None, project_reference=None, queued_on=None, reason=None, release=None, release_definition=None, release_environment=None, requested_by=None, requested_for=None, scheduled_deployment_time=None, started_on=None): super(Deployment, self).__init__() self._links = _links self.attempt = attempt self.completed_on = completed_on self.conditions = conditions self.definition_environment_id = definition_environment_id self.deployment_status = deployment_status self.id = id self.last_modified_by = last_modified_by self.last_modified_on = last_modified_on self.operation_status = operation_status self.post_deploy_approvals = post_deploy_approvals self.pre_deploy_approvals = pre_deploy_approvals self.project_reference = project_reference self.queued_on = queued_on self.reason = reason self.release = release self.release_definition = release_definition self.release_environment = release_environment self.requested_by = requested_by self.requested_for = requested_for self.scheduled_deployment_time = scheduled_deployment_time self.started_on = started_on class DeploymentAttempt(Model): """DeploymentAttempt. :param attempt: :type attempt: int :param deployment_id: :type deployment_id: int :param error_log: Error log to show any unexpected error that occurred during executing deploy step :type error_log: str :param has_started: Specifies whether deployment has started or not :type has_started: bool :param id: :type id: int :param issues: All the issues related to the deployment :type issues: list of :class:`Issue ` :param job: :type job: :class:`ReleaseTask ` :param last_modified_by: :type last_modified_by: :class:`IdentityRef ` :param last_modified_on: :type last_modified_on: datetime :param operation_status: :type operation_status: object :param post_deployment_gates: :type post_deployment_gates: :class:`ReleaseGates ` :param pre_deployment_gates: :type pre_deployment_gates: :class:`ReleaseGates ` :param queued_on: :type queued_on: datetime :param reason: :type reason: object :param release_deploy_phases: :type release_deploy_phases: list of :class:`ReleaseDeployPhase ` :param requested_by: :type requested_by: :class:`IdentityRef ` :param requested_for: :type requested_for: :class:`IdentityRef ` :param run_plan_id: :type run_plan_id: str :param status: :type status: object :param tasks: :type tasks: list of :class:`ReleaseTask ` """ _attribute_map = { 'attempt': {'key': 'attempt', 'type': 'int'}, 'deployment_id': {'key': 'deploymentId', 'type': 'int'}, 'error_log': {'key': 'errorLog', 'type': 'str'}, 'has_started': {'key': 'hasStarted', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'int'}, 'issues': {'key': 'issues', 'type': '[Issue]'}, 'job': {'key': 'job', 'type': 'ReleaseTask'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, 'operation_status': {'key': 'operationStatus', 'type': 'object'}, 'post_deployment_gates': {'key': 'postDeploymentGates', 'type': 'ReleaseGates'}, 'pre_deployment_gates': {'key': 'preDeploymentGates', 'type': 'ReleaseGates'}, 'queued_on': {'key': 'queuedOn', 'type': 'iso-8601'}, 'reason': {'key': 'reason', 'type': 'object'}, 'release_deploy_phases': {'key': 'releaseDeployPhases', 'type': '[ReleaseDeployPhase]'}, 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, 'requested_for': {'key': 'requestedFor', 'type': 'IdentityRef'}, 'run_plan_id': {'key': 'runPlanId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'tasks': {'key': 'tasks', 'type': '[ReleaseTask]'} } def __init__(self, attempt=None, deployment_id=None, error_log=None, has_started=None, id=None, issues=None, job=None, last_modified_by=None, last_modified_on=None, operation_status=None, post_deployment_gates=None, pre_deployment_gates=None, queued_on=None, reason=None, release_deploy_phases=None, requested_by=None, requested_for=None, run_plan_id=None, status=None, tasks=None): super(DeploymentAttempt, self).__init__() self.attempt = attempt self.deployment_id = deployment_id self.error_log = error_log self.has_started = has_started self.id = id self.issues = issues self.job = job self.last_modified_by = last_modified_by self.last_modified_on = last_modified_on self.operation_status = operation_status self.post_deployment_gates = post_deployment_gates self.pre_deployment_gates = pre_deployment_gates self.queued_on = queued_on self.reason = reason self.release_deploy_phases = release_deploy_phases self.requested_by = requested_by self.requested_for = requested_for self.run_plan_id = run_plan_id self.status = status self.tasks = tasks class DeploymentJob(Model): """DeploymentJob. :param job: :type job: :class:`ReleaseTask ` :param tasks: :type tasks: list of :class:`ReleaseTask ` """ _attribute_map = { 'job': {'key': 'job', 'type': 'ReleaseTask'}, 'tasks': {'key': 'tasks', 'type': '[ReleaseTask]'} } def __init__(self, job=None, tasks=None): super(DeploymentJob, self).__init__() self.job = job self.tasks = tasks class DeploymentQueryParameters(Model): """DeploymentQueryParameters. :param artifact_source_id: :type artifact_source_id: str :param artifact_type_id: :type artifact_type_id: str :param artifact_versions: :type artifact_versions: list of str :param deployments_per_environment: :type deployments_per_environment: int :param deployment_status: :type deployment_status: object :param environments: :type environments: list of :class:`DefinitionEnvironmentReference ` :param expands: :type expands: object :param is_deleted: :type is_deleted: bool :param latest_deployments_only: :type latest_deployments_only: bool :param max_deployments_per_environment: :type max_deployments_per_environment: int :param max_modified_time: :type max_modified_time: datetime :param min_modified_time: :type min_modified_time: datetime :param operation_status: :type operation_status: object :param query_order: :type query_order: object :param query_type: :type query_type: object :param source_branch: :type source_branch: str """ _attribute_map = { 'artifact_source_id': {'key': 'artifactSourceId', 'type': 'str'}, 'artifact_type_id': {'key': 'artifactTypeId', 'type': 'str'}, 'artifact_versions': {'key': 'artifactVersions', 'type': '[str]'}, 'deployments_per_environment': {'key': 'deploymentsPerEnvironment', 'type': 'int'}, 'deployment_status': {'key': 'deploymentStatus', 'type': 'object'}, 'environments': {'key': 'environments', 'type': '[DefinitionEnvironmentReference]'}, 'expands': {'key': 'expands', 'type': 'object'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'latest_deployments_only': {'key': 'latestDeploymentsOnly', 'type': 'bool'}, 'max_deployments_per_environment': {'key': 'maxDeploymentsPerEnvironment', 'type': 'int'}, 'max_modified_time': {'key': 'maxModifiedTime', 'type': 'iso-8601'}, 'min_modified_time': {'key': 'minModifiedTime', 'type': 'iso-8601'}, 'operation_status': {'key': 'operationStatus', 'type': 'object'}, 'query_order': {'key': 'queryOrder', 'type': 'object'}, 'query_type': {'key': 'queryType', 'type': 'object'}, 'source_branch': {'key': 'sourceBranch', 'type': 'str'} } def __init__(self, artifact_source_id=None, artifact_type_id=None, artifact_versions=None, deployments_per_environment=None, deployment_status=None, environments=None, expands=None, is_deleted=None, latest_deployments_only=None, max_deployments_per_environment=None, max_modified_time=None, min_modified_time=None, operation_status=None, query_order=None, query_type=None, source_branch=None): super(DeploymentQueryParameters, self).__init__() self.artifact_source_id = artifact_source_id self.artifact_type_id = artifact_type_id self.artifact_versions = artifact_versions self.deployments_per_environment = deployments_per_environment self.deployment_status = deployment_status self.environments = environments self.expands = expands self.is_deleted = is_deleted self.latest_deployments_only = latest_deployments_only self.max_deployments_per_environment = max_deployments_per_environment self.max_modified_time = max_modified_time self.min_modified_time = min_modified_time self.operation_status = operation_status self.query_order = query_order self.query_type = query_type self.source_branch = source_branch class EmailRecipients(Model): """EmailRecipients. :param email_addresses: :type email_addresses: list of str :param tfs_ids: :type tfs_ids: list of str """ _attribute_map = { 'email_addresses': {'key': 'emailAddresses', 'type': '[str]'}, 'tfs_ids': {'key': 'tfsIds', 'type': '[str]'} } def __init__(self, email_addresses=None, tfs_ids=None): super(EmailRecipients, self).__init__() self.email_addresses = email_addresses self.tfs_ids = tfs_ids class EnvironmentExecutionPolicy(Model): """EnvironmentExecutionPolicy. :param concurrency_count: This policy decides, how many environments would be with Environment Runner. :type concurrency_count: int :param queue_depth_count: Queue depth in the EnvironmentQueue table, this table keeps the environment entries till Environment Runner is free [as per it's policy] to take another environment for running. :type queue_depth_count: int """ _attribute_map = { 'concurrency_count': {'key': 'concurrencyCount', 'type': 'int'}, 'queue_depth_count': {'key': 'queueDepthCount', 'type': 'int'} } def __init__(self, concurrency_count=None, queue_depth_count=None): super(EnvironmentExecutionPolicy, self).__init__() self.concurrency_count = concurrency_count self.queue_depth_count = queue_depth_count class EnvironmentOptions(Model): """EnvironmentOptions. :param auto_link_work_items: :type auto_link_work_items: bool :param badge_enabled: :type badge_enabled: bool :param email_notification_type: :type email_notification_type: str :param email_recipients: :type email_recipients: str :param enable_access_token: :type enable_access_token: bool :param publish_deployment_status: :type publish_deployment_status: bool :param pull_request_deployment_enabled: :type pull_request_deployment_enabled: bool :param skip_artifacts_download: :type skip_artifacts_download: bool :param timeout_in_minutes: :type timeout_in_minutes: int """ _attribute_map = { 'auto_link_work_items': {'key': 'autoLinkWorkItems', 'type': 'bool'}, 'badge_enabled': {'key': 'badgeEnabled', 'type': 'bool'}, 'email_notification_type': {'key': 'emailNotificationType', 'type': 'str'}, 'email_recipients': {'key': 'emailRecipients', 'type': 'str'}, 'enable_access_token': {'key': 'enableAccessToken', 'type': 'bool'}, 'publish_deployment_status': {'key': 'publishDeploymentStatus', 'type': 'bool'}, 'pull_request_deployment_enabled': {'key': 'pullRequestDeploymentEnabled', 'type': 'bool'}, 'skip_artifacts_download': {'key': 'skipArtifactsDownload', 'type': 'bool'}, 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} } def __init__(self, auto_link_work_items=None, badge_enabled=None, email_notification_type=None, email_recipients=None, enable_access_token=None, publish_deployment_status=None, pull_request_deployment_enabled=None, skip_artifacts_download=None, timeout_in_minutes=None): super(EnvironmentOptions, self).__init__() self.auto_link_work_items = auto_link_work_items self.badge_enabled = badge_enabled self.email_notification_type = email_notification_type self.email_recipients = email_recipients self.enable_access_token = enable_access_token self.publish_deployment_status = publish_deployment_status self.pull_request_deployment_enabled = pull_request_deployment_enabled self.skip_artifacts_download = skip_artifacts_download self.timeout_in_minutes = timeout_in_minutes class EnvironmentRetentionPolicy(Model): """EnvironmentRetentionPolicy. :param days_to_keep: :type days_to_keep: int :param releases_to_keep: :type releases_to_keep: int :param retain_build: :type retain_build: bool """ _attribute_map = { 'days_to_keep': {'key': 'daysToKeep', 'type': 'int'}, 'releases_to_keep': {'key': 'releasesToKeep', 'type': 'int'}, 'retain_build': {'key': 'retainBuild', 'type': 'bool'} } def __init__(self, days_to_keep=None, releases_to_keep=None, retain_build=None): super(EnvironmentRetentionPolicy, self).__init__() self.days_to_keep = days_to_keep self.releases_to_keep = releases_to_keep self.retain_build = retain_build class EnvironmentTrigger(Model): """EnvironmentTrigger. :param definition_environment_id: :type definition_environment_id: int :param release_definition_id: :type release_definition_id: int :param trigger_content: :type trigger_content: str :param trigger_type: :type trigger_type: object """ _attribute_map = { 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, 'release_definition_id': {'key': 'releaseDefinitionId', 'type': 'int'}, 'trigger_content': {'key': 'triggerContent', 'type': 'str'}, 'trigger_type': {'key': 'triggerType', 'type': 'object'} } def __init__(self, definition_environment_id=None, release_definition_id=None, trigger_content=None, trigger_type=None): super(EnvironmentTrigger, self).__init__() self.definition_environment_id = definition_environment_id self.release_definition_id = release_definition_id self.trigger_content = trigger_content self.trigger_type = trigger_type class FavoriteItem(Model): """FavoriteItem. :param data: Application specific data for the entry :type data: str :param id: Unique Id of the the entry :type id: str :param name: Display text for favorite entry :type name: str :param type: Application specific favorite entry type. Empty or Null represents that Favorite item is a Folder :type type: str """ _attribute_map = { 'data': {'key': 'data', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, data=None, id=None, name=None, type=None): super(FavoriteItem, self).__init__() self.data = data self.id = id self.name = name self.type = type class Folder(Model): """Folder. :param created_by: :type created_by: :class:`IdentityRef ` :param created_on: :type created_on: datetime :param description: :type description: str :param last_changed_by: :type last_changed_by: :class:`IdentityRef ` :param last_changed_date: :type last_changed_date: datetime :param path: :type path: str """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'last_changed_by': {'key': 'lastChangedBy', 'type': 'IdentityRef'}, 'last_changed_date': {'key': 'lastChangedDate', 'type': 'iso-8601'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, created_by=None, created_on=None, description=None, last_changed_by=None, last_changed_date=None, path=None): super(Folder, self).__init__() self.created_by = created_by self.created_on = created_on self.description = description self.last_changed_by = last_changed_by self.last_changed_date = last_changed_date self.path = path class GateUpdateMetadata(Model): """GateUpdateMetadata. :param comment: Comment :type comment: str :param gates_to_ignore: Name of gate to be ignored. :type gates_to_ignore: list of str """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'gates_to_ignore': {'key': 'gatesToIgnore', 'type': '[str]'} } def __init__(self, comment=None, gates_to_ignore=None): super(GateUpdateMetadata, self).__init__() self.comment = comment self.gates_to_ignore = gates_to_ignore class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class IgnoredGate(Model): """IgnoredGate. :param last_modified_on: Gets the date on which gate is last ignored. :type last_modified_on: datetime :param name: Name of gate ignored. :type name: str """ _attribute_map = { 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, last_modified_on=None, name=None): super(IgnoredGate, self).__init__() self.last_modified_on = last_modified_on self.name = name class InputDescriptor(Model): """InputDescriptor. :param dependency_input_ids: The ids of all inputs that the value of this input is dependent on. :type dependency_input_ids: list of str :param description: Description of what this input is used for :type description: str :param group_name: The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group. :type group_name: str :param has_dynamic_value_information: If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change. :type has_dynamic_value_information: bool :param id: Identifier for the subscription input :type id: str :param input_mode: Mode in which the value of this input should be entered :type input_mode: object :param is_confidential: Gets whether this input is confidential, such as for a password or application key :type is_confidential: bool :param name: Localized name which can be shown as a label for the subscription input :type name: str :param properties: Custom properties for the input which can be used by the service provider :type properties: dict :param type: Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional. :type type: str :param use_in_default_description: Gets whether this input is included in the default generated action description. :type use_in_default_description: bool :param validation: Information to use to validate this input's value :type validation: :class:`InputValidation ` :param value_hint: A hint for input value. It can be used in the UI as the input placeholder. :type value_hint: str :param values: Information about possible values for this input :type values: :class:`InputValues ` """ _attribute_map = { 'dependency_input_ids': {'key': 'dependencyInputIds', 'type': '[str]'}, 'description': {'key': 'description', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'has_dynamic_value_information': {'key': 'hasDynamicValueInformation', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'input_mode': {'key': 'inputMode', 'type': 'object'}, 'is_confidential': {'key': 'isConfidential', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'str'}, 'use_in_default_description': {'key': 'useInDefaultDescription', 'type': 'bool'}, 'validation': {'key': 'validation', 'type': 'InputValidation'}, 'value_hint': {'key': 'valueHint', 'type': 'str'}, 'values': {'key': 'values', 'type': 'InputValues'} } def __init__(self, dependency_input_ids=None, description=None, group_name=None, has_dynamic_value_information=None, id=None, input_mode=None, is_confidential=None, name=None, properties=None, type=None, use_in_default_description=None, validation=None, value_hint=None, values=None): super(InputDescriptor, self).__init__() self.dependency_input_ids = dependency_input_ids self.description = description self.group_name = group_name self.has_dynamic_value_information = has_dynamic_value_information self.id = id self.input_mode = input_mode self.is_confidential = is_confidential self.name = name self.properties = properties self.type = type self.use_in_default_description = use_in_default_description self.validation = validation self.value_hint = value_hint self.values = values class InputValidation(Model): """InputValidation. :param data_type: :type data_type: object :param is_required: :type is_required: bool :param max_length: :type max_length: int :param max_value: :type max_value: decimal :param min_length: :type min_length: int :param min_value: :type min_value: decimal :param pattern: :type pattern: str :param pattern_mismatch_error_message: :type pattern_mismatch_error_message: str """ _attribute_map = { 'data_type': {'key': 'dataType', 'type': 'object'}, 'is_required': {'key': 'isRequired', 'type': 'bool'}, 'max_length': {'key': 'maxLength', 'type': 'int'}, 'max_value': {'key': 'maxValue', 'type': 'decimal'}, 'min_length': {'key': 'minLength', 'type': 'int'}, 'min_value': {'key': 'minValue', 'type': 'decimal'}, 'pattern': {'key': 'pattern', 'type': 'str'}, 'pattern_mismatch_error_message': {'key': 'patternMismatchErrorMessage', 'type': 'str'} } def __init__(self, data_type=None, is_required=None, max_length=None, max_value=None, min_length=None, min_value=None, pattern=None, pattern_mismatch_error_message=None): super(InputValidation, self).__init__() self.data_type = data_type self.is_required = is_required self.max_length = max_length self.max_value = max_value self.min_length = min_length self.min_value = min_value self.pattern = pattern self.pattern_mismatch_error_message = pattern_mismatch_error_message class InputValue(Model): """InputValue. :param data: Any other data about this input :type data: dict :param display_value: The text to show for the display of this value :type display_value: str :param value: The value to store for this input :type value: str """ _attribute_map = { 'data': {'key': 'data', 'type': '{object}'}, 'display_value': {'key': 'displayValue', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, data=None, display_value=None, value=None): super(InputValue, self).__init__() self.data = data self.display_value = display_value self.value = value class InputValues(Model): """InputValues. :param default_value: The default value to use for this input :type default_value: str :param error: Errors encountered while computing dynamic values. :type error: :class:`InputValuesError ` :param input_id: The id of the input :type input_id: str :param is_disabled: Should this input be disabled :type is_disabled: bool :param is_limited_to_possible_values: Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) :type is_limited_to_possible_values: bool :param is_read_only: Should this input be made read-only :type is_read_only: bool :param possible_values: Possible values that this input can take :type possible_values: list of :class:`InputValue ` """ _attribute_map = { 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'error': {'key': 'error', 'type': 'InputValuesError'}, 'input_id': {'key': 'inputId', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'is_limited_to_possible_values': {'key': 'isLimitedToPossibleValues', 'type': 'bool'}, 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, 'possible_values': {'key': 'possibleValues', 'type': '[InputValue]'} } def __init__(self, default_value=None, error=None, input_id=None, is_disabled=None, is_limited_to_possible_values=None, is_read_only=None, possible_values=None): super(InputValues, self).__init__() self.default_value = default_value self.error = error self.input_id = input_id self.is_disabled = is_disabled self.is_limited_to_possible_values = is_limited_to_possible_values self.is_read_only = is_read_only self.possible_values = possible_values class InputValuesError(Model): """InputValuesError. :param message: The error message. :type message: str """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'} } def __init__(self, message=None): super(InputValuesError, self).__init__() self.message = message class InputValuesQuery(Model): """InputValuesQuery. :param current_values: :type current_values: dict :param input_values: The input values to return on input, and the result from the consumer on output. :type input_values: list of :class:`InputValues ` :param resource: Subscription containing information about the publisher/consumer and the current input values :type resource: object """ _attribute_map = { 'current_values': {'key': 'currentValues', 'type': '{str}'}, 'input_values': {'key': 'inputValues', 'type': '[InputValues]'}, 'resource': {'key': 'resource', 'type': 'object'} } def __init__(self, current_values=None, input_values=None, resource=None): super(InputValuesQuery, self).__init__() self.current_values = current_values self.input_values = input_values self.resource = resource class Issue(Model): """Issue. :param data: :type data: dict :param issue_type: :type issue_type: str :param message: :type message: str """ _attribute_map = { 'data': {'key': 'data', 'type': '{str}'}, 'issue_type': {'key': 'issueType', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'} } def __init__(self, data=None, issue_type=None, message=None): super(Issue, self).__init__() self.data = data self.issue_type = issue_type self.message = message class MailMessage(Model): """MailMessage. :param body: :type body: str :param cc: :type cc: :class:`EmailRecipients ` :param in_reply_to: :type in_reply_to: str :param message_id: :type message_id: str :param reply_by: :type reply_by: datetime :param reply_to: :type reply_to: :class:`EmailRecipients ` :param sections: :type sections: list of MailSectionType :param sender_type: :type sender_type: object :param subject: :type subject: str :param to: :type to: :class:`EmailRecipients ` """ _attribute_map = { 'body': {'key': 'body', 'type': 'str'}, 'cc': {'key': 'cc', 'type': 'EmailRecipients'}, 'in_reply_to': {'key': 'inReplyTo', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'str'}, 'reply_by': {'key': 'replyBy', 'type': 'iso-8601'}, 'reply_to': {'key': 'replyTo', 'type': 'EmailRecipients'}, 'sections': {'key': 'sections', 'type': '[object]'}, 'sender_type': {'key': 'senderType', 'type': 'object'}, 'subject': {'key': 'subject', 'type': 'str'}, 'to': {'key': 'to', 'type': 'EmailRecipients'} } def __init__(self, body=None, cc=None, in_reply_to=None, message_id=None, reply_by=None, reply_to=None, sections=None, sender_type=None, subject=None, to=None): super(MailMessage, self).__init__() self.body = body self.cc = cc self.in_reply_to = in_reply_to self.message_id = message_id self.reply_by = reply_by self.reply_to = reply_to self.sections = sections self.sender_type = sender_type self.subject = subject self.to = to class ManualIntervention(Model): """ManualIntervention. :param approver: Gets or sets the identity who should approve. :type approver: :class:`IdentityRef ` :param comments: Gets or sets comments for approval. :type comments: str :param created_on: Gets date on which it got created. :type created_on: datetime :param id: Gets the unique identifier for manual intervention. :type id: int :param instructions: Gets or sets instructions for approval. :type instructions: str :param modified_on: Gets date on which it got modified. :type modified_on: datetime :param name: Gets or sets the name. :type name: str :param release: Gets releaseReference for manual intervention. :type release: :class:`ReleaseShallowReference ` :param release_definition: Gets releaseDefinitionReference for manual intervention. :type release_definition: :class:`ReleaseDefinitionShallowReference ` :param release_environment: Gets releaseEnvironmentReference for manual intervention. :type release_environment: :class:`ReleaseEnvironmentShallowReference ` :param status: Gets or sets the status of the manual intervention. :type status: object :param task_instance_id: Get task instance identifier. :type task_instance_id: str :param url: Gets url to access the manual intervention. :type url: str """ _attribute_map = { 'approver': {'key': 'approver', 'type': 'IdentityRef'}, 'comments': {'key': 'comments', 'type': 'str'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'instructions': {'key': 'instructions', 'type': 'str'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'release': {'key': 'release', 'type': 'ReleaseShallowReference'}, 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, 'release_environment': {'key': 'releaseEnvironment', 'type': 'ReleaseEnvironmentShallowReference'}, 'status': {'key': 'status', 'type': 'object'}, 'task_instance_id': {'key': 'taskInstanceId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, approver=None, comments=None, created_on=None, id=None, instructions=None, modified_on=None, name=None, release=None, release_definition=None, release_environment=None, status=None, task_instance_id=None, url=None): super(ManualIntervention, self).__init__() self.approver = approver self.comments = comments self.created_on = created_on self.id = id self.instructions = instructions self.modified_on = modified_on self.name = name self.release = release self.release_definition = release_definition self.release_environment = release_environment self.status = status self.task_instance_id = task_instance_id self.url = url class ManualInterventionUpdateMetadata(Model): """ManualInterventionUpdateMetadata. :param comment: Sets the comment for manual intervention update. :type comment: str :param status: Sets the status of the manual intervention. :type status: object """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, comment=None, status=None): super(ManualInterventionUpdateMetadata, self).__init__() self.comment = comment self.status = status class Metric(Model): """Metric. :param name: :type name: str :param value: :type value: int """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'int'} } def __init__(self, name=None, value=None): super(Metric, self).__init__() self.name = name self.value = value class PipelineProcess(Model): """PipelineProcess. :param type: :type type: object """ _attribute_map = { 'type': {'key': 'type', 'type': 'object'} } def __init__(self, type=None): super(PipelineProcess, self).__init__() self.type = type class ProcessParameters(Model): """ProcessParameters. :param data_source_bindings: :type data_source_bindings: list of :class:`DataSourceBindingBase ` :param inputs: :type inputs: list of :class:`TaskInputDefinitionBase ` :param source_definitions: :type source_definitions: list of :class:`TaskSourceDefinitionBase ` """ _attribute_map = { 'data_source_bindings': {'key': 'dataSourceBindings', 'type': '[DataSourceBindingBase]'}, 'inputs': {'key': 'inputs', 'type': '[TaskInputDefinitionBase]'}, 'source_definitions': {'key': 'sourceDefinitions', 'type': '[TaskSourceDefinitionBase]'} } def __init__(self, data_source_bindings=None, inputs=None, source_definitions=None): super(ProcessParameters, self).__init__() self.data_source_bindings = data_source_bindings self.inputs = inputs self.source_definitions = source_definitions class ProjectReference(Model): """ProjectReference. :param id: Gets the unique identifier of this field. :type id: str :param name: Gets name of project. :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(ProjectReference, self).__init__() self.id = id self.name = name class QueuedReleaseData(Model): """QueuedReleaseData. :param project_id: :type project_id: str :param queue_position: :type queue_position: int :param release_id: :type release_id: int """ _attribute_map = { 'project_id': {'key': 'projectId', 'type': 'str'}, 'queue_position': {'key': 'queuePosition', 'type': 'int'}, 'release_id': {'key': 'releaseId', 'type': 'int'} } def __init__(self, project_id=None, queue_position=None, release_id=None): super(QueuedReleaseData, self).__init__() self.project_id = project_id self.queue_position = queue_position self.release_id = release_id class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class Release(Model): """Release. :param _links: Gets links to access the release. :type _links: :class:`ReferenceLinks ` :param artifacts: Gets or sets the list of artifacts. :type artifacts: list of :class:`Artifact ` :param comment: Gets or sets comment. :type comment: str :param created_by: Gets or sets the identity who created. :type created_by: :class:`IdentityRef ` :param created_on: Gets date on which it got created. :type created_on: datetime :param definition_snapshot_revision: Gets revision number of definition snapshot. :type definition_snapshot_revision: int :param description: Gets or sets description of release. :type description: str :param environments: Gets list of environments. :type environments: list of :class:`ReleaseEnvironment ` :param id: Gets the unique identifier of this field. :type id: int :param keep_forever: Whether to exclude the release from retention policies. :type keep_forever: bool :param logs_container_url: Gets logs container url. :type logs_container_url: str :param modified_by: Gets or sets the identity who modified. :type modified_by: :class:`IdentityRef ` :param modified_on: Gets date on which it got modified. :type modified_on: datetime :param name: Gets name. :type name: str :param pool_name: Gets pool name. :type pool_name: str :param project_reference: Gets or sets project reference. :type project_reference: :class:`ProjectReference ` :param properties: :type properties: :class:`object ` :param reason: Gets reason of release. :type reason: object :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which this release is associated. :type release_definition: :class:`ReleaseDefinitionShallowReference ` :param release_name_format: Gets release name format. :type release_name_format: str :param status: Gets status. :type status: object :param tags: Gets or sets list of tags. :type tags: list of str :param triggering_artifact_alias: :type triggering_artifact_alias: str :param url: :type url: str :param variable_groups: Gets the list of variable groups. :type variable_groups: list of :class:`VariableGroup ` :param variables: Gets or sets the dictionary of variables. :type variables: dict """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, 'comment': {'key': 'comment', 'type': 'str'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'definition_snapshot_revision': {'key': 'definitionSnapshotRevision', 'type': 'int'}, 'description': {'key': 'description', 'type': 'str'}, 'environments': {'key': 'environments', 'type': '[ReleaseEnvironment]'}, 'id': {'key': 'id', 'type': 'int'}, 'keep_forever': {'key': 'keepForever', 'type': 'bool'}, 'logs_container_url': {'key': 'logsContainerUrl', 'type': 'str'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'pool_name': {'key': 'poolName', 'type': 'str'}, 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, 'properties': {'key': 'properties', 'type': 'object'}, 'reason': {'key': 'reason', 'type': 'object'}, 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, 'release_name_format': {'key': 'releaseNameFormat', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'triggering_artifact_alias': {'key': 'triggeringArtifactAlias', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'variable_groups': {'key': 'variableGroups', 'type': '[VariableGroup]'}, 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} } def __init__(self, _links=None, artifacts=None, comment=None, created_by=None, created_on=None, definition_snapshot_revision=None, description=None, environments=None, id=None, keep_forever=None, logs_container_url=None, modified_by=None, modified_on=None, name=None, pool_name=None, project_reference=None, properties=None, reason=None, release_definition=None, release_name_format=None, status=None, tags=None, triggering_artifact_alias=None, url=None, variable_groups=None, variables=None): super(Release, self).__init__() self._links = _links self.artifacts = artifacts self.comment = comment self.created_by = created_by self.created_on = created_on self.definition_snapshot_revision = definition_snapshot_revision self.description = description self.environments = environments self.id = id self.keep_forever = keep_forever self.logs_container_url = logs_container_url self.modified_by = modified_by self.modified_on = modified_on self.name = name self.pool_name = pool_name self.project_reference = project_reference self.properties = properties self.reason = reason self.release_definition = release_definition self.release_name_format = release_name_format self.status = status self.tags = tags self.triggering_artifact_alias = triggering_artifact_alias self.url = url self.variable_groups = variable_groups self.variables = variables class ReleaseApproval(Model): """ReleaseApproval. :param approval_type: Gets or sets the type of approval. :type approval_type: object :param approved_by: Gets the identity who approved. :type approved_by: :class:`IdentityRef ` :param approver: Gets or sets the identity who should approve. :type approver: :class:`IdentityRef ` :param attempt: Gets or sets attempt which specifies as which deployment attempt it belongs. :type attempt: int :param comments: Gets or sets comments for approval. :type comments: str :param created_on: Gets date on which it got created. :type created_on: datetime :param history: Gets history which specifies all approvals associated with this approval. :type history: list of :class:`ReleaseApprovalHistory ` :param id: Gets the unique identifier of this field. :type id: int :param is_automated: Gets or sets as approval is automated or not. :type is_automated: bool :param is_notification_on: :type is_notification_on: bool :param modified_on: Gets date on which it got modified. :type modified_on: datetime :param rank: Gets or sets rank which specifies the order of the approval. e.g. Same rank denotes parallel approval. :type rank: int :param release: Gets releaseReference which specifies the reference of the release to which this approval is associated. :type release: :class:`ReleaseShallowReference ` :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which this approval is associated. :type release_definition: :class:`ReleaseDefinitionShallowReference ` :param release_environment: Gets releaseEnvironmentReference which specifies the reference of the release environment to which this approval is associated. :type release_environment: :class:`ReleaseEnvironmentShallowReference ` :param revision: Gets the revision number. :type revision: int :param status: Gets or sets the status of the approval. :type status: object :param trial_number: :type trial_number: int :param url: Gets url to access the approval. :type url: str """ _attribute_map = { 'approval_type': {'key': 'approvalType', 'type': 'object'}, 'approved_by': {'key': 'approvedBy', 'type': 'IdentityRef'}, 'approver': {'key': 'approver', 'type': 'IdentityRef'}, 'attempt': {'key': 'attempt', 'type': 'int'}, 'comments': {'key': 'comments', 'type': 'str'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'history': {'key': 'history', 'type': '[ReleaseApprovalHistory]'}, 'id': {'key': 'id', 'type': 'int'}, 'is_automated': {'key': 'isAutomated', 'type': 'bool'}, 'is_notification_on': {'key': 'isNotificationOn', 'type': 'bool'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'rank': {'key': 'rank', 'type': 'int'}, 'release': {'key': 'release', 'type': 'ReleaseShallowReference'}, 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, 'release_environment': {'key': 'releaseEnvironment', 'type': 'ReleaseEnvironmentShallowReference'}, 'revision': {'key': 'revision', 'type': 'int'}, 'status': {'key': 'status', 'type': 'object'}, 'trial_number': {'key': 'trialNumber', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, approval_type=None, approved_by=None, approver=None, attempt=None, comments=None, created_on=None, history=None, id=None, is_automated=None, is_notification_on=None, modified_on=None, rank=None, release=None, release_definition=None, release_environment=None, revision=None, status=None, trial_number=None, url=None): super(ReleaseApproval, self).__init__() self.approval_type = approval_type self.approved_by = approved_by self.approver = approver self.attempt = attempt self.comments = comments self.created_on = created_on self.history = history self.id = id self.is_automated = is_automated self.is_notification_on = is_notification_on self.modified_on = modified_on self.rank = rank self.release = release self.release_definition = release_definition self.release_environment = release_environment self.revision = revision self.status = status self.trial_number = trial_number self.url = url class ReleaseApprovalHistory(Model): """ReleaseApprovalHistory. :param approver: :type approver: :class:`IdentityRef ` :param changed_by: :type changed_by: :class:`IdentityRef ` :param comments: :type comments: str :param created_on: :type created_on: datetime :param modified_on: :type modified_on: datetime :param revision: :type revision: int """ _attribute_map = { 'approver': {'key': 'approver', 'type': 'IdentityRef'}, 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, 'comments': {'key': 'comments', 'type': 'str'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'revision': {'key': 'revision', 'type': 'int'} } def __init__(self, approver=None, changed_by=None, comments=None, created_on=None, modified_on=None, revision=None): super(ReleaseApprovalHistory, self).__init__() self.approver = approver self.changed_by = changed_by self.comments = comments self.created_on = created_on self.modified_on = modified_on self.revision = revision class ReleaseCondition(Condition): """ReleaseCondition. :param condition_type: Gets or sets the condition type. :type condition_type: object :param name: Gets or sets the name of the condition. e.g. 'ReleaseStarted'. :type name: str :param value: Gets or set value of the condition. :type value: str :param result: :type result: bool """ _attribute_map = { 'condition_type': {'key': 'conditionType', 'type': 'object'}, 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'}, 'result': {'key': 'result', 'type': 'bool'} } def __init__(self, condition_type=None, name=None, value=None, result=None): super(ReleaseCondition, self).__init__(condition_type=condition_type, name=name, value=value) self.result = result class ReleaseDefinitionApprovals(Model): """ReleaseDefinitionApprovals. :param approval_options: :type approval_options: :class:`ApprovalOptions ` :param approvals: :type approvals: list of :class:`ReleaseDefinitionApprovalStep ` """ _attribute_map = { 'approval_options': {'key': 'approvalOptions', 'type': 'ApprovalOptions'}, 'approvals': {'key': 'approvals', 'type': '[ReleaseDefinitionApprovalStep]'} } def __init__(self, approval_options=None, approvals=None): super(ReleaseDefinitionApprovals, self).__init__() self.approval_options = approval_options self.approvals = approvals class ReleaseDefinitionEnvironment(Model): """ReleaseDefinitionEnvironment. :param badge_url: :type badge_url: str :param conditions: :type conditions: list of :class:`Condition ` :param current_release: :type current_release: :class:`ReleaseShallowReference ` :param demands: :type demands: list of :class:`object ` :param deploy_phases: :type deploy_phases: list of :class:`object ` :param deploy_step: :type deploy_step: :class:`ReleaseDefinitionDeployStep ` :param environment_options: :type environment_options: :class:`EnvironmentOptions ` :param environment_triggers: :type environment_triggers: list of :class:`EnvironmentTrigger ` :param execution_policy: :type execution_policy: :class:`EnvironmentExecutionPolicy ` :param id: :type id: int :param name: :type name: str :param owner: :type owner: :class:`IdentityRef ` :param post_deploy_approvals: :type post_deploy_approvals: :class:`ReleaseDefinitionApprovals ` :param post_deployment_gates: :type post_deployment_gates: :class:`ReleaseDefinitionGatesStep ` :param pre_deploy_approvals: :type pre_deploy_approvals: :class:`ReleaseDefinitionApprovals ` :param pre_deployment_gates: :type pre_deployment_gates: :class:`ReleaseDefinitionGatesStep ` :param process_parameters: :type process_parameters: :class:`ProcessParameters ` :param properties: :type properties: :class:`object ` :param queue_id: :type queue_id: int :param rank: :type rank: int :param retention_policy: :type retention_policy: :class:`EnvironmentRetentionPolicy ` :param run_options: :type run_options: dict :param schedules: :type schedules: list of :class:`ReleaseSchedule ` :param variable_groups: :type variable_groups: list of int :param variables: :type variables: dict """ _attribute_map = { 'badge_url': {'key': 'badgeUrl', 'type': 'str'}, 'conditions': {'key': 'conditions', 'type': '[Condition]'}, 'current_release': {'key': 'currentRelease', 'type': 'ReleaseShallowReference'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'deploy_phases': {'key': 'deployPhases', 'type': '[object]'}, 'deploy_step': {'key': 'deployStep', 'type': 'ReleaseDefinitionDeployStep'}, 'environment_options': {'key': 'environmentOptions', 'type': 'EnvironmentOptions'}, 'environment_triggers': {'key': 'environmentTriggers', 'type': '[EnvironmentTrigger]'}, 'execution_policy': {'key': 'executionPolicy', 'type': 'EnvironmentExecutionPolicy'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'post_deploy_approvals': {'key': 'postDeployApprovals', 'type': 'ReleaseDefinitionApprovals'}, 'post_deployment_gates': {'key': 'postDeploymentGates', 'type': 'ReleaseDefinitionGatesStep'}, 'pre_deploy_approvals': {'key': 'preDeployApprovals', 'type': 'ReleaseDefinitionApprovals'}, 'pre_deployment_gates': {'key': 'preDeploymentGates', 'type': 'ReleaseDefinitionGatesStep'}, 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, 'properties': {'key': 'properties', 'type': 'object'}, 'queue_id': {'key': 'queueId', 'type': 'int'}, 'rank': {'key': 'rank', 'type': 'int'}, 'retention_policy': {'key': 'retentionPolicy', 'type': 'EnvironmentRetentionPolicy'}, 'run_options': {'key': 'runOptions', 'type': '{str}'}, 'schedules': {'key': 'schedules', 'type': '[ReleaseSchedule]'}, 'variable_groups': {'key': 'variableGroups', 'type': '[int]'}, 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} } def __init__(self, badge_url=None, conditions=None, current_release=None, demands=None, deploy_phases=None, deploy_step=None, environment_options=None, environment_triggers=None, execution_policy=None, id=None, name=None, owner=None, post_deploy_approvals=None, post_deployment_gates=None, pre_deploy_approvals=None, pre_deployment_gates=None, process_parameters=None, properties=None, queue_id=None, rank=None, retention_policy=None, run_options=None, schedules=None, variable_groups=None, variables=None): super(ReleaseDefinitionEnvironment, self).__init__() self.badge_url = badge_url self.conditions = conditions self.current_release = current_release self.demands = demands self.deploy_phases = deploy_phases self.deploy_step = deploy_step self.environment_options = environment_options self.environment_triggers = environment_triggers self.execution_policy = execution_policy self.id = id self.name = name self.owner = owner self.post_deploy_approvals = post_deploy_approvals self.post_deployment_gates = post_deployment_gates self.pre_deploy_approvals = pre_deploy_approvals self.pre_deployment_gates = pre_deployment_gates self.process_parameters = process_parameters self.properties = properties self.queue_id = queue_id self.rank = rank self.retention_policy = retention_policy self.run_options = run_options self.schedules = schedules self.variable_groups = variable_groups self.variables = variables class ReleaseDefinitionEnvironmentStep(Model): """ReleaseDefinitionEnvironmentStep. :param id: :type id: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'} } def __init__(self, id=None): super(ReleaseDefinitionEnvironmentStep, self).__init__() self.id = id class ReleaseDefinitionEnvironmentSummary(Model): """ReleaseDefinitionEnvironmentSummary. :param id: :type id: int :param last_releases: :type last_releases: list of :class:`ReleaseShallowReference ` :param name: :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'last_releases': {'key': 'lastReleases', 'type': '[ReleaseShallowReference]'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, last_releases=None, name=None): super(ReleaseDefinitionEnvironmentSummary, self).__init__() self.id = id self.last_releases = last_releases self.name = name class ReleaseDefinitionEnvironmentTemplate(Model): """ReleaseDefinitionEnvironmentTemplate. :param can_delete: :type can_delete: bool :param category: :type category: str :param description: :type description: str :param environment: :type environment: :class:`ReleaseDefinitionEnvironment ` :param icon_task_id: :type icon_task_id: str :param icon_uri: :type icon_uri: str :param id: :type id: str :param is_deleted: :type is_deleted: bool :param name: :type name: str """ _attribute_map = { 'can_delete': {'key': 'canDelete', 'type': 'bool'}, 'category': {'key': 'category', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'environment': {'key': 'environment', 'type': 'ReleaseDefinitionEnvironment'}, 'icon_task_id': {'key': 'iconTaskId', 'type': 'str'}, 'icon_uri': {'key': 'iconUri', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, can_delete=None, category=None, description=None, environment=None, icon_task_id=None, icon_uri=None, id=None, is_deleted=None, name=None): super(ReleaseDefinitionEnvironmentTemplate, self).__init__() self.can_delete = can_delete self.category = category self.description = description self.environment = environment self.icon_task_id = icon_task_id self.icon_uri = icon_uri self.id = id self.is_deleted = is_deleted self.name = name class ReleaseDefinitionGate(Model): """ReleaseDefinitionGate. :param tasks: :type tasks: list of :class:`WorkflowTask ` """ _attribute_map = { 'tasks': {'key': 'tasks', 'type': '[WorkflowTask]'} } def __init__(self, tasks=None): super(ReleaseDefinitionGate, self).__init__() self.tasks = tasks class ReleaseDefinitionGatesOptions(Model): """ReleaseDefinitionGatesOptions. :param is_enabled: :type is_enabled: bool :param minimum_success_duration: :type minimum_success_duration: int :param sampling_interval: :type sampling_interval: int :param stabilization_time: :type stabilization_time: int :param timeout: :type timeout: int """ _attribute_map = { 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'minimum_success_duration': {'key': 'minimumSuccessDuration', 'type': 'int'}, 'sampling_interval': {'key': 'samplingInterval', 'type': 'int'}, 'stabilization_time': {'key': 'stabilizationTime', 'type': 'int'}, 'timeout': {'key': 'timeout', 'type': 'int'} } def __init__(self, is_enabled=None, minimum_success_duration=None, sampling_interval=None, stabilization_time=None, timeout=None): super(ReleaseDefinitionGatesOptions, self).__init__() self.is_enabled = is_enabled self.minimum_success_duration = minimum_success_duration self.sampling_interval = sampling_interval self.stabilization_time = stabilization_time self.timeout = timeout class ReleaseDefinitionGatesStep(Model): """ReleaseDefinitionGatesStep. :param gates: :type gates: list of :class:`ReleaseDefinitionGate ` :param gates_options: :type gates_options: :class:`ReleaseDefinitionGatesOptions ` :param id: :type id: int """ _attribute_map = { 'gates': {'key': 'gates', 'type': '[ReleaseDefinitionGate]'}, 'gates_options': {'key': 'gatesOptions', 'type': 'ReleaseDefinitionGatesOptions'}, 'id': {'key': 'id', 'type': 'int'} } def __init__(self, gates=None, gates_options=None, id=None): super(ReleaseDefinitionGatesStep, self).__init__() self.gates = gates self.gates_options = gates_options self.id = id class ReleaseDefinitionRevision(Model): """ReleaseDefinitionRevision. :param api_version: Gets api-version for revision object. :type api_version: str :param changed_by: Gets the identity who did change. :type changed_by: :class:`IdentityRef ` :param changed_date: Gets date on which it got changed. :type changed_date: datetime :param change_type: Gets type of change. :type change_type: object :param comment: Gets comments for revision. :type comment: str :param definition_id: Get id of the definition. :type definition_id: int :param definition_url: Gets definition url. :type definition_url: str :param revision: Get revision number of the definition. :type revision: int """ _attribute_map = { 'api_version': {'key': 'apiVersion', 'type': 'str'}, 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, 'change_type': {'key': 'changeType', 'type': 'object'}, 'comment': {'key': 'comment', 'type': 'str'}, 'definition_id': {'key': 'definitionId', 'type': 'int'}, 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'} } def __init__(self, api_version=None, changed_by=None, changed_date=None, change_type=None, comment=None, definition_id=None, definition_url=None, revision=None): super(ReleaseDefinitionRevision, self).__init__() self.api_version = api_version self.changed_by = changed_by self.changed_date = changed_date self.change_type = change_type self.comment = comment self.definition_id = definition_id self.definition_url = definition_url self.revision = revision class ReleaseDefinitionShallowReference(Model): """ReleaseDefinitionShallowReference. :param _links: Gets the links to related resources, APIs, and views for the release definition. :type _links: :class:`ReferenceLinks ` :param id: Gets the unique identifier of release definition. :type id: int :param name: Gets or sets the name of the release definition. :type name: str :param path: Gets or sets the path of the release definition. :type path: str :param project_reference: Gets or sets project reference. :type project_reference: :class:`ProjectReference ` :param url: Gets the REST API url to access the release definition. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, id=None, name=None, path=None, project_reference=None, url=None): super(ReleaseDefinitionShallowReference, self).__init__() self._links = _links self.id = id self.name = name self.path = path self.project_reference = project_reference self.url = url class ReleaseDefinitionSummary(Model): """ReleaseDefinitionSummary. :param environments: :type environments: list of :class:`ReleaseDefinitionEnvironmentSummary ` :param release_definition: :type release_definition: :class:`ReleaseDefinitionShallowReference ` :param releases: :type releases: list of :class:`Release ` """ _attribute_map = { 'environments': {'key': 'environments', 'type': '[ReleaseDefinitionEnvironmentSummary]'}, 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, 'releases': {'key': 'releases', 'type': '[Release]'} } def __init__(self, environments=None, release_definition=None, releases=None): super(ReleaseDefinitionSummary, self).__init__() self.environments = environments self.release_definition = release_definition self.releases = releases class ReleaseDefinitionUndeleteParameter(Model): """ReleaseDefinitionUndeleteParameter. :param comment: Gets or sets comment. :type comment: str """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'} } def __init__(self, comment=None): super(ReleaseDefinitionUndeleteParameter, self).__init__() self.comment = comment class ReleaseDeployPhase(Model): """ReleaseDeployPhase. :param deployment_jobs: :type deployment_jobs: list of :class:`DeploymentJob ` :param error_log: :type error_log: str :param id: :type id: int :param manual_interventions: :type manual_interventions: list of :class:`ManualIntervention ` :param name: :type name: str :param phase_id: :type phase_id: str :param phase_type: :type phase_type: object :param rank: :type rank: int :param run_plan_id: :type run_plan_id: str :param started_on: Phase start time :type started_on: datetime :param status: :type status: object """ _attribute_map = { 'deployment_jobs': {'key': 'deploymentJobs', 'type': '[DeploymentJob]'}, 'error_log': {'key': 'errorLog', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'manual_interventions': {'key': 'manualInterventions', 'type': '[ManualIntervention]'}, 'name': {'key': 'name', 'type': 'str'}, 'phase_id': {'key': 'phaseId', 'type': 'str'}, 'phase_type': {'key': 'phaseType', 'type': 'object'}, 'rank': {'key': 'rank', 'type': 'int'}, 'run_plan_id': {'key': 'runPlanId', 'type': 'str'}, 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, deployment_jobs=None, error_log=None, id=None, manual_interventions=None, name=None, phase_id=None, phase_type=None, rank=None, run_plan_id=None, started_on=None, status=None): super(ReleaseDeployPhase, self).__init__() self.deployment_jobs = deployment_jobs self.error_log = error_log self.id = id self.manual_interventions = manual_interventions self.name = name self.phase_id = phase_id self.phase_type = phase_type self.rank = rank self.run_plan_id = run_plan_id self.started_on = started_on self.status = status class ReleaseEnvironment(Model): """ReleaseEnvironment. :param conditions: Gets list of conditions. :type conditions: list of :class:`ReleaseCondition ` :param created_on: Gets date on which it got created. :type created_on: datetime :param definition_environment_id: Gets definition environment id. :type definition_environment_id: int :param demands: Gets demands. :type demands: list of :class:`object ` :param deploy_phases_snapshot: Gets list of deploy phases snapshot. :type deploy_phases_snapshot: list of :class:`object ` :param deploy_steps: Gets deploy steps. :type deploy_steps: list of :class:`DeploymentAttempt ` :param environment_options: Gets environment options. :type environment_options: :class:`EnvironmentOptions ` :param id: Gets the unique identifier of this field. :type id: int :param modified_on: Gets date on which it got modified. :type modified_on: datetime :param name: Gets name. :type name: str :param next_scheduled_utc_time: Gets next scheduled UTC time. :type next_scheduled_utc_time: datetime :param owner: Gets the identity who is owner for release environment. :type owner: :class:`IdentityRef ` :param post_approvals_snapshot: Gets list of post deploy approvals snapshot. :type post_approvals_snapshot: :class:`ReleaseDefinitionApprovals ` :param post_deploy_approvals: Gets list of post deploy approvals. :type post_deploy_approvals: list of :class:`ReleaseApproval ` :param post_deployment_gates_snapshot: :type post_deployment_gates_snapshot: :class:`ReleaseDefinitionGatesStep ` :param pre_approvals_snapshot: Gets list of pre deploy approvals snapshot. :type pre_approvals_snapshot: :class:`ReleaseDefinitionApprovals ` :param pre_deploy_approvals: Gets list of pre deploy approvals. :type pre_deploy_approvals: list of :class:`ReleaseApproval ` :param pre_deployment_gates_snapshot: :type pre_deployment_gates_snapshot: :class:`ReleaseDefinitionGatesStep ` :param process_parameters: Gets process parameters. :type process_parameters: :class:`ProcessParameters ` :param queue_id: Gets queue id. :type queue_id: int :param rank: Gets rank. :type rank: int :param release: Gets release reference which specifies the reference of the release to which this release environment is associated. :type release: :class:`ReleaseShallowReference ` :param release_created_by: Gets the identity who created release. :type release_created_by: :class:`IdentityRef ` :param release_definition: Gets releaseDefinitionReference which specifies the reference of the release definition to which this release environment is associated. :type release_definition: :class:`ReleaseDefinitionShallowReference ` :param release_description: Gets release description. :type release_description: str :param release_id: Gets release id. :type release_id: int :param scheduled_deployment_time: Gets schedule deployment time of release environment. :type scheduled_deployment_time: datetime :param schedules: Gets list of schedules. :type schedules: list of :class:`ReleaseSchedule ` :param status: Gets environment status. :type status: object :param time_to_deploy: Gets time to deploy. :type time_to_deploy: float :param trigger_reason: Gets trigger reason. :type trigger_reason: str :param variable_groups: Gets the list of variable groups. :type variable_groups: list of :class:`VariableGroup ` :param variables: Gets the dictionary of variables. :type variables: dict :param workflow_tasks: Gets list of workflow tasks. :type workflow_tasks: list of :class:`WorkflowTask ` """ _attribute_map = { 'conditions': {'key': 'conditions', 'type': '[ReleaseCondition]'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'deploy_phases_snapshot': {'key': 'deployPhasesSnapshot', 'type': '[object]'}, 'deploy_steps': {'key': 'deploySteps', 'type': '[DeploymentAttempt]'}, 'environment_options': {'key': 'environmentOptions', 'type': 'EnvironmentOptions'}, 'id': {'key': 'id', 'type': 'int'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'next_scheduled_utc_time': {'key': 'nextScheduledUtcTime', 'type': 'iso-8601'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'post_approvals_snapshot': {'key': 'postApprovalsSnapshot', 'type': 'ReleaseDefinitionApprovals'}, 'post_deploy_approvals': {'key': 'postDeployApprovals', 'type': '[ReleaseApproval]'}, 'post_deployment_gates_snapshot': {'key': 'postDeploymentGatesSnapshot', 'type': 'ReleaseDefinitionGatesStep'}, 'pre_approvals_snapshot': {'key': 'preApprovalsSnapshot', 'type': 'ReleaseDefinitionApprovals'}, 'pre_deploy_approvals': {'key': 'preDeployApprovals', 'type': '[ReleaseApproval]'}, 'pre_deployment_gates_snapshot': {'key': 'preDeploymentGatesSnapshot', 'type': 'ReleaseDefinitionGatesStep'}, 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, 'queue_id': {'key': 'queueId', 'type': 'int'}, 'rank': {'key': 'rank', 'type': 'int'}, 'release': {'key': 'release', 'type': 'ReleaseShallowReference'}, 'release_created_by': {'key': 'releaseCreatedBy', 'type': 'IdentityRef'}, 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, 'release_description': {'key': 'releaseDescription', 'type': 'str'}, 'release_id': {'key': 'releaseId', 'type': 'int'}, 'scheduled_deployment_time': {'key': 'scheduledDeploymentTime', 'type': 'iso-8601'}, 'schedules': {'key': 'schedules', 'type': '[ReleaseSchedule]'}, 'status': {'key': 'status', 'type': 'object'}, 'time_to_deploy': {'key': 'timeToDeploy', 'type': 'float'}, 'trigger_reason': {'key': 'triggerReason', 'type': 'str'}, 'variable_groups': {'key': 'variableGroups', 'type': '[VariableGroup]'}, 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'}, 'workflow_tasks': {'key': 'workflowTasks', 'type': '[WorkflowTask]'} } def __init__(self, conditions=None, created_on=None, definition_environment_id=None, demands=None, deploy_phases_snapshot=None, deploy_steps=None, environment_options=None, id=None, modified_on=None, name=None, next_scheduled_utc_time=None, owner=None, post_approvals_snapshot=None, post_deploy_approvals=None, post_deployment_gates_snapshot=None, pre_approvals_snapshot=None, pre_deploy_approvals=None, pre_deployment_gates_snapshot=None, process_parameters=None, queue_id=None, rank=None, release=None, release_created_by=None, release_definition=None, release_description=None, release_id=None, scheduled_deployment_time=None, schedules=None, status=None, time_to_deploy=None, trigger_reason=None, variable_groups=None, variables=None, workflow_tasks=None): super(ReleaseEnvironment, self).__init__() self.conditions = conditions self.created_on = created_on self.definition_environment_id = definition_environment_id self.demands = demands self.deploy_phases_snapshot = deploy_phases_snapshot self.deploy_steps = deploy_steps self.environment_options = environment_options self.id = id self.modified_on = modified_on self.name = name self.next_scheduled_utc_time = next_scheduled_utc_time self.owner = owner self.post_approvals_snapshot = post_approvals_snapshot self.post_deploy_approvals = post_deploy_approvals self.post_deployment_gates_snapshot = post_deployment_gates_snapshot self.pre_approvals_snapshot = pre_approvals_snapshot self.pre_deploy_approvals = pre_deploy_approvals self.pre_deployment_gates_snapshot = pre_deployment_gates_snapshot self.process_parameters = process_parameters self.queue_id = queue_id self.rank = rank self.release = release self.release_created_by = release_created_by self.release_definition = release_definition self.release_description = release_description self.release_id = release_id self.scheduled_deployment_time = scheduled_deployment_time self.schedules = schedules self.status = status self.time_to_deploy = time_to_deploy self.trigger_reason = trigger_reason self.variable_groups = variable_groups self.variables = variables self.workflow_tasks = workflow_tasks class ReleaseEnvironmentShallowReference(Model): """ReleaseEnvironmentShallowReference. :param _links: Gets the links to related resources, APIs, and views for the release environment. :type _links: :class:`ReferenceLinks ` :param id: Gets the unique identifier of release environment. :type id: int :param name: Gets or sets the name of the release environment. :type name: str :param url: Gets the REST API url to access the release environment. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, id=None, name=None, url=None): super(ReleaseEnvironmentShallowReference, self).__init__() self._links = _links self.id = id self.name = name self.url = url class ReleaseEnvironmentUpdateMetadata(Model): """ReleaseEnvironmentUpdateMetadata. :param comment: Gets or sets comment. :type comment: str :param scheduled_deployment_time: Gets or sets scheduled deployment time. :type scheduled_deployment_time: datetime :param status: Gets or sets status of environment. :type status: object :param variables: Sets list of environment variables to be overridden at deployment time. :type variables: dict """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'scheduled_deployment_time': {'key': 'scheduledDeploymentTime', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} } def __init__(self, comment=None, scheduled_deployment_time=None, status=None, variables=None): super(ReleaseEnvironmentUpdateMetadata, self).__init__() self.comment = comment self.scheduled_deployment_time = scheduled_deployment_time self.status = status self.variables = variables class ReleaseGates(Model): """ReleaseGates. :param deployment_jobs: :type deployment_jobs: list of :class:`DeploymentJob ` :param id: :type id: int :param ignored_gates: :type ignored_gates: list of :class:`IgnoredGate ` :param last_modified_on: :type last_modified_on: datetime :param run_plan_id: :type run_plan_id: str :param stabilization_completed_on: :type stabilization_completed_on: datetime :param started_on: :type started_on: datetime :param status: :type status: object :param succeeding_since: :type succeeding_since: datetime """ _attribute_map = { 'deployment_jobs': {'key': 'deploymentJobs', 'type': '[DeploymentJob]'}, 'id': {'key': 'id', 'type': 'int'}, 'ignored_gates': {'key': 'ignoredGates', 'type': '[IgnoredGate]'}, 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, 'run_plan_id': {'key': 'runPlanId', 'type': 'str'}, 'stabilization_completed_on': {'key': 'stabilizationCompletedOn', 'type': 'iso-8601'}, 'started_on': {'key': 'startedOn', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'succeeding_since': {'key': 'succeedingSince', 'type': 'iso-8601'} } def __init__(self, deployment_jobs=None, id=None, ignored_gates=None, last_modified_on=None, run_plan_id=None, stabilization_completed_on=None, started_on=None, status=None, succeeding_since=None): super(ReleaseGates, self).__init__() self.deployment_jobs = deployment_jobs self.id = id self.ignored_gates = ignored_gates self.last_modified_on = last_modified_on self.run_plan_id = run_plan_id self.stabilization_completed_on = stabilization_completed_on self.started_on = started_on self.status = status self.succeeding_since = succeeding_since class ReleaseReference(Model): """ReleaseReference. :param _links: Gets links to access the release. :type _links: :class:`ReferenceLinks ` :param artifacts: Gets list of artifacts. :type artifacts: list of :class:`Artifact ` :param created_by: Gets the identity who created. :type created_by: :class:`IdentityRef ` :param created_on: Gets date on which it got created. :type created_on: datetime :param description: Gets description. :type description: str :param id: Gets the unique identifier of this field. :type id: int :param modified_by: Gets the identity who modified. :type modified_by: :class:`IdentityRef ` :param name: Gets name of release. :type name: str :param reason: Gets reason for release. :type reason: object :param release_definition: Gets release definition shallow reference. :type release_definition: :class:`ReleaseDefinitionShallowReference ` :param url: :type url: str :param web_access_uri: :type web_access_uri: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'name': {'key': 'name', 'type': 'str'}, 'reason': {'key': 'reason', 'type': 'object'}, 'release_definition': {'key': 'releaseDefinition', 'type': 'ReleaseDefinitionShallowReference'}, 'url': {'key': 'url', 'type': 'str'}, 'web_access_uri': {'key': 'webAccessUri', 'type': 'str'} } def __init__(self, _links=None, artifacts=None, created_by=None, created_on=None, description=None, id=None, modified_by=None, name=None, reason=None, release_definition=None, url=None, web_access_uri=None): super(ReleaseReference, self).__init__() self._links = _links self.artifacts = artifacts self.created_by = created_by self.created_on = created_on self.description = description self.id = id self.modified_by = modified_by self.name = name self.reason = reason self.release_definition = release_definition self.url = url self.web_access_uri = web_access_uri class ReleaseRevision(Model): """ReleaseRevision. :param changed_by: :type changed_by: :class:`IdentityRef ` :param changed_date: :type changed_date: datetime :param change_details: :type change_details: str :param change_type: :type change_type: str :param comment: :type comment: str :param definition_snapshot_revision: :type definition_snapshot_revision: int :param release_id: :type release_id: int """ _attribute_map = { 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, 'change_details': {'key': 'changeDetails', 'type': 'str'}, 'change_type': {'key': 'changeType', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'definition_snapshot_revision': {'key': 'definitionSnapshotRevision', 'type': 'int'}, 'release_id': {'key': 'releaseId', 'type': 'int'} } def __init__(self, changed_by=None, changed_date=None, change_details=None, change_type=None, comment=None, definition_snapshot_revision=None, release_id=None): super(ReleaseRevision, self).__init__() self.changed_by = changed_by self.changed_date = changed_date self.change_details = change_details self.change_type = change_type self.comment = comment self.definition_snapshot_revision = definition_snapshot_revision self.release_id = release_id class ReleaseSchedule(Model): """ReleaseSchedule. :param days_to_release: Days of the week to release :type days_to_release: object :param job_id: Team Foundation Job Definition Job Id :type job_id: str :param start_hours: Local time zone hour to start :type start_hours: int :param start_minutes: Local time zone minute to start :type start_minutes: int :param time_zone_id: Time zone Id of release schedule, such as 'UTC' :type time_zone_id: str """ _attribute_map = { 'days_to_release': {'key': 'daysToRelease', 'type': 'object'}, 'job_id': {'key': 'jobId', 'type': 'str'}, 'start_hours': {'key': 'startHours', 'type': 'int'}, 'start_minutes': {'key': 'startMinutes', 'type': 'int'}, 'time_zone_id': {'key': 'timeZoneId', 'type': 'str'} } def __init__(self, days_to_release=None, job_id=None, start_hours=None, start_minutes=None, time_zone_id=None): super(ReleaseSchedule, self).__init__() self.days_to_release = days_to_release self.job_id = job_id self.start_hours = start_hours self.start_minutes = start_minutes self.time_zone_id = time_zone_id class ReleaseSettings(Model): """ReleaseSettings. :param retention_settings: :type retention_settings: :class:`RetentionSettings ` """ _attribute_map = { 'retention_settings': {'key': 'retentionSettings', 'type': 'RetentionSettings'} } def __init__(self, retention_settings=None): super(ReleaseSettings, self).__init__() self.retention_settings = retention_settings class ReleaseShallowReference(Model): """ReleaseShallowReference. :param _links: Gets the links to related resources, APIs, and views for the release. :type _links: :class:`ReferenceLinks ` :param id: Gets the unique identifier of release. :type id: int :param name: Gets or sets the name of the release. :type name: str :param url: Gets the REST API url to access the release. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, id=None, name=None, url=None): super(ReleaseShallowReference, self).__init__() self._links = _links self.id = id self.name = name self.url = url class ReleaseStartEnvironmentMetadata(Model): """ReleaseStartEnvironmentMetadata. :param definition_environment_id: Sets release definition environment id. :type definition_environment_id: int :param variables: Sets list of environments variables to be overridden at deployment time. :type variables: dict """ _attribute_map = { 'definition_environment_id': {'key': 'definitionEnvironmentId', 'type': 'int'}, 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} } def __init__(self, definition_environment_id=None, variables=None): super(ReleaseStartEnvironmentMetadata, self).__init__() self.definition_environment_id = definition_environment_id self.variables = variables class ReleaseStartMetadata(Model): """ReleaseStartMetadata. :param artifacts: Sets list of artifact to create a release. :type artifacts: list of :class:`ArtifactMetadata ` :param definition_id: Sets definition Id to create a release. :type definition_id: int :param description: Sets description to create a release. :type description: str :param environments_metadata: Sets list of environments meta data. :type environments_metadata: list of :class:`ReleaseStartEnvironmentMetadata ` :param is_draft: Sets 'true' to create release in draft mode, 'false' otherwise. :type is_draft: bool :param manual_environments: Sets list of environments to manual as condition. :type manual_environments: list of str :param properties: :type properties: :class:`object ` :param reason: Sets reason to create a release. :type reason: object :param variables: Sets list of release variables to be overridden at deployment time. :type variables: dict """ _attribute_map = { 'artifacts': {'key': 'artifacts', 'type': '[ArtifactMetadata]'}, 'definition_id': {'key': 'definitionId', 'type': 'int'}, 'description': {'key': 'description', 'type': 'str'}, 'environments_metadata': {'key': 'environmentsMetadata', 'type': '[ReleaseStartEnvironmentMetadata]'}, 'is_draft': {'key': 'isDraft', 'type': 'bool'}, 'manual_environments': {'key': 'manualEnvironments', 'type': '[str]'}, 'properties': {'key': 'properties', 'type': 'object'}, 'reason': {'key': 'reason', 'type': 'object'}, 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} } def __init__(self, artifacts=None, definition_id=None, description=None, environments_metadata=None, is_draft=None, manual_environments=None, properties=None, reason=None, variables=None): super(ReleaseStartMetadata, self).__init__() self.artifacts = artifacts self.definition_id = definition_id self.description = description self.environments_metadata = environments_metadata self.is_draft = is_draft self.manual_environments = manual_environments self.properties = properties self.reason = reason self.variables = variables class ReleaseTask(Model): """ReleaseTask. :param agent_name: :type agent_name: str :param date_ended: :type date_ended: datetime :param date_started: :type date_started: datetime :param finish_time: :type finish_time: datetime :param id: :type id: int :param issues: :type issues: list of :class:`Issue ` :param line_count: :type line_count: long :param log_url: :type log_url: str :param name: :type name: str :param percent_complete: :type percent_complete: int :param rank: :type rank: int :param result_code: :type result_code: str :param start_time: :type start_time: datetime :param status: :type status: object :param task: :type task: :class:`WorkflowTaskReference ` :param timeline_record_id: :type timeline_record_id: str """ _attribute_map = { 'agent_name': {'key': 'agentName', 'type': 'str'}, 'date_ended': {'key': 'dateEnded', 'type': 'iso-8601'}, 'date_started': {'key': 'dateStarted', 'type': 'iso-8601'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'issues': {'key': 'issues', 'type': '[Issue]'}, 'line_count': {'key': 'lineCount', 'type': 'long'}, 'log_url': {'key': 'logUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, 'rank': {'key': 'rank', 'type': 'int'}, 'result_code': {'key': 'resultCode', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'task': {'key': 'task', 'type': 'WorkflowTaskReference'}, 'timeline_record_id': {'key': 'timelineRecordId', 'type': 'str'} } def __init__(self, agent_name=None, date_ended=None, date_started=None, finish_time=None, id=None, issues=None, line_count=None, log_url=None, name=None, percent_complete=None, rank=None, result_code=None, start_time=None, status=None, task=None, timeline_record_id=None): super(ReleaseTask, self).__init__() self.agent_name = agent_name self.date_ended = date_ended self.date_started = date_started self.finish_time = finish_time self.id = id self.issues = issues self.line_count = line_count self.log_url = log_url self.name = name self.percent_complete = percent_complete self.rank = rank self.result_code = result_code self.start_time = start_time self.status = status self.task = task self.timeline_record_id = timeline_record_id class ReleaseTaskAttachment(Model): """ReleaseTaskAttachment. :param _links: :type _links: :class:`ReferenceLinks ` :param created_on: :type created_on: datetime :param modified_by: :type modified_by: :class:`IdentityRef ` :param modified_on: :type modified_on: datetime :param name: :type name: str :param record_id: :type record_id: str :param timeline_id: :type timeline_id: str :param type: :type type: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'record_id': {'key': 'recordId', 'type': 'str'}, 'timeline_id': {'key': 'timelineId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, _links=None, created_on=None, modified_by=None, modified_on=None, name=None, record_id=None, timeline_id=None, type=None): super(ReleaseTaskAttachment, self).__init__() self._links = _links self.created_on = created_on self.modified_by = modified_by self.modified_on = modified_on self.name = name self.record_id = record_id self.timeline_id = timeline_id self.type = type class ReleaseUpdateMetadata(Model): """ReleaseUpdateMetadata. :param comment: Sets comment for release. :type comment: str :param keep_forever: Set 'true' to exclude the release from retention policies. :type keep_forever: bool :param manual_environments: Sets list of manual environments. :type manual_environments: list of str :param status: Sets status of the release. :type status: object """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'keep_forever': {'key': 'keepForever', 'type': 'bool'}, 'manual_environments': {'key': 'manualEnvironments', 'type': '[str]'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, comment=None, keep_forever=None, manual_environments=None, status=None): super(ReleaseUpdateMetadata, self).__init__() self.comment = comment self.keep_forever = keep_forever self.manual_environments = manual_environments self.status = status class ReleaseWorkItemRef(Model): """ReleaseWorkItemRef. :param assignee: :type assignee: str :param id: :type id: str :param state: :type state: str :param title: :type title: str :param type: :type type: str :param url: :type url: str """ _attribute_map = { 'assignee': {'key': 'assignee', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, assignee=None, id=None, state=None, title=None, type=None, url=None): super(ReleaseWorkItemRef, self).__init__() self.assignee = assignee self.id = id self.state = state self.title = title self.type = type self.url = url class RetentionPolicy(Model): """RetentionPolicy. :param days_to_keep: :type days_to_keep: int """ _attribute_map = { 'days_to_keep': {'key': 'daysToKeep', 'type': 'int'} } def __init__(self, days_to_keep=None): super(RetentionPolicy, self).__init__() self.days_to_keep = days_to_keep class RetentionSettings(Model): """RetentionSettings. :param days_to_keep_deleted_releases: :type days_to_keep_deleted_releases: int :param default_environment_retention_policy: :type default_environment_retention_policy: :class:`EnvironmentRetentionPolicy ` :param maximum_environment_retention_policy: :type maximum_environment_retention_policy: :class:`EnvironmentRetentionPolicy ` """ _attribute_map = { 'days_to_keep_deleted_releases': {'key': 'daysToKeepDeletedReleases', 'type': 'int'}, 'default_environment_retention_policy': {'key': 'defaultEnvironmentRetentionPolicy', 'type': 'EnvironmentRetentionPolicy'}, 'maximum_environment_retention_policy': {'key': 'maximumEnvironmentRetentionPolicy', 'type': 'EnvironmentRetentionPolicy'} } def __init__(self, days_to_keep_deleted_releases=None, default_environment_retention_policy=None, maximum_environment_retention_policy=None): super(RetentionSettings, self).__init__() self.days_to_keep_deleted_releases = days_to_keep_deleted_releases self.default_environment_retention_policy = default_environment_retention_policy self.maximum_environment_retention_policy = maximum_environment_retention_policy class SourcePullRequestVersion(Model): """SourcePullRequestVersion. :param pull_request_id: Pull Request Id for which the release will publish status :type pull_request_id: str :param pull_request_merged_at: :type pull_request_merged_at: datetime :param source_branch_commit_id: Source branch commit Id of the Pull Request for which the release will publish status :type source_branch_commit_id: str """ _attribute_map = { 'pull_request_id': {'key': 'pullRequestId', 'type': 'str'}, 'pull_request_merged_at': {'key': 'pullRequestMergedAt', 'type': 'iso-8601'}, 'source_branch_commit_id': {'key': 'sourceBranchCommitId', 'type': 'str'} } def __init__(self, pull_request_id=None, pull_request_merged_at=None, source_branch_commit_id=None): super(SourcePullRequestVersion, self).__init__() self.pull_request_id = pull_request_id self.pull_request_merged_at = pull_request_merged_at self.source_branch_commit_id = source_branch_commit_id class SummaryMailSection(Model): """SummaryMailSection. :param html_content: :type html_content: str :param rank: :type rank: int :param section_type: :type section_type: object :param title: :type title: str """ _attribute_map = { 'html_content': {'key': 'htmlContent', 'type': 'str'}, 'rank': {'key': 'rank', 'type': 'int'}, 'section_type': {'key': 'sectionType', 'type': 'object'}, 'title': {'key': 'title', 'type': 'str'} } def __init__(self, html_content=None, rank=None, section_type=None, title=None): super(SummaryMailSection, self).__init__() self.html_content = html_content self.rank = rank self.section_type = section_type self.title = title class TaskInputDefinitionBase(Model): """TaskInputDefinitionBase. :param aliases: :type aliases: list of str :param default_value: :type default_value: str :param group_name: :type group_name: str :param help_mark_down: :type help_mark_down: str :param label: :type label: str :param name: :type name: str :param options: :type options: dict :param properties: :type properties: dict :param required: :type required: bool :param type: :type type: str :param validation: :type validation: :class:`TaskInputValidation ` :param visible_rule: :type visible_rule: str """ _attribute_map = { 'aliases': {'key': 'aliases', 'type': '[str]'}, 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'options': {'key': 'options', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'str'}, 'validation': {'key': 'validation', 'type': 'TaskInputValidation'}, 'visible_rule': {'key': 'visibleRule', 'type': 'str'} } def __init__(self, aliases=None, default_value=None, group_name=None, help_mark_down=None, label=None, name=None, options=None, properties=None, required=None, type=None, validation=None, visible_rule=None): super(TaskInputDefinitionBase, self).__init__() self.aliases = aliases self.default_value = default_value self.group_name = group_name self.help_mark_down = help_mark_down self.label = label self.name = name self.options = options self.properties = properties self.required = required self.type = type self.validation = validation self.visible_rule = visible_rule class TaskInputValidation(Model): """TaskInputValidation. :param expression: Conditional expression :type expression: str :param message: Message explaining how user can correct if validation fails :type message: str """ _attribute_map = { 'expression': {'key': 'expression', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'} } def __init__(self, expression=None, message=None): super(TaskInputValidation, self).__init__() self.expression = expression self.message = message class TaskSourceDefinitionBase(Model): """TaskSourceDefinitionBase. :param auth_key: :type auth_key: str :param endpoint: :type endpoint: str :param key_selector: :type key_selector: str :param selector: :type selector: str :param target: :type target: str """ _attribute_map = { 'auth_key': {'key': 'authKey', 'type': 'str'}, 'endpoint': {'key': 'endpoint', 'type': 'str'}, 'key_selector': {'key': 'keySelector', 'type': 'str'}, 'selector': {'key': 'selector', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, auth_key=None, endpoint=None, key_selector=None, selector=None, target=None): super(TaskSourceDefinitionBase, self).__init__() self.auth_key = auth_key self.endpoint = endpoint self.key_selector = key_selector self.selector = selector self.target = target class VariableGroup(Model): """VariableGroup. :param created_by: Gets or sets the identity who created. :type created_by: :class:`IdentityRef ` :param created_on: Gets date on which it got created. :type created_on: datetime :param description: Gets or sets description. :type description: str :param id: Gets the unique identifier of this field. :type id: int :param is_shared: Denotes if a variable group is shared with other project or not. :type is_shared: bool :param modified_by: Gets or sets the identity who modified. :type modified_by: :class:`IdentityRef ` :param modified_on: Gets date on which it got modified. :type modified_on: datetime :param name: Gets or sets name. :type name: str :param provider_data: Gets or sets provider data. :type provider_data: :class:`VariableGroupProviderData ` :param type: Gets or sets type. :type type: str :param variables: :type variables: dict """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'is_shared': {'key': 'isShared', 'type': 'bool'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'provider_data': {'key': 'providerData', 'type': 'VariableGroupProviderData'}, 'type': {'key': 'type', 'type': 'str'}, 'variables': {'key': 'variables', 'type': '{VariableValue}'} } def __init__(self, created_by=None, created_on=None, description=None, id=None, is_shared=None, modified_by=None, modified_on=None, name=None, provider_data=None, type=None, variables=None): super(VariableGroup, self).__init__() self.created_by = created_by self.created_on = created_on self.description = description self.id = id self.is_shared = is_shared self.modified_by = modified_by self.modified_on = modified_on self.name = name self.provider_data = provider_data self.type = type self.variables = variables class VariableGroupProviderData(Model): """VariableGroupProviderData. """ _attribute_map = { } def __init__(self): super(VariableGroupProviderData, self).__init__() class VariableValue(Model): """VariableValue. :param is_secret: :type is_secret: bool :param value: :type value: str """ _attribute_map = { 'is_secret': {'key': 'isSecret', 'type': 'bool'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, is_secret=None, value=None): super(VariableValue, self).__init__() self.is_secret = is_secret self.value = value class WorkflowTask(Model): """WorkflowTask. :param always_run: :type always_run: bool :param condition: :type condition: str :param continue_on_error: :type continue_on_error: bool :param definition_type: :type definition_type: str :param enabled: :type enabled: bool :param environment: :type environment: dict :param inputs: :type inputs: dict :param name: :type name: str :param override_inputs: :type override_inputs: dict :param ref_name: :type ref_name: str :param task_id: :type task_id: str :param timeout_in_minutes: :type timeout_in_minutes: int :param version: :type version: str """ _attribute_map = { 'always_run': {'key': 'alwaysRun', 'type': 'bool'}, 'condition': {'key': 'condition', 'type': 'str'}, 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, 'definition_type': {'key': 'definitionType', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'environment': {'key': 'environment', 'type': '{str}'}, 'inputs': {'key': 'inputs', 'type': '{str}'}, 'name': {'key': 'name', 'type': 'str'}, 'override_inputs': {'key': 'overrideInputs', 'type': '{str}'}, 'ref_name': {'key': 'refName', 'type': 'str'}, 'task_id': {'key': 'taskId', 'type': 'str'}, 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, always_run=None, condition=None, continue_on_error=None, definition_type=None, enabled=None, environment=None, inputs=None, name=None, override_inputs=None, ref_name=None, task_id=None, timeout_in_minutes=None, version=None): super(WorkflowTask, self).__init__() self.always_run = always_run self.condition = condition self.continue_on_error = continue_on_error self.definition_type = definition_type self.enabled = enabled self.environment = environment self.inputs = inputs self.name = name self.override_inputs = override_inputs self.ref_name = ref_name self.task_id = task_id self.timeout_in_minutes = timeout_in_minutes self.version = version class WorkflowTaskReference(Model): """WorkflowTaskReference. :param id: :type id: str :param name: :type name: str :param version: :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, name=None, version=None): super(WorkflowTaskReference, self).__init__() self.id = id self.name = name self.version = version class ReleaseDefinition(ReleaseDefinitionShallowReference): """ReleaseDefinition. :param _links: Gets the links to related resources, APIs, and views for the release definition. :type _links: :class:`ReferenceLinks ` :param id: Gets the unique identifier of release definition. :type id: int :param name: Gets or sets the name of the release definition. :type name: str :param path: Gets or sets the path of the release definition. :type path: str :param project_reference: Gets or sets project reference. :type project_reference: :class:`ProjectReference ` :param url: Gets the REST API url to access the release definition. :type url: str :param artifacts: Gets or sets the list of artifacts. :type artifacts: list of :class:`Artifact ` :param comment: Gets or sets comment. :type comment: str :param created_by: Gets or sets the identity who created. :type created_by: :class:`IdentityRef ` :param created_on: Gets date on which it got created. :type created_on: datetime :param description: Gets or sets the description. :type description: str :param environments: Gets or sets the list of environments. :type environments: list of :class:`ReleaseDefinitionEnvironment ` :param is_deleted: Whether release definition is deleted. :type is_deleted: bool :param last_release: Gets the reference of last release. :type last_release: :class:`ReleaseReference ` :param modified_by: Gets or sets the identity who modified. :type modified_by: :class:`IdentityRef ` :param modified_on: Gets date on which it got modified. :type modified_on: datetime :param pipeline_process: Gets or sets pipeline process. :type pipeline_process: :class:`PipelineProcess ` :param properties: Gets or sets properties. :type properties: :class:`object ` :param release_name_format: Gets or sets the release name format. :type release_name_format: str :param retention_policy: :type retention_policy: :class:`RetentionPolicy ` :param revision: Gets the revision number. :type revision: int :param source: Gets or sets source of release definition. :type source: object :param tags: Gets or sets list of tags. :type tags: list of str :param triggers: Gets or sets the list of triggers. :type triggers: list of :class:`object ` :param variable_groups: Gets or sets the list of variable groups. :type variable_groups: list of int :param variables: Gets or sets the dictionary of variables. :type variables: dict """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project_reference': {'key': 'projectReference', 'type': 'ProjectReference'}, 'url': {'key': 'url', 'type': 'str'}, 'artifacts': {'key': 'artifacts', 'type': '[Artifact]'}, 'comment': {'key': 'comment', 'type': 'str'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'environments': {'key': 'environments', 'type': '[ReleaseDefinitionEnvironment]'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'last_release': {'key': 'lastRelease', 'type': 'ReleaseReference'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'pipeline_process': {'key': 'pipelineProcess', 'type': 'PipelineProcess'}, 'properties': {'key': 'properties', 'type': 'object'}, 'release_name_format': {'key': 'releaseNameFormat', 'type': 'str'}, 'retention_policy': {'key': 'retentionPolicy', 'type': 'RetentionPolicy'}, 'revision': {'key': 'revision', 'type': 'int'}, 'source': {'key': 'source', 'type': 'object'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'triggers': {'key': 'triggers', 'type': '[object]'}, 'variable_groups': {'key': 'variableGroups', 'type': '[int]'}, 'variables': {'key': 'variables', 'type': '{ConfigurationVariableValue}'} } def __init__(self, _links=None, id=None, name=None, path=None, project_reference=None, url=None, artifacts=None, comment=None, created_by=None, created_on=None, description=None, environments=None, is_deleted=None, last_release=None, modified_by=None, modified_on=None, pipeline_process=None, properties=None, release_name_format=None, retention_policy=None, revision=None, source=None, tags=None, triggers=None, variable_groups=None, variables=None): super(ReleaseDefinition, self).__init__(_links=_links, id=id, name=name, path=path, project_reference=project_reference, url=url) self.artifacts = artifacts self.comment = comment self.created_by = created_by self.created_on = created_on self.description = description self.environments = environments self.is_deleted = is_deleted self.last_release = last_release self.modified_by = modified_by self.modified_on = modified_on self.pipeline_process = pipeline_process self.properties = properties self.release_name_format = release_name_format self.retention_policy = retention_policy self.revision = revision self.source = source self.tags = tags self.triggers = triggers self.variable_groups = variable_groups self.variables = variables class ReleaseDefinitionApprovalStep(ReleaseDefinitionEnvironmentStep): """ReleaseDefinitionApprovalStep. :param id: :type id: int :param approver: :type approver: :class:`IdentityRef ` :param is_automated: :type is_automated: bool :param is_notification_on: :type is_notification_on: bool :param rank: :type rank: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'approver': {'key': 'approver', 'type': 'IdentityRef'}, 'is_automated': {'key': 'isAutomated', 'type': 'bool'}, 'is_notification_on': {'key': 'isNotificationOn', 'type': 'bool'}, 'rank': {'key': 'rank', 'type': 'int'} } def __init__(self, id=None, approver=None, is_automated=None, is_notification_on=None, rank=None): super(ReleaseDefinitionApprovalStep, self).__init__(id=id) self.approver = approver self.is_automated = is_automated self.is_notification_on = is_notification_on self.rank = rank class ReleaseDefinitionDeployStep(ReleaseDefinitionEnvironmentStep): """ReleaseDefinitionDeployStep. :param id: :type id: int :param tasks: The list of steps for this definition. :type tasks: list of :class:`WorkflowTask ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'tasks': {'key': 'tasks', 'type': '[WorkflowTask]'} } def __init__(self, id=None, tasks=None): super(ReleaseDefinitionDeployStep, self).__init__(id=id) self.tasks = tasks __all__ = [ 'AgentArtifactDefinition', 'ApprovalOptions', 'Artifact', 'ArtifactMetadata', 'ArtifactSourceReference', 'ArtifactTriggerConfiguration', 'ArtifactTypeDefinition', 'ArtifactVersion', 'ArtifactVersionQueryResult', 'AuthorizationHeader', 'AutoTriggerIssue', 'BuildVersion', 'Change', 'Condition', 'ConfigurationVariableValue', 'DataSourceBindingBase', 'DefinitionEnvironmentReference', 'Deployment', 'DeploymentAttempt', 'DeploymentJob', 'DeploymentQueryParameters', 'EmailRecipients', 'EnvironmentExecutionPolicy', 'EnvironmentOptions', 'EnvironmentRetentionPolicy', 'EnvironmentTrigger', 'FavoriteItem', 'Folder', 'GateUpdateMetadata', 'GraphSubjectBase', 'IdentityRef', 'IgnoredGate', 'InputDescriptor', 'InputValidation', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'Issue', 'MailMessage', 'ManualIntervention', 'ManualInterventionUpdateMetadata', 'Metric', 'PipelineProcess', 'ProcessParameters', 'ProjectReference', 'QueuedReleaseData', 'ReferenceLinks', 'Release', 'ReleaseApproval', 'ReleaseApprovalHistory', 'ReleaseCondition', 'ReleaseDefinitionApprovals', 'ReleaseDefinitionEnvironment', 'ReleaseDefinitionEnvironmentStep', 'ReleaseDefinitionEnvironmentSummary', 'ReleaseDefinitionEnvironmentTemplate', 'ReleaseDefinitionGate', 'ReleaseDefinitionGatesOptions', 'ReleaseDefinitionGatesStep', 'ReleaseDefinitionRevision', 'ReleaseDefinitionShallowReference', 'ReleaseDefinitionSummary', 'ReleaseDefinitionUndeleteParameter', 'ReleaseDeployPhase', 'ReleaseEnvironment', 'ReleaseEnvironmentShallowReference', 'ReleaseEnvironmentUpdateMetadata', 'ReleaseGates', 'ReleaseReference', 'ReleaseRevision', 'ReleaseSchedule', 'ReleaseSettings', 'ReleaseShallowReference', 'ReleaseStartEnvironmentMetadata', 'ReleaseStartMetadata', 'ReleaseTask', 'ReleaseTaskAttachment', 'ReleaseUpdateMetadata', 'ReleaseWorkItemRef', 'RetentionPolicy', 'RetentionSettings', 'SourcePullRequestVersion', 'SummaryMailSection', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskSourceDefinitionBase', 'VariableGroup', 'VariableGroupProviderData', 'VariableValue', 'WorkflowTask', 'WorkflowTaskReference', 'ReleaseDefinition', 'ReleaseDefinitionApprovalStep', 'ReleaseDefinitionDeployStep', ] release_client.py000066400000000000000000001401451360605530400337530ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/release# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class ReleaseClient(Client): """Release :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ReleaseClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'efc2f575-36ef-48e9-b672-0c6fb4a48ac5' def get_approvals(self, project, assigned_to_filter=None, status_filter=None, release_ids_filter=None, type_filter=None, top=None, continuation_token=None, query_order=None, include_my_group_approvals=None): """GetApprovals. Get a list of approvals :param str project: Project ID or project name :param str assigned_to_filter: Approvals assigned to this user. :param str status_filter: Approvals with this status. Default is 'pending'. :param [int] release_ids_filter: Approvals for release id(s) mentioned in the filter. Multiple releases can be mentioned by separating them with ',' e.g. releaseIdsFilter=1,2,3,4. :param str type_filter: Approval with this type. :param int top: Number of approvals to get. Default is 50. :param int continuation_token: Gets the approvals after the continuation token provided. :param str query_order: Gets the results in the defined order of created approvals. Default is 'descending'. :param bool include_my_group_approvals: 'true' to include my group approvals. Default is 'false'. :rtype: [ReleaseApproval] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if assigned_to_filter is not None: query_parameters['assignedToFilter'] = self._serialize.query('assigned_to_filter', assigned_to_filter, 'str') if status_filter is not None: query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') if release_ids_filter is not None: release_ids_filter = ",".join(map(str, release_ids_filter)) query_parameters['releaseIdsFilter'] = self._serialize.query('release_ids_filter', release_ids_filter, 'str') if type_filter is not None: query_parameters['typeFilter'] = self._serialize.query('type_filter', type_filter, 'str') if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if include_my_group_approvals is not None: query_parameters['includeMyGroupApprovals'] = self._serialize.query('include_my_group_approvals', include_my_group_approvals, 'bool') response = self._send(http_method='GET', location_id='b47c6458-e73b-47cb-a770-4df1e8813a91', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ReleaseApproval]', self._unwrap_collection(response)) def update_release_approval(self, approval, project, approval_id): """UpdateReleaseApproval. Update status of an approval :param :class:` ` approval: ReleaseApproval object having status, approver and comments. :param str project: Project ID or project name :param int approval_id: Id of the approval. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if approval_id is not None: route_values['approvalId'] = self._serialize.url('approval_id', approval_id, 'int') content = self._serialize.body(approval, 'ReleaseApproval') response = self._send(http_method='PATCH', location_id='9328e074-59fb-465a-89d9-b09c82ee5109', version='5.0', route_values=route_values, content=content) return self._deserialize('ReleaseApproval', response) def get_release_task_attachment_content(self, project, release_id, environment_id, attempt_id, plan_id, timeline_id, record_id, type, name, **kwargs): """GetReleaseTaskAttachmentContent. [Preview API] :param str project: Project ID or project name :param int release_id: :param int environment_id: :param int attempt_id: :param str plan_id: :param str timeline_id: :param str record_id: :param str type: :param str name: :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') if environment_id is not None: route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') if attempt_id is not None: route_values['attemptId'] = self._serialize.url('attempt_id', attempt_id, 'int') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') if record_id is not None: route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='60b86efb-7b8c-4853-8f9f-aa142b77b479', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_release_task_attachments(self, project, release_id, environment_id, attempt_id, plan_id, type): """GetReleaseTaskAttachments. [Preview API] :param str project: Project ID or project name :param int release_id: :param int environment_id: :param int attempt_id: :param str plan_id: :param str type: :rtype: [ReleaseTaskAttachment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') if environment_id is not None: route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') if attempt_id is not None: route_values['attemptId'] = self._serialize.url('attempt_id', attempt_id, 'int') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='a4d06688-0dfa-4895-82a5-f43ec9452306', version='5.0-preview.1', route_values=route_values) return self._deserialize('[ReleaseTaskAttachment]', self._unwrap_collection(response)) def create_release_definition(self, release_definition, project): """CreateReleaseDefinition. Create a release definition :param :class:` ` release_definition: release definition object to create. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(release_definition, 'ReleaseDefinition') response = self._send(http_method='POST', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.0', route_values=route_values, content=content) return self._deserialize('ReleaseDefinition', response) def delete_release_definition(self, project, definition_id, comment=None, force_delete=None): """DeleteReleaseDefinition. Delete a release definition. :param str project: Project ID or project name :param int definition_id: Id of the release definition. :param str comment: Comment for deleting a release definition. :param bool force_delete: 'true' to automatically cancel any in-progress release deployments and proceed with release definition deletion . Default is 'false'. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if comment is not None: query_parameters['comment'] = self._serialize.query('comment', comment, 'str') if force_delete is not None: query_parameters['forceDelete'] = self._serialize.query('force_delete', force_delete, 'bool') self._send(http_method='DELETE', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.0', route_values=route_values, query_parameters=query_parameters) def get_release_definition(self, project, definition_id, property_filters=None): """GetReleaseDefinition. Get a release definition. :param str project: Project ID or project name :param int definition_id: Id of the release definition. :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definition will contain values for the specified property Ids (if they exist). If not set, properties will not be included. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReleaseDefinition', response) def get_release_definitions(self, project, search_text=None, expand=None, artifact_type=None, artifact_source_id=None, top=None, continuation_token=None, query_order=None, path=None, is_exact_name_match=None, tag_filter=None, property_filters=None, definition_id_filter=None, is_deleted=None): """GetReleaseDefinitions. Get a list of release definitions. :param str project: Project ID or project name :param str search_text: Get release definitions with names containing searchText. :param str expand: The properties that should be expanded in the list of Release definitions. :param str artifact_type: Release definitions with given artifactType will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. :param str artifact_source_id: Release definitions with given artifactSourceId will be returned. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json at https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. :param int top: Number of release definitions to get. :param str continuation_token: Gets the release definitions after the continuation token provided. :param str query_order: Gets the results in the defined order. Default is 'IdAscending'. :param str path: Gets the release definitions under the specified path. :param bool is_exact_name_match: 'true'to gets the release definitions with exact match as specified in searchText. Default is 'false'. :param [str] tag_filter: A comma-delimited list of tags. Only release definitions with these tags will be returned. :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release Definitions will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release Definition from results irrespective of whether it has property set or not. :param [str] definition_id_filter: A comma-delimited list of release definitions to retrieve. :param bool is_deleted: 'true' to get release definitions that has been deleted. Default is 'false' :rtype: [ReleaseDefinition] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if search_text is not None: query_parameters['searchText'] = self._serialize.query('search_text', search_text, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if artifact_type is not None: query_parameters['artifactType'] = self._serialize.query('artifact_type', artifact_type, 'str') if artifact_source_id is not None: query_parameters['artifactSourceId'] = self._serialize.query('artifact_source_id', artifact_source_id, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if is_exact_name_match is not None: query_parameters['isExactNameMatch'] = self._serialize.query('is_exact_name_match', is_exact_name_match, 'bool') if tag_filter is not None: tag_filter = ",".join(tag_filter) query_parameters['tagFilter'] = self._serialize.query('tag_filter', tag_filter, 'str') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if definition_id_filter is not None: definition_id_filter = ",".join(definition_id_filter) query_parameters['definitionIdFilter'] = self._serialize.query('definition_id_filter', definition_id_filter, 'str') if is_deleted is not None: query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') response = self._send(http_method='GET', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ReleaseDefinition]', self._unwrap_collection(response)) def update_release_definition(self, release_definition, project): """UpdateReleaseDefinition. Update a release definition. :param :class:` ` release_definition: Release definition object to update. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(release_definition, 'ReleaseDefinition') response = self._send(http_method='PUT', location_id='d8f96f24-8ea7-4cb6-baab-2df8fc515665', version='5.0', route_values=route_values, content=content) return self._deserialize('ReleaseDefinition', response) def get_deployments(self, project, definition_id=None, definition_environment_id=None, created_by=None, min_modified_time=None, max_modified_time=None, deployment_status=None, operation_status=None, latest_attempts_only=None, query_order=None, top=None, continuation_token=None, created_for=None, min_started_time=None, max_started_time=None, source_branch=None): """GetDeployments. :param str project: Project ID or project name :param int definition_id: :param int definition_environment_id: :param str created_by: :param datetime min_modified_time: :param datetime max_modified_time: :param str deployment_status: :param str operation_status: :param bool latest_attempts_only: :param str query_order: :param int top: :param int continuation_token: :param str created_for: :param datetime min_started_time: :param datetime max_started_time: :param str source_branch: :rtype: [Deployment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definition_id is not None: query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') if definition_environment_id is not None: query_parameters['definitionEnvironmentId'] = self._serialize.query('definition_environment_id', definition_environment_id, 'int') if created_by is not None: query_parameters['createdBy'] = self._serialize.query('created_by', created_by, 'str') if min_modified_time is not None: query_parameters['minModifiedTime'] = self._serialize.query('min_modified_time', min_modified_time, 'iso-8601') if max_modified_time is not None: query_parameters['maxModifiedTime'] = self._serialize.query('max_modified_time', max_modified_time, 'iso-8601') if deployment_status is not None: query_parameters['deploymentStatus'] = self._serialize.query('deployment_status', deployment_status, 'str') if operation_status is not None: query_parameters['operationStatus'] = self._serialize.query('operation_status', operation_status, 'str') if latest_attempts_only is not None: query_parameters['latestAttemptsOnly'] = self._serialize.query('latest_attempts_only', latest_attempts_only, 'bool') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') if created_for is not None: query_parameters['createdFor'] = self._serialize.query('created_for', created_for, 'str') if min_started_time is not None: query_parameters['minStartedTime'] = self._serialize.query('min_started_time', min_started_time, 'iso-8601') if max_started_time is not None: query_parameters['maxStartedTime'] = self._serialize.query('max_started_time', max_started_time, 'iso-8601') if source_branch is not None: query_parameters['sourceBranch'] = self._serialize.query('source_branch', source_branch, 'str') response = self._send(http_method='GET', location_id='b005ef73-cddc-448e-9ba2-5193bf36b19f', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Deployment]', self._unwrap_collection(response)) def update_release_environment(self, environment_update_data, project, release_id, environment_id): """UpdateReleaseEnvironment. [Preview API] Update the status of a release environment :param :class:` ` environment_update_data: Environment update meta data. :param str project: Project ID or project name :param int release_id: Id of the release. :param int environment_id: Id of release environment. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') if environment_id is not None: route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') content = self._serialize.body(environment_update_data, 'ReleaseEnvironmentUpdateMetadata') response = self._send(http_method='PATCH', location_id='a7e426b1-03dc-48af-9dfe-c98bac612dcb', version='5.0-preview.6', route_values=route_values, content=content) return self._deserialize('ReleaseEnvironment', response) def update_gates(self, gate_update_metadata, project, gate_step_id): """UpdateGates. [Preview API] Updates the gate for a deployment. :param :class:` ` gate_update_metadata: Metadata to patch the Release Gates. :param str project: Project ID or project name :param int gate_step_id: Gate step Id. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if gate_step_id is not None: route_values['gateStepId'] = self._serialize.url('gate_step_id', gate_step_id, 'int') content = self._serialize.body(gate_update_metadata, 'GateUpdateMetadata') response = self._send(http_method='PATCH', location_id='2666a539-2001-4f80-bcc7-0379956749d4', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('ReleaseGates', response) def get_logs(self, project, release_id, **kwargs): """GetLogs. [Preview API] Get logs for a release Id. :param str project: Project ID or project name :param int release_id: Id of the release. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') response = self._send(http_method='GET', location_id='c37fbab5-214b-48e4-a55b-cb6b4f6e4038', version='5.0-preview.2', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_task_log(self, project, release_id, environment_id, release_deploy_phase_id, task_id, start_line=None, end_line=None, **kwargs): """GetTaskLog. [Preview API] Gets the task log of a release as a plain text file. :param str project: Project ID or project name :param int release_id: Id of the release. :param int environment_id: Id of release environment. :param int release_deploy_phase_id: Release deploy phase Id. :param int task_id: ReleaseTask Id for the log. :param long start_line: Starting line number for logs :param long end_line: Ending line number for logs :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') if environment_id is not None: route_values['environmentId'] = self._serialize.url('environment_id', environment_id, 'int') if release_deploy_phase_id is not None: route_values['releaseDeployPhaseId'] = self._serialize.url('release_deploy_phase_id', release_deploy_phase_id, 'int') if task_id is not None: route_values['taskId'] = self._serialize.url('task_id', task_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='17c91af7-09fd-4256-bff1-c24ee4f73bc0', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_manual_intervention(self, project, release_id, manual_intervention_id): """GetManualIntervention. Get manual intervention for a given release and manual intervention id. :param str project: Project ID or project name :param int release_id: Id of the release. :param int manual_intervention_id: Id of the manual intervention. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') if manual_intervention_id is not None: route_values['manualInterventionId'] = self._serialize.url('manual_intervention_id', manual_intervention_id, 'int') response = self._send(http_method='GET', location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', version='5.0', route_values=route_values) return self._deserialize('ManualIntervention', response) def get_manual_interventions(self, project, release_id): """GetManualInterventions. List all manual interventions for a given release. :param str project: Project ID or project name :param int release_id: Id of the release. :rtype: [ManualIntervention] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') response = self._send(http_method='GET', location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', version='5.0', route_values=route_values) return self._deserialize('[ManualIntervention]', self._unwrap_collection(response)) def update_manual_intervention(self, manual_intervention_update_metadata, project, release_id, manual_intervention_id): """UpdateManualIntervention. Update manual intervention. :param :class:` ` manual_intervention_update_metadata: Meta data to update manual intervention. :param str project: Project ID or project name :param int release_id: Id of the release. :param int manual_intervention_id: Id of the manual intervention. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') if manual_intervention_id is not None: route_values['manualInterventionId'] = self._serialize.url('manual_intervention_id', manual_intervention_id, 'int') content = self._serialize.body(manual_intervention_update_metadata, 'ManualInterventionUpdateMetadata') response = self._send(http_method='PATCH', location_id='616c46e4-f370-4456-adaa-fbaf79c7b79e', version='5.0', route_values=route_values, content=content) return self._deserialize('ManualIntervention', response) def get_releases(self, project=None, definition_id=None, definition_environment_id=None, search_text=None, created_by=None, status_filter=None, environment_status_filter=None, min_created_time=None, max_created_time=None, query_order=None, top=None, continuation_token=None, expand=None, artifact_type_id=None, source_id=None, artifact_version_id=None, source_branch_filter=None, is_deleted=None, tag_filter=None, property_filters=None, release_id_filter=None): """GetReleases. Get a list of releases :param str project: Project ID or project name :param int definition_id: Releases from this release definition Id. :param int definition_environment_id: :param str search_text: Releases with names containing searchText. :param str created_by: Releases created by this user. :param str status_filter: Releases that have this status. :param int environment_status_filter: :param datetime min_created_time: Releases that were created after this time. :param datetime max_created_time: Releases that were created before this time. :param str query_order: Gets the results in the defined order of created date for releases. Default is descending. :param int top: Number of releases to get. Default is 50. :param int continuation_token: Gets the releases after the continuation token provided. :param str expand: The property that should be expanded in the list of releases. :param str artifact_type_id: Releases with given artifactTypeId will be returned. Values can be Build, Jenkins, GitHub, Nuget, Team Build (external), ExternalTFSBuild, Git, TFVC, ExternalTfsXamlBuild. :param str source_id: Unique identifier of the artifact used. e.g. For build it would be {projectGuid}:{BuildDefinitionId}, for Jenkins it would be {JenkinsConnectionId}:{JenkinsDefinitionId}, for TfsOnPrem it would be {TfsOnPremConnectionId}:{ProjectName}:{TfsOnPremDefinitionId}. For third-party artifacts e.g. TeamCity, BitBucket you may refer 'uniqueSourceIdentifier' inside vss-extension.json https://github.com/Microsoft/vsts-rm-extensions/blob/master/Extensions. :param str artifact_version_id: Releases with given artifactVersionId will be returned. E.g. in case of Build artifactType, it is buildId. :param str source_branch_filter: Releases with given sourceBranchFilter will be returned. :param bool is_deleted: Gets the soft deleted releases, if true. :param [str] tag_filter: A comma-delimited list of tags. Only releases with these tags will be returned. :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Releases will contain values for the specified property Ids (if they exist). If not set, properties will not be included. Note that this will not filter out any Release from results irrespective of whether it has property set or not. :param [int] release_id_filter: A comma-delimited list of releases Ids. Only releases with these Ids will be returned. :rtype: [Release] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definition_id is not None: query_parameters['definitionId'] = self._serialize.query('definition_id', definition_id, 'int') if definition_environment_id is not None: query_parameters['definitionEnvironmentId'] = self._serialize.query('definition_environment_id', definition_environment_id, 'int') if search_text is not None: query_parameters['searchText'] = self._serialize.query('search_text', search_text, 'str') if created_by is not None: query_parameters['createdBy'] = self._serialize.query('created_by', created_by, 'str') if status_filter is not None: query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') if environment_status_filter is not None: query_parameters['environmentStatusFilter'] = self._serialize.query('environment_status_filter', environment_status_filter, 'int') if min_created_time is not None: query_parameters['minCreatedTime'] = self._serialize.query('min_created_time', min_created_time, 'iso-8601') if max_created_time is not None: query_parameters['maxCreatedTime'] = self._serialize.query('max_created_time', max_created_time, 'iso-8601') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if artifact_type_id is not None: query_parameters['artifactTypeId'] = self._serialize.query('artifact_type_id', artifact_type_id, 'str') if source_id is not None: query_parameters['sourceId'] = self._serialize.query('source_id', source_id, 'str') if artifact_version_id is not None: query_parameters['artifactVersionId'] = self._serialize.query('artifact_version_id', artifact_version_id, 'str') if source_branch_filter is not None: query_parameters['sourceBranchFilter'] = self._serialize.query('source_branch_filter', source_branch_filter, 'str') if is_deleted is not None: query_parameters['isDeleted'] = self._serialize.query('is_deleted', is_deleted, 'bool') if tag_filter is not None: tag_filter = ",".join(tag_filter) query_parameters['tagFilter'] = self._serialize.query('tag_filter', tag_filter, 'str') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if release_id_filter is not None: release_id_filter = ",".join(map(str, release_id_filter)) query_parameters['releaseIdFilter'] = self._serialize.query('release_id_filter', release_id_filter, 'str') response = self._send(http_method='GET', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Release]', self._unwrap_collection(response)) def create_release(self, release_start_metadata, project): """CreateRelease. Create a release. :param :class:` ` release_start_metadata: Metadata to create a release. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(release_start_metadata, 'ReleaseStartMetadata') response = self._send(http_method='POST', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.0', route_values=route_values, content=content) return self._deserialize('Release', response) def get_release(self, project, release_id, approval_filters=None, property_filters=None, expand=None, top_gate_records=None): """GetRelease. Get a Release :param str project: Project ID or project name :param int release_id: Id of the release. :param str approval_filters: A filter which would allow fetching approval steps selectively based on whether it is automated, or manual. This would also decide whether we should fetch pre and post approval snapshots. Assumes All by default :param [str] property_filters: A comma-delimited list of extended properties to be retrieved. If set, the returned Release will contain values for the specified property Ids (if they exist). If not set, properties will not be included. :param str expand: A property that should be expanded in the release. :param int top_gate_records: Number of release gate records to get. Default is 5. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') query_parameters = {} if approval_filters is not None: query_parameters['approvalFilters'] = self._serialize.query('approval_filters', approval_filters, 'str') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if top_gate_records is not None: query_parameters['$topGateRecords'] = self._serialize.query('top_gate_records', top_gate_records, 'int') response = self._send(http_method='GET', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Release', response) def get_release_revision(self, project, release_id, definition_snapshot_revision, **kwargs): """GetReleaseRevision. Get release for a given revision number. :param str project: Project ID or project name :param int release_id: Id of the release. :param int definition_snapshot_revision: Definition snapshot revision number. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') query_parameters = {} if definition_snapshot_revision is not None: query_parameters['definitionSnapshotRevision'] = self._serialize.query('definition_snapshot_revision', definition_snapshot_revision, 'int') response = self._send(http_method='GET', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def update_release(self, release, project, release_id): """UpdateRelease. Update a complete release object. :param :class:` ` release: Release object for update. :param str project: Project ID or project name :param int release_id: Id of the release to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') content = self._serialize.body(release, 'Release') response = self._send(http_method='PUT', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.0', route_values=route_values, content=content) return self._deserialize('Release', response) def update_release_resource(self, release_update_metadata, project, release_id): """UpdateReleaseResource. Update few properties of a release. :param :class:` ` release_update_metadata: Properties of release to update. :param str project: Project ID or project name :param int release_id: Id of the release to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if release_id is not None: route_values['releaseId'] = self._serialize.url('release_id', release_id, 'int') content = self._serialize.body(release_update_metadata, 'ReleaseUpdateMetadata') response = self._send(http_method='PATCH', location_id='a166fde7-27ad-408e-ba75-703c2cc9d500', version='5.0', route_values=route_values, content=content) return self._deserialize('Release', response) def get_definition_revision(self, project, definition_id, revision, **kwargs): """GetDefinitionRevision. [Preview API] Get release definition for a given definitionId and revision :param str project: Project ID or project name :param int definition_id: Id of the definition. :param int revision: Id of the revision. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') if revision is not None: route_values['revision'] = self._serialize.url('revision', revision, 'int') response = self._send(http_method='GET', location_id='258b82e0-9d41-43f3-86d6-fef14ddd44bc', version='5.0-preview.1', route_values=route_values, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_release_definition_history(self, project, definition_id): """GetReleaseDefinitionHistory. [Preview API] Get revision history for a release definition :param str project: Project ID or project name :param int definition_id: Id of the definition. :rtype: [ReleaseDefinitionRevision] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='258b82e0-9d41-43f3-86d6-fef14ddd44bc', version='5.0-preview.1', route_values=route_values) return self._deserialize('[ReleaseDefinitionRevision]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/search/000077500000000000000000000000001360605530400303225ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/search/__init__.py000066400000000000000000000021431360605530400324330ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .search_client import SearchClient __all__ = [ 'CodeResult', 'CodeSearchRequest', 'CodeSearchResponse', 'Collection', 'EntitySearchRequest', 'EntitySearchRequestBase', 'EntitySearchResponse', 'Filter', 'Hit', 'Project', 'ProjectReference', 'Repository', 'SortOption', 'Wiki', 'WikiHit', 'WikiResult', 'WikiSearchRequest', 'WikiSearchResponse', 'WorkItemHit', 'WorkItemResult', 'WorkItemSearchRequest', 'WorkItemSearchResponse', 'SearchClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/search/models.py000066400000000000000000000576211360605530400321720ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class CodeResult(Model): """CodeResult. :param collection: Collection of the result file. :type collection: :class:`Collection ` :param content_id: ContentId of the result file. :type content_id: str :param file_name: Name of the result file. :type file_name: str :param matches: Dictionary of field to hit offsets in the result file. Key identifies the area in which hits were found, for ex: file content/file name etc. :type matches: dict :param path: Path at which result file is present. :type path: str :param project: Project of the result file. :type project: :class:`Project ` :param repository: Repository of the result file. :type repository: :class:`Repository ` :param versions: Versions of the result file. :type versions: list of :class:`str ` """ _attribute_map = { 'collection': {'key': 'collection', 'type': 'Collection'}, 'content_id': {'key': 'contentId', 'type': 'str'}, 'file_name': {'key': 'fileName', 'type': 'str'}, 'matches': {'key': 'matches', 'type': '{[Hit]}'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'Project'}, 'repository': {'key': 'repository', 'type': 'Repository'}, 'versions': {'key': 'versions', 'type': '[str]'} } def __init__(self, collection=None, content_id=None, file_name=None, matches=None, path=None, project=None, repository=None, versions=None): super(CodeResult, self).__init__() self.collection = collection self.content_id = content_id self.file_name = file_name self.matches = matches self.path = path self.project = project self.repository = repository self.versions = versions class Collection(Model): """Collection. :param name: Name of the collection. :type name: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'} } def __init__(self, name=None): super(Collection, self).__init__() self.name = name class EntitySearchRequestBase(Model): """EntitySearchRequestBase. :param filters: Filters to be applied. Set it to null if there are no filters to be applied. :type filters: dict :param search_text: The search text. :type search_text: str """ _attribute_map = { 'filters': {'key': 'filters', 'type': '{[str]}'}, 'search_text': {'key': 'searchText', 'type': 'str'} } def __init__(self, filters=None, search_text=None): super(EntitySearchRequestBase, self).__init__() self.filters = filters self.search_text = search_text class EntitySearchResponse(Model): """EntitySearchResponse. :param facets: A dictionary storing an array of Filter object against each facet. :type facets: dict :param info_code: Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose. :type info_code: int """ _attribute_map = { 'facets': {'key': 'facets', 'type': '{[Filter]}'}, 'info_code': {'key': 'infoCode', 'type': 'int'} } def __init__(self, facets=None, info_code=None): super(EntitySearchResponse, self).__init__() self.facets = facets self.info_code = info_code class Filter(Model): """Filter. :param id: Id of the filter bucket. :type id: str :param name: Name of the filter bucket. :type name: str :param result_count: Count of matches in the filter bucket. :type result_count: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'result_count': {'key': 'resultCount', 'type': 'int'} } def __init__(self, id=None, name=None, result_count=None): super(Filter, self).__init__() self.id = id self.name = name self.result_count = result_count class Hit(Model): """Hit. :param char_offset: Gets or sets the start character offset of a piece of text. :type char_offset: int :param length: Gets or sets the length of a piece of text. :type length: int """ _attribute_map = { 'char_offset': {'key': 'charOffset', 'type': 'int'}, 'length': {'key': 'length', 'type': 'int'} } def __init__(self, char_offset=None, length=None): super(Hit, self).__init__() self.char_offset = char_offset self.length = length class Project(Model): """Project. :param id: Id of the project. :type id: str :param name: Name of the project. :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(Project, self).__init__() self.id = id self.name = name class ProjectReference(Model): """ProjectReference. :param id: ID of the project. :type id: str :param name: Name of the project. :type name: str :param visibility: Visibility of the project. :type visibility: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'visibility': {'key': 'visibility', 'type': 'str'} } def __init__(self, id=None, name=None, visibility=None): super(ProjectReference, self).__init__() self.id = id self.name = name self.visibility = visibility class Repository(Model): """Repository. :param id: Id of the repository. :type id: str :param name: Name of the repository. :type name: str :param type: Version control type of the result file. :type type: object """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, id=None, name=None, type=None): super(Repository, self).__init__() self.id = id self.name = name self.type = type class SortOption(Model): """SortOption. :param field: Field name on which sorting should be done. :type field: str :param sort_order: Order (ASC/DESC) in which the results should be sorted. :type sort_order: str """ _attribute_map = { 'field': {'key': 'field', 'type': 'str'}, 'sort_order': {'key': 'sortOrder', 'type': 'str'} } def __init__(self, field=None, sort_order=None): super(SortOption, self).__init__() self.field = field self.sort_order = sort_order class Wiki(Model): """Wiki. :param id: Id of the wiki. :type id: str :param mapped_path: Mapped path for the wiki. :type mapped_path: str :param name: Name of the wiki. :type name: str :param version: Version for wiki. :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'mapped_path': {'key': 'mappedPath', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, mapped_path=None, name=None, version=None): super(Wiki, self).__init__() self.id = id self.mapped_path = mapped_path self.name = name self.version = version class WikiHit(Model): """WikiHit. :param field_reference_name: Reference name of the highlighted field. :type field_reference_name: str :param highlights: Matched/highlighted snippets of the field. :type highlights: list of str """ _attribute_map = { 'field_reference_name': {'key': 'fieldReferenceName', 'type': 'str'}, 'highlights': {'key': 'highlights', 'type': '[str]'} } def __init__(self, field_reference_name=None, highlights=None): super(WikiHit, self).__init__() self.field_reference_name = field_reference_name self.highlights = highlights class WikiResult(Model): """WikiResult. :param collection: Collection of the result file. :type collection: :class:`Collection ` :param content_id: ContentId of the result file. :type content_id: str :param file_name: Name of the result file. :type file_name: str :param hits: Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets. :type hits: list of :class:`WikiHit ` :param path: Path at which result file is present. :type path: str :param project: Project details of the wiki document. :type project: :class:`ProjectReference ` :param wiki: Wiki information for the result. :type wiki: :class:`Wiki ` """ _attribute_map = { 'collection': {'key': 'collection', 'type': 'Collection'}, 'content_id': {'key': 'contentId', 'type': 'str'}, 'file_name': {'key': 'fileName', 'type': 'str'}, 'hits': {'key': 'hits', 'type': '[WikiHit]'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'ProjectReference'}, 'wiki': {'key': 'wiki', 'type': 'Wiki'} } def __init__(self, collection=None, content_id=None, file_name=None, hits=None, path=None, project=None, wiki=None): super(WikiResult, self).__init__() self.collection = collection self.content_id = content_id self.file_name = file_name self.hits = hits self.path = path self.project = project self.wiki = wiki class WikiSearchResponse(EntitySearchResponse): """WikiSearchResponse. :param facets: A dictionary storing an array of Filter object against each facet. :type facets: dict :param info_code: Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose. :type info_code: int :param count: Total number of matched wiki documents. :type count: int :param results: List of top matched wiki documents. :type results: list of :class:`WikiResult ` """ _attribute_map = { 'facets': {'key': 'facets', 'type': '{[Filter]}'}, 'info_code': {'key': 'infoCode', 'type': 'int'}, 'count': {'key': 'count', 'type': 'int'}, 'results': {'key': 'results', 'type': '[WikiResult]'} } def __init__(self, facets=None, info_code=None, count=None, results=None): super(WikiSearchResponse, self).__init__(facets=facets, info_code=info_code) self.count = count self.results = results class WorkItemHit(Model): """WorkItemHit. :param field_reference_name: Reference name of the highlighted field. :type field_reference_name: str :param highlights: Matched/highlighted snippets of the field. :type highlights: list of str """ _attribute_map = { 'field_reference_name': {'key': 'fieldReferenceName', 'type': 'str'}, 'highlights': {'key': 'highlights', 'type': '[str]'} } def __init__(self, field_reference_name=None, highlights=None): super(WorkItemHit, self).__init__() self.field_reference_name = field_reference_name self.highlights = highlights class WorkItemResult(Model): """WorkItemResult. :param fields: A standard set of work item fields and their values. :type fields: dict :param hits: Highlighted snippets of fields that match the search request. The list is sorted by relevance of the snippets. :type hits: list of :class:`WorkItemHit ` :param project: Project details of the work item. :type project: :class:`Project ` :param url: Reference to the work item. :type url: str """ _attribute_map = { 'fields': {'key': 'fields', 'type': '{str}'}, 'hits': {'key': 'hits', 'type': '[WorkItemHit]'}, 'project': {'key': 'project', 'type': 'Project'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, fields=None, hits=None, project=None, url=None): super(WorkItemResult, self).__init__() self.fields = fields self.hits = hits self.project = project self.url = url class WorkItemSearchResponse(EntitySearchResponse): """WorkItemSearchResponse. :param facets: A dictionary storing an array of Filter object against each facet. :type facets: dict :param info_code: Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose. :type info_code: int :param count: Total number of matched work items. :type count: int :param results: List of top matched work items. :type results: list of :class:`WorkItemResult ` """ _attribute_map = { 'facets': {'key': 'facets', 'type': '{[Filter]}'}, 'info_code': {'key': 'infoCode', 'type': 'int'}, 'count': {'key': 'count', 'type': 'int'}, 'results': {'key': 'results', 'type': '[WorkItemResult]'} } def __init__(self, facets=None, info_code=None, count=None, results=None): super(WorkItemSearchResponse, self).__init__(facets=facets, info_code=info_code) self.count = count self.results = results class CodeSearchResponse(EntitySearchResponse): """CodeSearchResponse. :param facets: A dictionary storing an array of Filter object against each facet. :type facets: dict :param info_code: Numeric code indicating any additional information: 0 - Ok, 1 - Account is being reindexed, 2 - Account indexing has not started, 3 - Invalid Request, 4 - Prefix wildcard query not supported, 5 - MultiWords with code facet not supported, 6 - Account is being onboarded, 7 - Account is being onboarded or reindexed, 8 - Top value trimmed to maxresult allowed 9 - Branches are being indexed, 10 - Faceting not enabled, 11 - Work items not accessible, 19 - Phrase queries with code type filters not supported, 20 - Wildcard queries with code type filters not supported. Any other info code is used for internal purpose. :type info_code: int :param count: Total number of matched files. :type count: int :param results: List of matched files. :type results: list of :class:`CodeResult ` """ _attribute_map = { 'facets': {'key': 'facets', 'type': '{[Filter]}'}, 'info_code': {'key': 'infoCode', 'type': 'int'}, 'count': {'key': 'count', 'type': 'int'}, 'results': {'key': 'results', 'type': '[CodeResult]'} } def __init__(self, facets=None, info_code=None, count=None, results=None): super(CodeSearchResponse, self).__init__(facets=facets, info_code=info_code) self.count = count self.results = results class EntitySearchRequest(EntitySearchRequestBase): """EntitySearchRequest. :param filters: Filters to be applied. Set it to null if there are no filters to be applied. :type filters: dict :param search_text: The search text. :type search_text: str :param order_by: Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy. :type order_by: list of :class:`SortOption ` :param skip: Number of results to be skipped. :type skip: int :param top: Number of results to be returned. :type top: int :param include_facets: Flag to opt for faceting in the result. Default behavior is false. :type include_facets: bool """ _attribute_map = { 'filters': {'key': 'filters', 'type': '{[str]}'}, 'search_text': {'key': 'searchText', 'type': 'str'}, 'order_by': {'key': '$orderBy', 'type': '[SortOption]'}, 'skip': {'key': '$skip', 'type': 'int'}, 'top': {'key': '$top', 'type': 'int'}, 'include_facets': {'key': 'includeFacets', 'type': 'bool'} } def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None): super(EntitySearchRequest, self).__init__(filters=filters, search_text=search_text) self.order_by = order_by self.skip = skip self.top = top self.include_facets = include_facets class WikiSearchRequest(EntitySearchRequest): """WikiSearchRequest. :param filters: Filters to be applied. Set it to null if there are no filters to be applied. :type filters: dict :param search_text: The search text. :type search_text: str :param order_by: Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy. :type order_by: list of :class:`SortOption ` :param skip: Number of results to be skipped. :type skip: int :param top: Number of results to be returned. :type top: int :param include_facets: Flag to opt for faceting in the result. Default behavior is false. :type include_facets: bool """ _attribute_map = { 'filters': {'key': 'filters', 'type': '{[str]}'}, 'search_text': {'key': 'searchText', 'type': 'str'}, 'order_by': {'key': '$orderBy', 'type': '[SortOption]'}, 'skip': {'key': '$skip', 'type': 'int'}, 'top': {'key': '$top', 'type': 'int'}, 'include_facets': {'key': 'includeFacets', 'type': 'bool'}, } def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None): super(WikiSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) class WorkItemSearchRequest(EntitySearchRequest): """WorkItemSearchRequest. :param filters: Filters to be applied. Set it to null if there are no filters to be applied. :type filters: dict :param search_text: The search text. :type search_text: str :param order_by: Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy. :type order_by: list of :class:`SortOption ` :param skip: Number of results to be skipped. :type skip: int :param top: Number of results to be returned. :type top: int :param include_facets: Flag to opt for faceting in the result. Default behavior is false. :type include_facets: bool """ _attribute_map = { 'filters': {'key': 'filters', 'type': '{[str]}'}, 'search_text': {'key': 'searchText', 'type': 'str'}, 'order_by': {'key': '$orderBy', 'type': '[SortOption]'}, 'skip': {'key': '$skip', 'type': 'int'}, 'top': {'key': '$top', 'type': 'int'}, 'include_facets': {'key': 'includeFacets', 'type': 'bool'}, } def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None): super(WorkItemSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) class CodeSearchRequest(EntitySearchRequest): """CodeSearchRequest. :param filters: Filters to be applied. Set it to null if there are no filters to be applied. :type filters: dict :param search_text: The search text. :type search_text: str :param order_by: Options for sorting search results. If set to null, the results will be returned sorted by relevance. If more than one sort option is provided, the results are sorted in the order specified in the OrderBy. :type order_by: list of :class:`SortOption ` :param skip: Number of results to be skipped. :type skip: int :param top: Number of results to be returned. :type top: int :param include_facets: Flag to opt for faceting in the result. Default behavior is false. :type include_facets: bool """ _attribute_map = { 'filters': {'key': 'filters', 'type': '{[str]}'}, 'search_text': {'key': 'searchText', 'type': 'str'}, 'order_by': {'key': '$orderBy', 'type': '[SortOption]'}, 'skip': {'key': '$skip', 'type': 'int'}, 'top': {'key': '$top', 'type': 'int'}, 'include_facets': {'key': 'includeFacets', 'type': 'bool'}, } def __init__(self, filters=None, search_text=None, order_by=None, skip=None, top=None, include_facets=None): super(CodeSearchRequest, self).__init__(filters=filters, search_text=search_text, order_by=order_by, skip=skip, top=top, include_facets=include_facets) __all__ = [ 'CodeResult', 'Collection', 'EntitySearchRequestBase', 'EntitySearchResponse', 'Filter', 'Hit', 'Project', 'ProjectReference', 'Repository', 'SortOption', 'Wiki', 'WikiHit', 'WikiResult', 'WikiSearchResponse', 'WorkItemHit', 'WorkItemResult', 'WorkItemSearchResponse', 'CodeSearchResponse', 'EntitySearchRequest', 'WikiSearchRequest', 'WorkItemSearchRequest', 'CodeSearchRequest', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/search/search_client.py000066400000000000000000000103431360605530400335000ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class SearchClient(Client): """Search :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(SearchClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'ea48a0a1-269c-42d8-b8ad-ddc8fcdcf578' def fetch_code_search_results(self, request, project=None): """FetchCodeSearchResults. [Preview API] Provides a set of results for the search text. :param :class:` ` request: The Code Search Request. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(request, 'CodeSearchRequest') response = self._send(http_method='POST', location_id='e7f29993-5b82-4fca-9386-f5cfe683d524', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('CodeSearchResponse', response) def fetch_wiki_search_results(self, request, project=None): """FetchWikiSearchResults. [Preview API] Provides a set of results for the search request. :param :class:` ` request: The Wiki Search Request. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(request, 'WikiSearchRequest') response = self._send(http_method='POST', location_id='e90e7664-7049-4100-9a86-66b161d81080', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WikiSearchResponse', response) def fetch_work_item_search_results(self, request, project=None): """FetchWorkItemSearchResults. [Preview API] Provides a set of results for the search text. :param :class:` ` request: The Work Item Search Request. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(request, 'WorkItemSearchRequest') response = self._send(http_method='POST', location_id='73b2c9e2-ff9e-4447-8cda-5f5b21ff7cae', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WorkItemSearchResponse', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/security/000077500000000000000000000000001360605530400307245ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/security/__init__.py000066400000000000000000000016021360605530400330340ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .security_client import SecurityClient __all__ = [ 'AccessControlEntry', 'AccessControlList', 'AccessControlListsCollection', 'AceExtendedInformation', 'ActionDefinition', 'PermissionEvaluation', 'PermissionEvaluationBatch', 'SecurityNamespaceDescription', 'SecurityClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/security/models.py000066400000000000000000000312201360605530400325570ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AccessControlEntry(Model): """AccessControlEntry. :param allow: The set of permission bits that represent the actions that the associated descriptor is allowed to perform. :type allow: int :param deny: The set of permission bits that represent the actions that the associated descriptor is not allowed to perform. :type deny: int :param descriptor: The descriptor for the user this AccessControlEntry applies to. :type descriptor: :class:`str ` :param extended_info: This value, when set, reports the inherited and effective information for the associated descriptor. This value is only set on AccessControlEntries returned by the QueryAccessControlList(s) call when its includeExtendedInfo parameter is set to true. :type extended_info: :class:`AceExtendedInformation ` """ _attribute_map = { 'allow': {'key': 'allow', 'type': 'int'}, 'deny': {'key': 'deny', 'type': 'int'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'extended_info': {'key': 'extendedInfo', 'type': 'AceExtendedInformation'} } def __init__(self, allow=None, deny=None, descriptor=None, extended_info=None): super(AccessControlEntry, self).__init__() self.allow = allow self.deny = deny self.descriptor = descriptor self.extended_info = extended_info class AccessControlList(Model): """AccessControlList. :param aces_dictionary: Storage of permissions keyed on the identity the permission is for. :type aces_dictionary: dict :param include_extended_info: True if this ACL holds ACEs that have extended information. :type include_extended_info: bool :param inherit_permissions: True if the given token inherits permissions from parents. :type inherit_permissions: bool :param token: The token that this AccessControlList is for. :type token: str """ _attribute_map = { 'aces_dictionary': {'key': 'acesDictionary', 'type': '{AccessControlEntry}'}, 'include_extended_info': {'key': 'includeExtendedInfo', 'type': 'bool'}, 'inherit_permissions': {'key': 'inheritPermissions', 'type': 'bool'}, 'token': {'key': 'token', 'type': 'str'} } def __init__(self, aces_dictionary=None, include_extended_info=None, inherit_permissions=None, token=None): super(AccessControlList, self).__init__() self.aces_dictionary = aces_dictionary self.include_extended_info = include_extended_info self.inherit_permissions = inherit_permissions self.token = token class AccessControlListsCollection(Model): """AccessControlListsCollection. """ _attribute_map = { } def __init__(self): super(AccessControlListsCollection, self).__init__() class AceExtendedInformation(Model): """AceExtendedInformation. :param effective_allow: This is the combination of all of the explicit and inherited permissions for this identity on this token. These are the permissions used when determining if a given user has permission to perform an action. :type effective_allow: int :param effective_deny: This is the combination of all of the explicit and inherited permissions for this identity on this token. These are the permissions used when determining if a given user has permission to perform an action. :type effective_deny: int :param inherited_allow: These are the permissions that are inherited for this identity on this token. If the token does not inherit permissions this will be 0. Note that any permissions that have been explicitly set on this token for this identity, or any groups that this identity is a part of, are not included here. :type inherited_allow: int :param inherited_deny: These are the permissions that are inherited for this identity on this token. If the token does not inherit permissions this will be 0. Note that any permissions that have been explicitly set on this token for this identity, or any groups that this identity is a part of, are not included here. :type inherited_deny: int """ _attribute_map = { 'effective_allow': {'key': 'effectiveAllow', 'type': 'int'}, 'effective_deny': {'key': 'effectiveDeny', 'type': 'int'}, 'inherited_allow': {'key': 'inheritedAllow', 'type': 'int'}, 'inherited_deny': {'key': 'inheritedDeny', 'type': 'int'} } def __init__(self, effective_allow=None, effective_deny=None, inherited_allow=None, inherited_deny=None): super(AceExtendedInformation, self).__init__() self.effective_allow = effective_allow self.effective_deny = effective_deny self.inherited_allow = inherited_allow self.inherited_deny = inherited_deny class ActionDefinition(Model): """ActionDefinition. :param bit: The bit mask integer for this action. Must be a power of 2. :type bit: int :param display_name: The localized display name for this action. :type display_name: str :param name: The non-localized name for this action. :type name: str :param namespace_id: The namespace that this action belongs to. This will only be used for reading from the database. :type namespace_id: str """ _attribute_map = { 'bit': {'key': 'bit', 'type': 'int'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'namespace_id': {'key': 'namespaceId', 'type': 'str'} } def __init__(self, bit=None, display_name=None, name=None, namespace_id=None): super(ActionDefinition, self).__init__() self.bit = bit self.display_name = display_name self.name = name self.namespace_id = namespace_id class PermissionEvaluation(Model): """PermissionEvaluation. :param permissions: Permission bit for this evaluated permission. :type permissions: int :param security_namespace_id: Security namespace identifier for this evaluated permission. :type security_namespace_id: str :param token: Security namespace-specific token for this evaluated permission. :type token: str :param value: Permission evaluation value. :type value: bool """ _attribute_map = { 'permissions': {'key': 'permissions', 'type': 'int'}, 'security_namespace_id': {'key': 'securityNamespaceId', 'type': 'str'}, 'token': {'key': 'token', 'type': 'str'}, 'value': {'key': 'value', 'type': 'bool'} } def __init__(self, permissions=None, security_namespace_id=None, token=None, value=None): super(PermissionEvaluation, self).__init__() self.permissions = permissions self.security_namespace_id = security_namespace_id self.token = token self.value = value class PermissionEvaluationBatch(Model): """PermissionEvaluationBatch. :param always_allow_administrators: True if members of the Administrators group should always pass the security check. :type always_allow_administrators: bool :param evaluations: Array of permission evaluations to evaluate. :type evaluations: list of :class:`PermissionEvaluation ` """ _attribute_map = { 'always_allow_administrators': {'key': 'alwaysAllowAdministrators', 'type': 'bool'}, 'evaluations': {'key': 'evaluations', 'type': '[PermissionEvaluation]'} } def __init__(self, always_allow_administrators=None, evaluations=None): super(PermissionEvaluationBatch, self).__init__() self.always_allow_administrators = always_allow_administrators self.evaluations = evaluations class SecurityNamespaceDescription(Model): """SecurityNamespaceDescription. :param actions: The list of actions that this Security Namespace is responsible for securing. :type actions: list of :class:`ActionDefinition ` :param dataspace_category: This is the dataspace category that describes where the security information for this SecurityNamespace should be stored. :type dataspace_category: str :param display_name: This localized name for this namespace. :type display_name: str :param element_length: If the security tokens this namespace will be operating on need to be split on certain character lengths to determine its elements, that length should be specified here. If not, this value will be -1. :type element_length: int :param extension_type: This is the type of the extension that should be loaded from the plugins directory for extending this security namespace. :type extension_type: str :param is_remotable: If true, the security namespace is remotable, allowing another service to proxy the namespace. :type is_remotable: bool :param name: This non-localized for this namespace. :type name: str :param namespace_id: The unique identifier for this namespace. :type namespace_id: str :param read_permission: The permission bits needed by a user in order to read security data on the Security Namespace. :type read_permission: int :param separator_value: If the security tokens this namespace will be operating on need to be split on certain characters to determine its elements that character should be specified here. If not, this value will be the null character. :type separator_value: str :param structure_value: Used to send information about the structure of the security namespace over the web service. :type structure_value: int :param system_bit_mask: The bits reserved by system store :type system_bit_mask: int :param use_token_translator: If true, the security service will expect an ISecurityDataspaceTokenTranslator plugin to exist for this namespace :type use_token_translator: bool :param write_permission: The permission bits needed by a user in order to modify security data on the Security Namespace. :type write_permission: int """ _attribute_map = { 'actions': {'key': 'actions', 'type': '[ActionDefinition]'}, 'dataspace_category': {'key': 'dataspaceCategory', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'element_length': {'key': 'elementLength', 'type': 'int'}, 'extension_type': {'key': 'extensionType', 'type': 'str'}, 'is_remotable': {'key': 'isRemotable', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, 'read_permission': {'key': 'readPermission', 'type': 'int'}, 'separator_value': {'key': 'separatorValue', 'type': 'str'}, 'structure_value': {'key': 'structureValue', 'type': 'int'}, 'system_bit_mask': {'key': 'systemBitMask', 'type': 'int'}, 'use_token_translator': {'key': 'useTokenTranslator', 'type': 'bool'}, 'write_permission': {'key': 'writePermission', 'type': 'int'} } def __init__(self, actions=None, dataspace_category=None, display_name=None, element_length=None, extension_type=None, is_remotable=None, name=None, namespace_id=None, read_permission=None, separator_value=None, structure_value=None, system_bit_mask=None, use_token_translator=None, write_permission=None): super(SecurityNamespaceDescription, self).__init__() self.actions = actions self.dataspace_category = dataspace_category self.display_name = display_name self.element_length = element_length self.extension_type = extension_type self.is_remotable = is_remotable self.name = name self.namespace_id = namespace_id self.read_permission = read_permission self.separator_value = separator_value self.structure_value = structure_value self.system_bit_mask = system_bit_mask self.use_token_translator = use_token_translator self.write_permission = write_permission __all__ = [ 'AccessControlEntry', 'AccessControlList', 'AccessControlListsCollection', 'AceExtendedInformation', 'ActionDefinition', 'PermissionEvaluation', 'PermissionEvaluationBatch', 'SecurityNamespaceDescription', ] security_client.py000066400000000000000000000334541360605530400344350ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/security# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class SecurityClient(Client): """Security :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(SecurityClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def remove_access_control_entries(self, security_namespace_id, token=None, descriptors=None): """RemoveAccessControlEntries. Remove the specified ACEs from the ACL belonging to the specified token. :param str security_namespace_id: Security namespace identifier. :param str token: The token whose ACL should be modified. :param str descriptors: String containing a list of identity descriptors separated by ',' whose entries should be removed. :rtype: bool """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') query_parameters = {} if token is not None: query_parameters['token'] = self._serialize.query('token', token, 'str') if descriptors is not None: query_parameters['descriptors'] = self._serialize.query('descriptors', descriptors, 'str') response = self._send(http_method='DELETE', location_id='ac08c8ff-4323-4b08-af90-bcd018d380ce', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('bool', response) def set_access_control_entries(self, container, security_namespace_id): """SetAccessControlEntries. Add or update ACEs in the ACL for the provided token. The request body contains the target token, a list of [ACEs](https://docs.microsoft.com/en-us/rest/api/azure/devops/security/access%20control%20entries/set%20access%20control%20entries?#accesscontrolentry) and a optional merge parameter. In the case of a collision (by identity descriptor) with an existing ACE in the ACL, the "merge" parameter determines the behavior. If set, the existing ACE has its allow and deny merged with the incoming ACE's allow and deny. If unset, the existing ACE is displaced. :param :class:` ` container: :param str security_namespace_id: Security namespace identifier. :rtype: [AccessControlEntry] """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') content = self._serialize.body(container, 'object') response = self._send(http_method='POST', location_id='ac08c8ff-4323-4b08-af90-bcd018d380ce', version='5.0', route_values=route_values, content=content) return self._deserialize('[AccessControlEntry]', self._unwrap_collection(response)) def query_access_control_lists(self, security_namespace_id, token=None, descriptors=None, include_extended_info=None, recurse=None): """QueryAccessControlLists. Return a list of access control lists for the specified security namespace and token. All ACLs in the security namespace will be retrieved if no optional parameters are provided. :param str security_namespace_id: Security namespace identifier. :param str token: Security token :param str descriptors: An optional filter string containing a list of identity descriptors separated by ',' whose ACEs should be retrieved. If this is left null, entire ACLs will be returned. :param bool include_extended_info: If true, populate the extended information properties for the access control entries contained in the returned lists. :param bool recurse: If true and this is a hierarchical namespace, return child ACLs of the specified token. :rtype: [AccessControlList] """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') query_parameters = {} if token is not None: query_parameters['token'] = self._serialize.query('token', token, 'str') if descriptors is not None: query_parameters['descriptors'] = self._serialize.query('descriptors', descriptors, 'str') if include_extended_info is not None: query_parameters['includeExtendedInfo'] = self._serialize.query('include_extended_info', include_extended_info, 'bool') if recurse is not None: query_parameters['recurse'] = self._serialize.query('recurse', recurse, 'bool') response = self._send(http_method='GET', location_id='18a2ad18-7571-46ae-bec7-0c7da1495885', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[AccessControlList]', self._unwrap_collection(response)) def remove_access_control_lists(self, security_namespace_id, tokens=None, recurse=None): """RemoveAccessControlLists. Remove access control lists under the specfied security namespace. :param str security_namespace_id: Security namespace identifier. :param str tokens: One or more comma-separated security tokens :param bool recurse: If true and this is a hierarchical namespace, also remove child ACLs of the specified tokens. :rtype: bool """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') query_parameters = {} if tokens is not None: query_parameters['tokens'] = self._serialize.query('tokens', tokens, 'str') if recurse is not None: query_parameters['recurse'] = self._serialize.query('recurse', recurse, 'bool') response = self._send(http_method='DELETE', location_id='18a2ad18-7571-46ae-bec7-0c7da1495885', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('bool', response) def set_access_control_lists(self, access_control_lists, security_namespace_id): """SetAccessControlLists. Create or update one or more access control lists. All data that currently exists for the ACLs supplied will be overwritten. :param :class:` ` access_control_lists: A list of ACLs to create or update. :param str security_namespace_id: Security namespace identifier. """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') content = self._serialize.body(access_control_lists, 'VssJsonCollectionWrapper') self._send(http_method='POST', location_id='18a2ad18-7571-46ae-bec7-0c7da1495885', version='5.0', route_values=route_values, content=content) def has_permissions_batch(self, eval_batch): """HasPermissionsBatch. Evaluates multiple permissions for the calling user. Note: This method does not aggregate the results, nor does it short-circuit if one of the permissions evaluates to false. :param :class:` ` eval_batch: The set of evaluation requests. :rtype: :class:` ` """ content = self._serialize.body(eval_batch, 'PermissionEvaluationBatch') response = self._send(http_method='POST', location_id='cf1faa59-1b63-4448-bf04-13d981a46f5d', version='5.0', content=content) return self._deserialize('PermissionEvaluationBatch', response) def has_permissions(self, security_namespace_id, permissions=None, tokens=None, always_allow_administrators=None, delimiter=None): """HasPermissions. Evaluates whether the caller has the specified permissions on the specified set of security tokens. :param str security_namespace_id: Security namespace identifier. :param int permissions: Permissions to evaluate. :param str tokens: One or more security tokens to evaluate. :param bool always_allow_administrators: If true and if the caller is an administrator, always return true. :param str delimiter: Optional security token separator. Defaults to ",". :rtype: [bool] """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') if permissions is not None: route_values['permissions'] = self._serialize.url('permissions', permissions, 'int') query_parameters = {} if tokens is not None: query_parameters['tokens'] = self._serialize.query('tokens', tokens, 'str') if always_allow_administrators is not None: query_parameters['alwaysAllowAdministrators'] = self._serialize.query('always_allow_administrators', always_allow_administrators, 'bool') if delimiter is not None: query_parameters['delimiter'] = self._serialize.query('delimiter', delimiter, 'str') response = self._send(http_method='GET', location_id='dd3b8bd6-c7fc-4cbd-929a-933d9c011c9d', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[bool]', self._unwrap_collection(response)) def remove_permission(self, security_namespace_id, descriptor, permissions=None, token=None): """RemovePermission. Removes the specified permissions on a security token for a user or group. :param str security_namespace_id: Security namespace identifier. :param str descriptor: Identity descriptor of the user to remove permissions for. :param int permissions: Permissions to remove. :param str token: Security token to remove permissions for. :rtype: :class:` ` """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') if permissions is not None: route_values['permissions'] = self._serialize.url('permissions', permissions, 'int') query_parameters = {} if descriptor is not None: query_parameters['descriptor'] = self._serialize.query('descriptor', descriptor, 'str') if token is not None: query_parameters['token'] = self._serialize.query('token', token, 'str') response = self._send(http_method='DELETE', location_id='dd3b8bd6-c7fc-4cbd-929a-933d9c011c9d', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('AccessControlEntry', response) def query_security_namespaces(self, security_namespace_id=None, local_only=None): """QuerySecurityNamespaces. List all security namespaces or just the specified namespace. :param str security_namespace_id: Security namespace identifier. :param bool local_only: If true, retrieve only local security namespaces. :rtype: [SecurityNamespaceDescription] """ route_values = {} if security_namespace_id is not None: route_values['securityNamespaceId'] = self._serialize.url('security_namespace_id', security_namespace_id, 'str') query_parameters = {} if local_only is not None: query_parameters['localOnly'] = self._serialize.query('local_only', local_only, 'bool') response = self._send(http_method='GET', location_id='ce7b9f95-fde9-4be8-a86d-83b366f0b87a', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[SecurityNamespaceDescription]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/service_endpoint/000077500000000000000000000000001360605530400324155ustar00rootroot00000000000000__init__.py000066400000000000000000000033351360605530400344530ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/service_endpoint# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .service_endpoint_client import ServiceEndpointClient __all__ = [ 'AuthenticationSchemeReference', 'AuthorizationHeader', 'AzureManagementGroup', 'AzureManagementGroupQueryResult', 'AzureSubscription', 'AzureSubscriptionQueryResult', 'ClientCertificate', 'DataSource', 'DataSourceBinding', 'DataSourceBindingBase', 'DataSourceDetails', 'DependencyBinding', 'DependencyData', 'DependsOn', 'EndpointAuthorization', 'EndpointUrl', 'GraphSubjectBase', 'HelpLink', 'IdentityRef', 'InputDescriptor', 'InputValidation', 'InputValue', 'InputValues', 'InputValuesError', 'OAuthConfiguration', 'OAuthConfigurationParams', 'ProjectReference', 'ReferenceLinks', 'ResultTransformationDetails', 'ServiceEndpoint', 'ServiceEndpointAuthenticationScheme', 'ServiceEndpointDetails', 'ServiceEndpointExecutionData', 'ServiceEndpointExecutionOwner', 'ServiceEndpointExecutionRecord', 'ServiceEndpointExecutionRecordsInput', 'ServiceEndpointRequest', 'ServiceEndpointRequestResult', 'ServiceEndpointType', 'ServiceEndpointClient' ] models.py000066400000000000000000001600441360605530400342000ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/service_endpoint# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AuthenticationSchemeReference(Model): """AuthenticationSchemeReference. :param inputs: :type inputs: dict :param type: :type type: str """ _attribute_map = { 'inputs': {'key': 'inputs', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, inputs=None, type=None): super(AuthenticationSchemeReference, self).__init__() self.inputs = inputs self.type = type class AuthorizationHeader(Model): """AuthorizationHeader. :param name: Gets or sets the name of authorization header. :type name: str :param value: Gets or sets the value of authorization header. :type value: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, name=None, value=None): super(AuthorizationHeader, self).__init__() self.name = name self.value = value class AzureManagementGroup(Model): """AzureManagementGroup. :param display_name: Display name of azure management group :type display_name: str :param id: Id of azure management group :type id: str :param name: Azure management group name :type name: str :param tenant_id: Id of tenant from which azure management group belogs :type tenant_id: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'} } def __init__(self, display_name=None, id=None, name=None, tenant_id=None): super(AzureManagementGroup, self).__init__() self.display_name = display_name self.id = id self.name = name self.tenant_id = tenant_id class AzureManagementGroupQueryResult(Model): """AzureManagementGroupQueryResult. :param error_message: Error message in case of an exception :type error_message: str :param value: List of azure management groups :type value: list of :class:`AzureManagementGroup ` """ _attribute_map = { 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'value': {'key': 'value', 'type': '[AzureManagementGroup]'} } def __init__(self, error_message=None, value=None): super(AzureManagementGroupQueryResult, self).__init__() self.error_message = error_message self.value = value class AzureSubscription(Model): """AzureSubscription. :param display_name: :type display_name: str :param subscription_id: :type subscription_id: str :param subscription_tenant_id: :type subscription_tenant_id: str :param subscription_tenant_name: :type subscription_tenant_name: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, 'subscription_tenant_id': {'key': 'subscriptionTenantId', 'type': 'str'}, 'subscription_tenant_name': {'key': 'subscriptionTenantName', 'type': 'str'} } def __init__(self, display_name=None, subscription_id=None, subscription_tenant_id=None, subscription_tenant_name=None): super(AzureSubscription, self).__init__() self.display_name = display_name self.subscription_id = subscription_id self.subscription_tenant_id = subscription_tenant_id self.subscription_tenant_name = subscription_tenant_name class AzureSubscriptionQueryResult(Model): """AzureSubscriptionQueryResult. :param error_message: :type error_message: str :param value: :type value: list of :class:`AzureSubscription ` """ _attribute_map = { 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'value': {'key': 'value', 'type': '[AzureSubscription]'} } def __init__(self, error_message=None, value=None): super(AzureSubscriptionQueryResult, self).__init__() self.error_message = error_message self.value = value class ClientCertificate(Model): """ClientCertificate. :param value: Gets or sets the value of client certificate. :type value: str """ _attribute_map = { 'value': {'key': 'value', 'type': 'str'} } def __init__(self, value=None): super(ClientCertificate, self).__init__() self.value = value class DataSource(Model): """DataSource. :param authentication_scheme: :type authentication_scheme: :class:`AuthenticationSchemeReference ` :param callback_context_template: :type callback_context_template: str :param callback_required_template: :type callback_required_template: str :param endpoint_url: :type endpoint_url: str :param headers: :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: :type initial_context_template: str :param name: :type name: str :param request_content: :type request_content: str :param request_verb: :type request_verb: str :param resource_url: :type resource_url: str :param result_selector: :type result_selector: str """ _attribute_map = { 'authentication_scheme': {'key': 'authenticationScheme', 'type': 'AuthenticationSchemeReference'}, 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'request_content': {'key': 'requestContent', 'type': 'str'}, 'request_verb': {'key': 'requestVerb', 'type': 'str'}, 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'} } def __init__(self, authentication_scheme=None, callback_context_template=None, callback_required_template=None, endpoint_url=None, headers=None, initial_context_template=None, name=None, request_content=None, request_verb=None, resource_url=None, result_selector=None): super(DataSource, self).__init__() self.authentication_scheme = authentication_scheme self.callback_context_template = callback_context_template self.callback_required_template = callback_required_template self.endpoint_url = endpoint_url self.headers = headers self.initial_context_template = initial_context_template self.name = name self.request_content = request_content self.request_verb = request_verb self.resource_url = resource_url self.result_selector = result_selector class DataSourceBindingBase(Model): """DataSourceBindingBase. :param callback_context_template: Pagination format supported by this data source(ContinuationToken/SkipTop). :type callback_context_template: str :param callback_required_template: Subsequent calls needed? :type callback_required_template: str :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: Defines the initial value of the query params :type initial_context_template: str :param parameters: Gets or sets the parameters for the data source. :type parameters: dict :param result_selector: Gets or sets the result selector. :type result_selector: str :param result_template: Gets or sets the result template. :type result_template: str :param target: Gets or sets the target of the data source. :type target: str """ _attribute_map = { 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'}, 'result_template': {'key': 'resultTemplate', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, callback_context_template=None, callback_required_template=None, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, initial_context_template=None, parameters=None, result_selector=None, result_template=None, target=None): super(DataSourceBindingBase, self).__init__() self.callback_context_template = callback_context_template self.callback_required_template = callback_required_template self.data_source_name = data_source_name self.endpoint_id = endpoint_id self.endpoint_url = endpoint_url self.headers = headers self.initial_context_template = initial_context_template self.parameters = parameters self.result_selector = result_selector self.result_template = result_template self.target = target class DataSourceDetails(Model): """DataSourceDetails. :param data_source_name: Gets or sets the data source name. :type data_source_name: str :param data_source_url: Gets or sets the data source url. :type data_source_url: str :param headers: Gets or sets the request headers. :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: Gets or sets the initialization context used for the initial call to the data source :type initial_context_template: str :param parameters: Gets the parameters of data source. :type parameters: dict :param request_content: Gets or sets the data source request content. :type request_content: str :param request_verb: Gets or sets the data source request verb. Get/Post are the only implemented types :type request_verb: str :param resource_url: Gets or sets the resource url of data source. :type resource_url: str :param result_selector: Gets or sets the result selector. :type result_selector: str """ _attribute_map = { 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'data_source_url': {'key': 'dataSourceUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'request_content': {'key': 'requestContent', 'type': 'str'}, 'request_verb': {'key': 'requestVerb', 'type': 'str'}, 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'} } def __init__(self, data_source_name=None, data_source_url=None, headers=None, initial_context_template=None, parameters=None, request_content=None, request_verb=None, resource_url=None, result_selector=None): super(DataSourceDetails, self).__init__() self.data_source_name = data_source_name self.data_source_url = data_source_url self.headers = headers self.initial_context_template = initial_context_template self.parameters = parameters self.request_content = request_content self.request_verb = request_verb self.resource_url = resource_url self.result_selector = result_selector class DependencyBinding(Model): """DependencyBinding. :param key: :type key: str :param value: :type value: str """ _attribute_map = { 'key': {'key': 'key', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, key=None, value=None): super(DependencyBinding, self).__init__() self.key = key self.value = value class DependencyData(Model): """DependencyData. :param input: :type input: str :param map: :type map: list of { key: str; value: [{ key: str; value: str }] } """ _attribute_map = { 'input': {'key': 'input', 'type': 'str'}, 'map': {'key': 'map', 'type': '[{ key: str; value: [{ key: str; value: str }] }]'} } def __init__(self, input=None, map=None): super(DependencyData, self).__init__() self.input = input self.map = map class DependsOn(Model): """DependsOn. :param input: :type input: str :param map: :type map: list of :class:`DependencyBinding ` """ _attribute_map = { 'input': {'key': 'input', 'type': 'str'}, 'map': {'key': 'map', 'type': '[DependencyBinding]'} } def __init__(self, input=None, map=None): super(DependsOn, self).__init__() self.input = input self.map = map class EndpointAuthorization(Model): """EndpointAuthorization. :param parameters: Gets or sets the parameters for the selected authorization scheme. :type parameters: dict :param scheme: Gets or sets the scheme used for service endpoint authentication. :type scheme: str """ _attribute_map = { 'parameters': {'key': 'parameters', 'type': '{str}'}, 'scheme': {'key': 'scheme', 'type': 'str'} } def __init__(self, parameters=None, scheme=None): super(EndpointAuthorization, self).__init__() self.parameters = parameters self.scheme = scheme class EndpointUrl(Model): """EndpointUrl. :param depends_on: Gets or sets the dependency bindings. :type depends_on: :class:`DependsOn ` :param display_name: Gets or sets the display name of service endpoint url. :type display_name: str :param help_text: Gets or sets the help text of service endpoint url. :type help_text: str :param is_visible: Gets or sets the visibility of service endpoint url. :type is_visible: str :param value: Gets or sets the value of service endpoint url. :type value: str """ _attribute_map = { 'depends_on': {'key': 'dependsOn', 'type': 'DependsOn'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'help_text': {'key': 'helpText', 'type': 'str'}, 'is_visible': {'key': 'isVisible', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, depends_on=None, display_name=None, help_text=None, is_visible=None, value=None): super(EndpointUrl, self).__init__() self.depends_on = depends_on self.display_name = display_name self.help_text = help_text self.is_visible = is_visible self.value = value class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class HelpLink(Model): """HelpLink. :param text: :type text: str :param url: :type url: str """ _attribute_map = { 'text': {'key': 'text', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, text=None, url=None): super(HelpLink, self).__init__() self.text = text self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class InputDescriptor(Model): """InputDescriptor. :param dependency_input_ids: The ids of all inputs that the value of this input is dependent on. :type dependency_input_ids: list of str :param description: Description of what this input is used for :type description: str :param group_name: The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group. :type group_name: str :param has_dynamic_value_information: If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change. :type has_dynamic_value_information: bool :param id: Identifier for the subscription input :type id: str :param input_mode: Mode in which the value of this input should be entered :type input_mode: object :param is_confidential: Gets whether this input is confidential, such as for a password or application key :type is_confidential: bool :param name: Localized name which can be shown as a label for the subscription input :type name: str :param properties: Custom properties for the input which can be used by the service provider :type properties: dict :param type: Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional. :type type: str :param use_in_default_description: Gets whether this input is included in the default generated action description. :type use_in_default_description: bool :param validation: Information to use to validate this input's value :type validation: :class:`InputValidation ` :param value_hint: A hint for input value. It can be used in the UI as the input placeholder. :type value_hint: str :param values: Information about possible values for this input :type values: :class:`InputValues ` """ _attribute_map = { 'dependency_input_ids': {'key': 'dependencyInputIds', 'type': '[str]'}, 'description': {'key': 'description', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'has_dynamic_value_information': {'key': 'hasDynamicValueInformation', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'input_mode': {'key': 'inputMode', 'type': 'object'}, 'is_confidential': {'key': 'isConfidential', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'str'}, 'use_in_default_description': {'key': 'useInDefaultDescription', 'type': 'bool'}, 'validation': {'key': 'validation', 'type': 'InputValidation'}, 'value_hint': {'key': 'valueHint', 'type': 'str'}, 'values': {'key': 'values', 'type': 'InputValues'} } def __init__(self, dependency_input_ids=None, description=None, group_name=None, has_dynamic_value_information=None, id=None, input_mode=None, is_confidential=None, name=None, properties=None, type=None, use_in_default_description=None, validation=None, value_hint=None, values=None): super(InputDescriptor, self).__init__() self.dependency_input_ids = dependency_input_ids self.description = description self.group_name = group_name self.has_dynamic_value_information = has_dynamic_value_information self.id = id self.input_mode = input_mode self.is_confidential = is_confidential self.name = name self.properties = properties self.type = type self.use_in_default_description = use_in_default_description self.validation = validation self.value_hint = value_hint self.values = values class InputValidation(Model): """InputValidation. :param data_type: :type data_type: object :param is_required: :type is_required: bool :param max_length: :type max_length: int :param max_value: :type max_value: decimal :param min_length: :type min_length: int :param min_value: :type min_value: decimal :param pattern: :type pattern: str :param pattern_mismatch_error_message: :type pattern_mismatch_error_message: str """ _attribute_map = { 'data_type': {'key': 'dataType', 'type': 'object'}, 'is_required': {'key': 'isRequired', 'type': 'bool'}, 'max_length': {'key': 'maxLength', 'type': 'int'}, 'max_value': {'key': 'maxValue', 'type': 'decimal'}, 'min_length': {'key': 'minLength', 'type': 'int'}, 'min_value': {'key': 'minValue', 'type': 'decimal'}, 'pattern': {'key': 'pattern', 'type': 'str'}, 'pattern_mismatch_error_message': {'key': 'patternMismatchErrorMessage', 'type': 'str'} } def __init__(self, data_type=None, is_required=None, max_length=None, max_value=None, min_length=None, min_value=None, pattern=None, pattern_mismatch_error_message=None): super(InputValidation, self).__init__() self.data_type = data_type self.is_required = is_required self.max_length = max_length self.max_value = max_value self.min_length = min_length self.min_value = min_value self.pattern = pattern self.pattern_mismatch_error_message = pattern_mismatch_error_message class InputValue(Model): """InputValue. :param data: Any other data about this input :type data: dict :param display_value: The text to show for the display of this value :type display_value: str :param value: The value to store for this input :type value: str """ _attribute_map = { 'data': {'key': 'data', 'type': '{object}'}, 'display_value': {'key': 'displayValue', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, data=None, display_value=None, value=None): super(InputValue, self).__init__() self.data = data self.display_value = display_value self.value = value class InputValues(Model): """InputValues. :param default_value: The default value to use for this input :type default_value: str :param error: Errors encountered while computing dynamic values. :type error: :class:`InputValuesError ` :param input_id: The id of the input :type input_id: str :param is_disabled: Should this input be disabled :type is_disabled: bool :param is_limited_to_possible_values: Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) :type is_limited_to_possible_values: bool :param is_read_only: Should this input be made read-only :type is_read_only: bool :param possible_values: Possible values that this input can take :type possible_values: list of :class:`InputValue ` """ _attribute_map = { 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'error': {'key': 'error', 'type': 'InputValuesError'}, 'input_id': {'key': 'inputId', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'is_limited_to_possible_values': {'key': 'isLimitedToPossibleValues', 'type': 'bool'}, 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, 'possible_values': {'key': 'possibleValues', 'type': '[InputValue]'} } def __init__(self, default_value=None, error=None, input_id=None, is_disabled=None, is_limited_to_possible_values=None, is_read_only=None, possible_values=None): super(InputValues, self).__init__() self.default_value = default_value self.error = error self.input_id = input_id self.is_disabled = is_disabled self.is_limited_to_possible_values = is_limited_to_possible_values self.is_read_only = is_read_only self.possible_values = possible_values class InputValuesError(Model): """InputValuesError. :param message: The error message. :type message: str """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'} } def __init__(self, message=None): super(InputValuesError, self).__init__() self.message = message class OAuthConfiguration(Model): """OAuthConfiguration. :param client_id: Gets or sets the ClientId :type client_id: str :param client_secret: Gets or sets the ClientSecret :type client_secret: str :param created_by: Gets or sets the identity who created the config. :type created_by: :class:`IdentityRef ` :param created_on: Gets or sets the time when config was created. :type created_on: datetime :param endpoint_type: Gets or sets the type of the endpoint. :type endpoint_type: str :param id: Gets or sets the unique identifier of this field :type id: str :param modified_by: Gets or sets the identity who modified the config. :type modified_by: :class:`IdentityRef ` :param modified_on: Gets or sets the time when variable group was modified :type modified_on: datetime :param name: Gets or sets the name :type name: str :param url: Gets or sets the Url :type url: str """ _attribute_map = { 'client_id': {'key': 'clientId', 'type': 'str'}, 'client_secret': {'key': 'clientSecret', 'type': 'str'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, client_id=None, client_secret=None, created_by=None, created_on=None, endpoint_type=None, id=None, modified_by=None, modified_on=None, name=None, url=None): super(OAuthConfiguration, self).__init__() self.client_id = client_id self.client_secret = client_secret self.created_by = created_by self.created_on = created_on self.endpoint_type = endpoint_type self.id = id self.modified_by = modified_by self.modified_on = modified_on self.name = name self.url = url class OAuthConfigurationParams(Model): """OAuthConfigurationParams. :param client_id: Gets or sets the ClientId :type client_id: str :param client_secret: Gets or sets the ClientSecret :type client_secret: str :param endpoint_type: Gets or sets the type of the endpoint. :type endpoint_type: str :param name: Gets or sets the name :type name: str :param url: Gets or sets the Url :type url: str """ _attribute_map = { 'client_id': {'key': 'clientId', 'type': 'str'}, 'client_secret': {'key': 'clientSecret', 'type': 'str'}, 'endpoint_type': {'key': 'endpointType', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, client_id=None, client_secret=None, endpoint_type=None, name=None, url=None): super(OAuthConfigurationParams, self).__init__() self.client_id = client_id self.client_secret = client_secret self.endpoint_type = endpoint_type self.name = name self.url = url class ProjectReference(Model): """ProjectReference. :param id: :type id: str :param name: :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(ProjectReference, self).__init__() self.id = id self.name = name class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class ResultTransformationDetails(Model): """ResultTransformationDetails. :param callback_context_template: Gets or sets the template for callback parameters :type callback_context_template: str :param callback_required_template: Gets or sets the template to decide whether to callback or not :type callback_required_template: str :param result_template: Gets or sets the template for result transformation. :type result_template: str """ _attribute_map = { 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, 'result_template': {'key': 'resultTemplate', 'type': 'str'} } def __init__(self, callback_context_template=None, callback_required_template=None, result_template=None): super(ResultTransformationDetails, self).__init__() self.callback_context_template = callback_context_template self.callback_required_template = callback_required_template self.result_template = result_template class ServiceEndpoint(Model): """ServiceEndpoint. :param administrators_group: Gets or sets the identity reference for the administrators group of the service endpoint. :type administrators_group: :class:`IdentityRef ` :param authorization: Gets or sets the authorization data for talking to the endpoint. :type authorization: :class:`EndpointAuthorization ` :param created_by: Gets or sets the identity reference for the user who created the Service endpoint. :type created_by: :class:`IdentityRef ` :param data: :type data: dict :param description: Gets or sets the description of endpoint. :type description: str :param group_scope_id: :type group_scope_id: str :param id: Gets or sets the identifier of this endpoint. :type id: str :param is_ready: EndPoint state indictor :type is_ready: bool :param is_shared: Indicates whether service endpoint is shared with other projects or not. :type is_shared: bool :param name: Gets or sets the friendly name of the endpoint. :type name: str :param operation_status: Error message during creation/deletion of endpoint :type operation_status: :class:`object ` :param owner: Owner of the endpoint Supported values are "library", "agentcloud" :type owner: str :param readers_group: Gets or sets the identity reference for the readers group of the service endpoint. :type readers_group: :class:`IdentityRef ` :param type: Gets or sets the type of the endpoint. :type type: str :param url: Gets or sets the url of the endpoint. :type url: str """ _attribute_map = { 'administrators_group': {'key': 'administratorsGroup', 'type': 'IdentityRef'}, 'authorization': {'key': 'authorization', 'type': 'EndpointAuthorization'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'data': {'key': 'data', 'type': '{str}'}, 'description': {'key': 'description', 'type': 'str'}, 'group_scope_id': {'key': 'groupScopeId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_ready': {'key': 'isReady', 'type': 'bool'}, 'is_shared': {'key': 'isShared', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'operation_status': {'key': 'operationStatus', 'type': 'object'}, 'owner': {'key': 'owner', 'type': 'str'}, 'readers_group': {'key': 'readersGroup', 'type': 'IdentityRef'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, administrators_group=None, authorization=None, created_by=None, data=None, description=None, group_scope_id=None, id=None, is_ready=None, is_shared=None, name=None, operation_status=None, owner=None, readers_group=None, type=None, url=None): super(ServiceEndpoint, self).__init__() self.administrators_group = administrators_group self.authorization = authorization self.created_by = created_by self.data = data self.description = description self.group_scope_id = group_scope_id self.id = id self.is_ready = is_ready self.is_shared = is_shared self.name = name self.operation_status = operation_status self.owner = owner self.readers_group = readers_group self.type = type self.url = url class ServiceEndpointAuthenticationScheme(Model): """ServiceEndpointAuthenticationScheme. :param authorization_headers: Gets or sets the authorization headers of service endpoint authentication scheme. :type authorization_headers: list of :class:`AuthorizationHeader ` :param authorization_url: Gets or sets the Authorization url required to authenticate using OAuth2 :type authorization_url: str :param client_certificates: Gets or sets the certificates of service endpoint authentication scheme. :type client_certificates: list of :class:`ClientCertificate ` :param data_source_bindings: :type data_source_bindings: list of :class:`DataSourceBinding ` :param display_name: Gets or sets the display name for the service endpoint authentication scheme. :type display_name: str :param input_descriptors: Gets or sets the input descriptors for the service endpoint authentication scheme. :type input_descriptors: list of :class:`InputDescriptor ` :param scheme: Gets or sets the scheme for service endpoint authentication. :type scheme: str """ _attribute_map = { 'authorization_headers': {'key': 'authorizationHeaders', 'type': '[AuthorizationHeader]'}, 'authorization_url': {'key': 'authorizationUrl', 'type': 'str'}, 'client_certificates': {'key': 'clientCertificates', 'type': '[ClientCertificate]'}, 'data_source_bindings': {'key': 'dataSourceBindings', 'type': '[DataSourceBinding]'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'scheme': {'key': 'scheme', 'type': 'str'} } def __init__(self, authorization_headers=None, authorization_url=None, client_certificates=None, data_source_bindings=None, display_name=None, input_descriptors=None, scheme=None): super(ServiceEndpointAuthenticationScheme, self).__init__() self.authorization_headers = authorization_headers self.authorization_url = authorization_url self.client_certificates = client_certificates self.data_source_bindings = data_source_bindings self.display_name = display_name self.input_descriptors = input_descriptors self.scheme = scheme class ServiceEndpointDetails(Model): """ServiceEndpointDetails. :param authorization: Gets or sets the authorization of service endpoint. :type authorization: :class:`EndpointAuthorization ` :param data: Gets or sets the data of service endpoint. :type data: dict :param type: Gets or sets the type of service endpoint. :type type: str :param url: Gets or sets the connection url of service endpoint. :type url: str """ _attribute_map = { 'authorization': {'key': 'authorization', 'type': 'EndpointAuthorization'}, 'data': {'key': 'data', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, authorization=None, data=None, type=None, url=None): super(ServiceEndpointDetails, self).__init__() self.authorization = authorization self.data = data self.type = type self.url = url class ServiceEndpointExecutionData(Model): """ServiceEndpointExecutionData. :param definition: Gets the definition of service endpoint execution owner. :type definition: :class:`ServiceEndpointExecutionOwner ` :param finish_time: Gets the finish time of service endpoint execution. :type finish_time: datetime :param id: Gets the Id of service endpoint execution data. :type id: long :param owner: Gets the owner of service endpoint execution data. :type owner: :class:`ServiceEndpointExecutionOwner ` :param plan_type: Gets the plan type of service endpoint execution data. :type plan_type: str :param result: Gets the result of service endpoint execution. :type result: object :param start_time: Gets the start time of service endpoint execution. :type start_time: datetime """ _attribute_map = { 'definition': {'key': 'definition', 'type': 'ServiceEndpointExecutionOwner'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'long'}, 'owner': {'key': 'owner', 'type': 'ServiceEndpointExecutionOwner'}, 'plan_type': {'key': 'planType', 'type': 'str'}, 'result': {'key': 'result', 'type': 'object'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'} } def __init__(self, definition=None, finish_time=None, id=None, owner=None, plan_type=None, result=None, start_time=None): super(ServiceEndpointExecutionData, self).__init__() self.definition = definition self.finish_time = finish_time self.id = id self.owner = owner self.plan_type = plan_type self.result = result self.start_time = start_time class ServiceEndpointExecutionOwner(Model): """ServiceEndpointExecutionOwner. :param _links: :type _links: :class:`ReferenceLinks ` :param id: Gets or sets the Id of service endpoint execution owner. :type id: int :param name: Gets or sets the name of service endpoint execution owner. :type name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, _links=None, id=None, name=None): super(ServiceEndpointExecutionOwner, self).__init__() self._links = _links self.id = id self.name = name class ServiceEndpointExecutionRecord(Model): """ServiceEndpointExecutionRecord. :param data: Gets the execution data of service endpoint execution. :type data: :class:`ServiceEndpointExecutionData ` :param endpoint_id: Gets the Id of service endpoint. :type endpoint_id: str """ _attribute_map = { 'data': {'key': 'data', 'type': 'ServiceEndpointExecutionData'}, 'endpoint_id': {'key': 'endpointId', 'type': 'str'} } def __init__(self, data=None, endpoint_id=None): super(ServiceEndpointExecutionRecord, self).__init__() self.data = data self.endpoint_id = endpoint_id class ServiceEndpointExecutionRecordsInput(Model): """ServiceEndpointExecutionRecordsInput. :param data: :type data: :class:`ServiceEndpointExecutionData ` :param endpoint_ids: :type endpoint_ids: list of str """ _attribute_map = { 'data': {'key': 'data', 'type': 'ServiceEndpointExecutionData'}, 'endpoint_ids': {'key': 'endpointIds', 'type': '[str]'} } def __init__(self, data=None, endpoint_ids=None): super(ServiceEndpointExecutionRecordsInput, self).__init__() self.data = data self.endpoint_ids = endpoint_ids class ServiceEndpointRequest(Model): """ServiceEndpointRequest. :param data_source_details: Gets or sets the data source details for the service endpoint request. :type data_source_details: :class:`DataSourceDetails ` :param result_transformation_details: Gets or sets the result transformation details for the service endpoint request. :type result_transformation_details: :class:`ResultTransformationDetails ` :param service_endpoint_details: Gets or sets the service endpoint details for the service endpoint request. :type service_endpoint_details: :class:`ServiceEndpointDetails ` """ _attribute_map = { 'data_source_details': {'key': 'dataSourceDetails', 'type': 'DataSourceDetails'}, 'result_transformation_details': {'key': 'resultTransformationDetails', 'type': 'ResultTransformationDetails'}, 'service_endpoint_details': {'key': 'serviceEndpointDetails', 'type': 'ServiceEndpointDetails'} } def __init__(self, data_source_details=None, result_transformation_details=None, service_endpoint_details=None): super(ServiceEndpointRequest, self).__init__() self.data_source_details = data_source_details self.result_transformation_details = result_transformation_details self.service_endpoint_details = service_endpoint_details class ServiceEndpointRequestResult(Model): """ServiceEndpointRequestResult. :param callback_context_parameters: Gets or sets the parameters used to make subsequent calls to the data source :type callback_context_parameters: dict :param callback_required: Gets or sets the flat that decides if another call to the data source is to be made :type callback_required: bool :param error_message: Gets or sets the error message of the service endpoint request result. :type error_message: str :param result: Gets or sets the result of service endpoint request. :type result: :class:`object ` :param status_code: Gets or sets the status code of the service endpoint request result. :type status_code: object """ _attribute_map = { 'callback_context_parameters': {'key': 'callbackContextParameters', 'type': '{str}'}, 'callback_required': {'key': 'callbackRequired', 'type': 'bool'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'result': {'key': 'result', 'type': 'object'}, 'status_code': {'key': 'statusCode', 'type': 'object'} } def __init__(self, callback_context_parameters=None, callback_required=None, error_message=None, result=None, status_code=None): super(ServiceEndpointRequestResult, self).__init__() self.callback_context_parameters = callback_context_parameters self.callback_required = callback_required self.error_message = error_message self.result = result self.status_code = status_code class ServiceEndpointType(Model): """ServiceEndpointType. :param authentication_schemes: Authentication scheme of service endpoint type. :type authentication_schemes: list of :class:`ServiceEndpointAuthenticationScheme ` :param data_sources: Data sources of service endpoint type. :type data_sources: list of :class:`DataSource ` :param dependency_data: Dependency data of service endpoint type. :type dependency_data: list of :class:`DependencyData ` :param description: Gets or sets the description of service endpoint type. :type description: str :param display_name: Gets or sets the display name of service endpoint type. :type display_name: str :param endpoint_url: Gets or sets the endpoint url of service endpoint type. :type endpoint_url: :class:`EndpointUrl ` :param help_link: Gets or sets the help link of service endpoint type. :type help_link: :class:`HelpLink ` :param help_mark_down: :type help_mark_down: str :param icon_url: Gets or sets the icon url of service endpoint type. :type icon_url: str :param input_descriptors: Input descriptor of service endpoint type. :type input_descriptors: list of :class:`InputDescriptor ` :param name: Gets or sets the name of service endpoint type. :type name: str :param trusted_hosts: Trusted hosts of a service endpoint type. :type trusted_hosts: list of str :param ui_contribution_id: Gets or sets the ui contribution id of service endpoint type. :type ui_contribution_id: str """ _attribute_map = { 'authentication_schemes': {'key': 'authenticationSchemes', 'type': '[ServiceEndpointAuthenticationScheme]'}, 'data_sources': {'key': 'dataSources', 'type': '[DataSource]'}, 'dependency_data': {'key': 'dependencyData', 'type': '[DependencyData]'}, 'description': {'key': 'description', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'EndpointUrl'}, 'help_link': {'key': 'helpLink', 'type': 'HelpLink'}, 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, 'icon_url': {'key': 'iconUrl', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'name': {'key': 'name', 'type': 'str'}, 'trusted_hosts': {'key': 'trustedHosts', 'type': '[str]'}, 'ui_contribution_id': {'key': 'uiContributionId', 'type': 'str'} } def __init__(self, authentication_schemes=None, data_sources=None, dependency_data=None, description=None, display_name=None, endpoint_url=None, help_link=None, help_mark_down=None, icon_url=None, input_descriptors=None, name=None, trusted_hosts=None, ui_contribution_id=None): super(ServiceEndpointType, self).__init__() self.authentication_schemes = authentication_schemes self.data_sources = data_sources self.dependency_data = dependency_data self.description = description self.display_name = display_name self.endpoint_url = endpoint_url self.help_link = help_link self.help_mark_down = help_mark_down self.icon_url = icon_url self.input_descriptors = input_descriptors self.name = name self.trusted_hosts = trusted_hosts self.ui_contribution_id = ui_contribution_id class DataSourceBinding(DataSourceBindingBase): """DataSourceBinding. :param callback_context_template: Pagination format supported by this data source(ContinuationToken/SkipTop). :type callback_context_template: str :param callback_required_template: Subsequent calls needed? :type callback_required_template: str :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: Defines the initial value of the query params :type initial_context_template: str :param parameters: Gets or sets the parameters for the data source. :type parameters: dict :param result_selector: Gets or sets the result selector. :type result_selector: str :param result_template: Gets or sets the result template. :type result_template: str :param target: Gets or sets the target of the data source. :type target: str """ _attribute_map = { 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'}, 'result_template': {'key': 'resultTemplate', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, } def __init__(self, callback_context_template=None, callback_required_template=None, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, initial_context_template=None, parameters=None, result_selector=None, result_template=None, target=None): super(DataSourceBinding, self).__init__(callback_context_template=callback_context_template, callback_required_template=callback_required_template, data_source_name=data_source_name, endpoint_id=endpoint_id, endpoint_url=endpoint_url, headers=headers, initial_context_template=initial_context_template, parameters=parameters, result_selector=result_selector, result_template=result_template, target=target) __all__ = [ 'AuthenticationSchemeReference', 'AuthorizationHeader', 'AzureManagementGroup', 'AzureManagementGroupQueryResult', 'AzureSubscription', 'AzureSubscriptionQueryResult', 'ClientCertificate', 'DataSource', 'DataSourceBindingBase', 'DataSourceDetails', 'DependencyBinding', 'DependencyData', 'DependsOn', 'EndpointAuthorization', 'EndpointUrl', 'GraphSubjectBase', 'HelpLink', 'IdentityRef', 'InputDescriptor', 'InputValidation', 'InputValue', 'InputValues', 'InputValuesError', 'OAuthConfiguration', 'OAuthConfigurationParams', 'ProjectReference', 'ReferenceLinks', 'ResultTransformationDetails', 'ServiceEndpoint', 'ServiceEndpointAuthenticationScheme', 'ServiceEndpointDetails', 'ServiceEndpointExecutionData', 'ServiceEndpointExecutionOwner', 'ServiceEndpointExecutionRecord', 'ServiceEndpointExecutionRecordsInput', 'ServiceEndpointRequest', 'ServiceEndpointRequestResult', 'ServiceEndpointType', 'DataSourceBinding', ] service_endpoint_client.py000066400000000000000000000347301360605530400376150ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/service_endpoint# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class ServiceEndpointClient(Client): """ServiceEndpoint :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ServiceEndpointClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '1814ab31-2f4f-4a9f-8761-f4d77dc5a5d7' def execute_service_endpoint_request(self, service_endpoint_request, project, endpoint_id): """ExecuteServiceEndpointRequest. [Preview API] Proxy for a GET request defined by a service endpoint. :param :class:` ` service_endpoint_request: Service endpoint request. :param str project: Project ID or project name :param str endpoint_id: Id of the service endpoint. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if endpoint_id is not None: query_parameters['endpointId'] = self._serialize.query('endpoint_id', endpoint_id, 'str') content = self._serialize.body(service_endpoint_request, 'ServiceEndpointRequest') response = self._send(http_method='POST', location_id='cc63bb57-2a5f-4a7a-b79c-c142d308657e', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('ServiceEndpointRequestResult', response) def create_service_endpoint(self, endpoint, project): """CreateServiceEndpoint. [Preview API] Create a service endpoint. :param :class:` ` endpoint: Service endpoint to create. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(endpoint, 'ServiceEndpoint') response = self._send(http_method='POST', location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ServiceEndpoint', response) def delete_service_endpoint(self, project, endpoint_id, deep=None): """DeleteServiceEndpoint. [Preview API] Delete a service endpoint. :param str project: Project ID or project name :param str endpoint_id: Id of the service endpoint to delete. :param bool deep: Specific to AzureRM endpoint created in Automatic flow. When set to true, this will also delete corresponding AAD application in Azure. Default value is true. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if endpoint_id is not None: route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') query_parameters = {} if deep is not None: query_parameters['deep'] = self._serialize.query('deep', deep, 'bool') self._send(http_method='DELETE', location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) def get_service_endpoint_details(self, project, endpoint_id): """GetServiceEndpointDetails. [Preview API] Get the service endpoint details. :param str project: Project ID or project name :param str endpoint_id: Id of the service endpoint. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if endpoint_id is not None: route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') response = self._send(http_method='GET', location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', version='5.0-preview.2', route_values=route_values) return self._deserialize('ServiceEndpoint', response) def get_service_endpoints(self, project, type=None, auth_schemes=None, endpoint_ids=None, include_failed=None, include_details=None): """GetServiceEndpoints. [Preview API] Get the service endpoints. :param str project: Project ID or project name :param str type: Type of the service endpoints. :param [str] auth_schemes: Authorization schemes used for service endpoints. :param [str] endpoint_ids: Ids of the service endpoints. :param bool include_failed: Failed flag for service endpoints. :param bool include_details: Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests :rtype: [ServiceEndpoint] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') if auth_schemes is not None: auth_schemes = ",".join(auth_schemes) query_parameters['authSchemes'] = self._serialize.query('auth_schemes', auth_schemes, 'str') if endpoint_ids is not None: endpoint_ids = ",".join(endpoint_ids) query_parameters['endpointIds'] = self._serialize.query('endpoint_ids', endpoint_ids, 'str') if include_failed is not None: query_parameters['includeFailed'] = self._serialize.query('include_failed', include_failed, 'bool') if include_details is not None: query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') response = self._send(http_method='GET', location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) def get_service_endpoints_by_names(self, project, endpoint_names, type=None, auth_schemes=None, include_failed=None, include_details=None): """GetServiceEndpointsByNames. [Preview API] Get the service endpoints by name. :param str project: Project ID or project name :param [str] endpoint_names: Names of the service endpoints. :param str type: Type of the service endpoints. :param [str] auth_schemes: Authorization schemes used for service endpoints. :param bool include_failed: Failed flag for service endpoints. :param bool include_details: Flag to include more details for service endpoints. This is for internal use only and the flag will be treated as false for all other requests :rtype: [ServiceEndpoint] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if endpoint_names is not None: endpoint_names = ",".join(endpoint_names) query_parameters['endpointNames'] = self._serialize.query('endpoint_names', endpoint_names, 'str') if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') if auth_schemes is not None: auth_schemes = ",".join(auth_schemes) query_parameters['authSchemes'] = self._serialize.query('auth_schemes', auth_schemes, 'str') if include_failed is not None: query_parameters['includeFailed'] = self._serialize.query('include_failed', include_failed, 'bool') if include_details is not None: query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') response = self._send(http_method='GET', location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) def update_service_endpoint(self, endpoint, project, endpoint_id, operation=None): """UpdateServiceEndpoint. [Preview API] Update a service endpoint. :param :class:` ` endpoint: Service endpoint to update. :param str project: Project ID or project name :param str endpoint_id: Id of the service endpoint to update. :param str operation: Operation for the service endpoint. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if endpoint_id is not None: route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') query_parameters = {} if operation is not None: query_parameters['operation'] = self._serialize.query('operation', operation, 'str') content = self._serialize.body(endpoint, 'ServiceEndpoint') response = self._send(http_method='PUT', location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('ServiceEndpoint', response) def update_service_endpoints(self, endpoints, project): """UpdateServiceEndpoints. [Preview API] Update the service endpoints. :param [ServiceEndpoint] endpoints: Names of the service endpoints to update. :param str project: Project ID or project name :rtype: [ServiceEndpoint] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(endpoints, '[ServiceEndpoint]') response = self._send(http_method='PUT', location_id='e85f1c62-adfc-4b74-b618-11a150fb195e', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('[ServiceEndpoint]', self._unwrap_collection(response)) def get_service_endpoint_execution_records(self, project, endpoint_id, top=None): """GetServiceEndpointExecutionRecords. [Preview API] Get service endpoint execution records. :param str project: Project ID or project name :param str endpoint_id: Id of the service endpoint. :param int top: Number of service endpoint execution records to get. :rtype: [ServiceEndpointExecutionRecord] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if endpoint_id is not None: route_values['endpointId'] = self._serialize.url('endpoint_id', endpoint_id, 'str') query_parameters = {} if top is not None: query_parameters['top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='10a16738-9299-4cd1-9a81-fd23ad6200d0', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ServiceEndpointExecutionRecord]', self._unwrap_collection(response)) def get_service_endpoint_types(self, type=None, scheme=None): """GetServiceEndpointTypes. [Preview API] Get service endpoint types. :param str type: Type of service endpoint. :param str scheme: Scheme of service endpoint. :rtype: [ServiceEndpointType] """ query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') if scheme is not None: query_parameters['scheme'] = self._serialize.query('scheme', scheme, 'str') response = self._send(http_method='GET', location_id='5a7938a4-655e-486c-b562-b78c54a7e87b', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[ServiceEndpointType]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/service_hooks/000077500000000000000000000000001360605530400317205ustar00rootroot00000000000000__init__.py000066400000000000000000000027701360605530400337600ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/service_hooks# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .service_hooks_client import ServiceHooksClient __all__ = [ 'Consumer', 'ConsumerAction', 'Event', 'EventTypeDescriptor', 'ExternalConfigurationDescriptor', 'FormattedEventMessage', 'GraphSubjectBase', 'IdentityRef', 'InputDescriptor', 'InputFilter', 'InputFilterCondition', 'InputValidation', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'Notification', 'NotificationDetails', 'NotificationResultsSummaryDetail', 'NotificationsQuery', 'NotificationSummary', 'Publisher', 'PublisherEvent', 'PublishersQuery', 'ReferenceLinks', 'ResourceContainer', 'SessionToken', 'Subscription', 'SubscriptionDiagnostics', 'SubscriptionsQuery', 'SubscriptionTracing', 'UpdateSubscripitonDiagnosticsParameters', 'UpdateSubscripitonTracingParameters', 'VersionedResource', 'ServiceHooksClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/service_hooks/models.py000066400000000000000000001644521360605530400335710ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class Consumer(Model): """Consumer. :param _links: Reference Links :type _links: :class:`ReferenceLinks ` :param actions: Gets this consumer's actions. :type actions: list of :class:`ConsumerAction ` :param authentication_type: Gets or sets this consumer's authentication type. :type authentication_type: object :param description: Gets or sets this consumer's localized description. :type description: str :param external_configuration: Non-null only if subscriptions for this consumer are configured externally. :type external_configuration: :class:`ExternalConfigurationDescriptor ` :param id: Gets or sets this consumer's identifier. :type id: str :param image_url: Gets or sets this consumer's image URL, if any. :type image_url: str :param information_url: Gets or sets this consumer's information URL, if any. :type information_url: str :param input_descriptors: Gets or sets this consumer's input descriptors. :type input_descriptors: list of :class:`InputDescriptor ` :param name: Gets or sets this consumer's localized name. :type name: str :param url: The url for this resource :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'actions': {'key': 'actions', 'type': '[ConsumerAction]'}, 'authentication_type': {'key': 'authenticationType', 'type': 'object'}, 'description': {'key': 'description', 'type': 'str'}, 'external_configuration': {'key': 'externalConfiguration', 'type': 'ExternalConfigurationDescriptor'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'information_url': {'key': 'informationUrl', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, actions=None, authentication_type=None, description=None, external_configuration=None, id=None, image_url=None, information_url=None, input_descriptors=None, name=None, url=None): super(Consumer, self).__init__() self._links = _links self.actions = actions self.authentication_type = authentication_type self.description = description self.external_configuration = external_configuration self.id = id self.image_url = image_url self.information_url = information_url self.input_descriptors = input_descriptors self.name = name self.url = url class ConsumerAction(Model): """ConsumerAction. :param _links: Reference Links :type _links: :class:`ReferenceLinks ` :param allow_resource_version_override: Gets or sets the flag indicating if resource version can be overridden when creating or editing a subscription. :type allow_resource_version_override: bool :param consumer_id: Gets or sets the identifier of the consumer to which this action belongs. :type consumer_id: str :param description: Gets or sets this action's localized description. :type description: str :param id: Gets or sets this action's identifier. :type id: str :param input_descriptors: Gets or sets this action's input descriptors. :type input_descriptors: list of :class:`InputDescriptor ` :param name: Gets or sets this action's localized name. :type name: str :param supported_event_types: Gets or sets this action's supported event identifiers. :type supported_event_types: list of str :param supported_resource_versions: Gets or sets this action's supported resource versions. :type supported_resource_versions: dict :param url: The url for this resource :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'allow_resource_version_override': {'key': 'allowResourceVersionOverride', 'type': 'bool'}, 'consumer_id': {'key': 'consumerId', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'name': {'key': 'name', 'type': 'str'}, 'supported_event_types': {'key': 'supportedEventTypes', 'type': '[str]'}, 'supported_resource_versions': {'key': 'supportedResourceVersions', 'type': '{[str]}'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, allow_resource_version_override=None, consumer_id=None, description=None, id=None, input_descriptors=None, name=None, supported_event_types=None, supported_resource_versions=None, url=None): super(ConsumerAction, self).__init__() self._links = _links self.allow_resource_version_override = allow_resource_version_override self.consumer_id = consumer_id self.description = description self.id = id self.input_descriptors = input_descriptors self.name = name self.supported_event_types = supported_event_types self.supported_resource_versions = supported_resource_versions self.url = url class Event(Model): """Event. :param created_date: Gets or sets the UTC-based date and time that this event was created. :type created_date: datetime :param detailed_message: Gets or sets the detailed message associated with this event. :type detailed_message: :class:`FormattedEventMessage ` :param event_type: Gets or sets the type of this event. :type event_type: str :param id: Gets or sets the unique identifier of this event. :type id: str :param message: Gets or sets the (brief) message associated with this event. :type message: :class:`FormattedEventMessage ` :param publisher_id: Gets or sets the identifier of the publisher that raised this event. :type publisher_id: str :param resource: Gets or sets the data associated with this event. :type resource: object :param resource_containers: Gets or sets the resource containers. :type resource_containers: dict :param resource_version: Gets or sets the version of the data associated with this event. :type resource_version: str :param session_token: Gets or sets the Session Token that can be used in further interactions :type session_token: :class:`SessionToken ` """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'detailed_message': {'key': 'detailedMessage', 'type': 'FormattedEventMessage'}, 'event_type': {'key': 'eventType', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'message': {'key': 'message', 'type': 'FormattedEventMessage'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'object'}, 'resource_containers': {'key': 'resourceContainers', 'type': '{ResourceContainer}'}, 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, 'session_token': {'key': 'sessionToken', 'type': 'SessionToken'} } def __init__(self, created_date=None, detailed_message=None, event_type=None, id=None, message=None, publisher_id=None, resource=None, resource_containers=None, resource_version=None, session_token=None): super(Event, self).__init__() self.created_date = created_date self.detailed_message = detailed_message self.event_type = event_type self.id = id self.message = message self.publisher_id = publisher_id self.resource = resource self.resource_containers = resource_containers self.resource_version = resource_version self.session_token = session_token class EventTypeDescriptor(Model): """EventTypeDescriptor. :param description: A localized description of the event type :type description: str :param id: A unique id for the event type :type id: str :param input_descriptors: Event-specific inputs :type input_descriptors: list of :class:`InputDescriptor ` :param name: A localized friendly name for the event type :type name: str :param publisher_id: A unique id for the publisher of this event type :type publisher_id: str :param supported_resource_versions: Supported versions for the event's resource payloads. :type supported_resource_versions: list of str :param url: The url for this resource :type url: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'name': {'key': 'name', 'type': 'str'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'supported_resource_versions': {'key': 'supportedResourceVersions', 'type': '[str]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, description=None, id=None, input_descriptors=None, name=None, publisher_id=None, supported_resource_versions=None, url=None): super(EventTypeDescriptor, self).__init__() self.description = description self.id = id self.input_descriptors = input_descriptors self.name = name self.publisher_id = publisher_id self.supported_resource_versions = supported_resource_versions self.url = url class ExternalConfigurationDescriptor(Model): """ExternalConfigurationDescriptor. :param create_subscription_url: Url of the site to create this type of subscription. :type create_subscription_url: str :param edit_subscription_property_name: The name of an input property that contains the URL to edit a subscription. :type edit_subscription_property_name: str :param hosted_only: True if the external configuration applies only to hosted. :type hosted_only: bool """ _attribute_map = { 'create_subscription_url': {'key': 'createSubscriptionUrl', 'type': 'str'}, 'edit_subscription_property_name': {'key': 'editSubscriptionPropertyName', 'type': 'str'}, 'hosted_only': {'key': 'hostedOnly', 'type': 'bool'} } def __init__(self, create_subscription_url=None, edit_subscription_property_name=None, hosted_only=None): super(ExternalConfigurationDescriptor, self).__init__() self.create_subscription_url = create_subscription_url self.edit_subscription_property_name = edit_subscription_property_name self.hosted_only = hosted_only class FormattedEventMessage(Model): """FormattedEventMessage. :param html: Gets or sets the html format of the message :type html: str :param markdown: Gets or sets the markdown format of the message :type markdown: str :param text: Gets or sets the raw text of the message :type text: str """ _attribute_map = { 'html': {'key': 'html', 'type': 'str'}, 'markdown': {'key': 'markdown', 'type': 'str'}, 'text': {'key': 'text', 'type': 'str'} } def __init__(self, html=None, markdown=None, text=None): super(FormattedEventMessage, self).__init__() self.html = html self.markdown = markdown self.text = text class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class InputDescriptor(Model): """InputDescriptor. :param dependency_input_ids: The ids of all inputs that the value of this input is dependent on. :type dependency_input_ids: list of str :param description: Description of what this input is used for :type description: str :param group_name: The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group. :type group_name: str :param has_dynamic_value_information: If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change. :type has_dynamic_value_information: bool :param id: Identifier for the subscription input :type id: str :param input_mode: Mode in which the value of this input should be entered :type input_mode: object :param is_confidential: Gets whether this input is confidential, such as for a password or application key :type is_confidential: bool :param name: Localized name which can be shown as a label for the subscription input :type name: str :param properties: Custom properties for the input which can be used by the service provider :type properties: dict :param type: Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional. :type type: str :param use_in_default_description: Gets whether this input is included in the default generated action description. :type use_in_default_description: bool :param validation: Information to use to validate this input's value :type validation: :class:`InputValidation ` :param value_hint: A hint for input value. It can be used in the UI as the input placeholder. :type value_hint: str :param values: Information about possible values for this input :type values: :class:`InputValues ` """ _attribute_map = { 'dependency_input_ids': {'key': 'dependencyInputIds', 'type': '[str]'}, 'description': {'key': 'description', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'has_dynamic_value_information': {'key': 'hasDynamicValueInformation', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'input_mode': {'key': 'inputMode', 'type': 'object'}, 'is_confidential': {'key': 'isConfidential', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'str'}, 'use_in_default_description': {'key': 'useInDefaultDescription', 'type': 'bool'}, 'validation': {'key': 'validation', 'type': 'InputValidation'}, 'value_hint': {'key': 'valueHint', 'type': 'str'}, 'values': {'key': 'values', 'type': 'InputValues'} } def __init__(self, dependency_input_ids=None, description=None, group_name=None, has_dynamic_value_information=None, id=None, input_mode=None, is_confidential=None, name=None, properties=None, type=None, use_in_default_description=None, validation=None, value_hint=None, values=None): super(InputDescriptor, self).__init__() self.dependency_input_ids = dependency_input_ids self.description = description self.group_name = group_name self.has_dynamic_value_information = has_dynamic_value_information self.id = id self.input_mode = input_mode self.is_confidential = is_confidential self.name = name self.properties = properties self.type = type self.use_in_default_description = use_in_default_description self.validation = validation self.value_hint = value_hint self.values = values class InputFilter(Model): """InputFilter. :param conditions: Groups of input filter expressions. This filter matches a set of inputs if any (one or more) of the groups evaluates to true. :type conditions: list of :class:`InputFilterCondition ` """ _attribute_map = { 'conditions': {'key': 'conditions', 'type': '[InputFilterCondition]'} } def __init__(self, conditions=None): super(InputFilter, self).__init__() self.conditions = conditions class InputFilterCondition(Model): """InputFilterCondition. :param case_sensitive: Whether or not to do a case sensitive match :type case_sensitive: bool :param input_id: The Id of the input to filter on :type input_id: str :param input_value: The "expected" input value to compare with the actual input value :type input_value: str :param operator: The operator applied between the expected and actual input value :type operator: object """ _attribute_map = { 'case_sensitive': {'key': 'caseSensitive', 'type': 'bool'}, 'input_id': {'key': 'inputId', 'type': 'str'}, 'input_value': {'key': 'inputValue', 'type': 'str'}, 'operator': {'key': 'operator', 'type': 'object'} } def __init__(self, case_sensitive=None, input_id=None, input_value=None, operator=None): super(InputFilterCondition, self).__init__() self.case_sensitive = case_sensitive self.input_id = input_id self.input_value = input_value self.operator = operator class InputValidation(Model): """InputValidation. :param data_type: :type data_type: object :param is_required: :type is_required: bool :param max_length: :type max_length: int :param max_value: :type max_value: decimal :param min_length: :type min_length: int :param min_value: :type min_value: decimal :param pattern: :type pattern: str :param pattern_mismatch_error_message: :type pattern_mismatch_error_message: str """ _attribute_map = { 'data_type': {'key': 'dataType', 'type': 'object'}, 'is_required': {'key': 'isRequired', 'type': 'bool'}, 'max_length': {'key': 'maxLength', 'type': 'int'}, 'max_value': {'key': 'maxValue', 'type': 'decimal'}, 'min_length': {'key': 'minLength', 'type': 'int'}, 'min_value': {'key': 'minValue', 'type': 'decimal'}, 'pattern': {'key': 'pattern', 'type': 'str'}, 'pattern_mismatch_error_message': {'key': 'patternMismatchErrorMessage', 'type': 'str'} } def __init__(self, data_type=None, is_required=None, max_length=None, max_value=None, min_length=None, min_value=None, pattern=None, pattern_mismatch_error_message=None): super(InputValidation, self).__init__() self.data_type = data_type self.is_required = is_required self.max_length = max_length self.max_value = max_value self.min_length = min_length self.min_value = min_value self.pattern = pattern self.pattern_mismatch_error_message = pattern_mismatch_error_message class InputValue(Model): """InputValue. :param data: Any other data about this input :type data: dict :param display_value: The text to show for the display of this value :type display_value: str :param value: The value to store for this input :type value: str """ _attribute_map = { 'data': {'key': 'data', 'type': '{object}'}, 'display_value': {'key': 'displayValue', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, data=None, display_value=None, value=None): super(InputValue, self).__init__() self.data = data self.display_value = display_value self.value = value class InputValues(Model): """InputValues. :param default_value: The default value to use for this input :type default_value: str :param error: Errors encountered while computing dynamic values. :type error: :class:`InputValuesError ` :param input_id: The id of the input :type input_id: str :param is_disabled: Should this input be disabled :type is_disabled: bool :param is_limited_to_possible_values: Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) :type is_limited_to_possible_values: bool :param is_read_only: Should this input be made read-only :type is_read_only: bool :param possible_values: Possible values that this input can take :type possible_values: list of :class:`InputValue ` """ _attribute_map = { 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'error': {'key': 'error', 'type': 'InputValuesError'}, 'input_id': {'key': 'inputId', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'is_limited_to_possible_values': {'key': 'isLimitedToPossibleValues', 'type': 'bool'}, 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, 'possible_values': {'key': 'possibleValues', 'type': '[InputValue]'} } def __init__(self, default_value=None, error=None, input_id=None, is_disabled=None, is_limited_to_possible_values=None, is_read_only=None, possible_values=None): super(InputValues, self).__init__() self.default_value = default_value self.error = error self.input_id = input_id self.is_disabled = is_disabled self.is_limited_to_possible_values = is_limited_to_possible_values self.is_read_only = is_read_only self.possible_values = possible_values class InputValuesError(Model): """InputValuesError. :param message: The error message. :type message: str """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'} } def __init__(self, message=None): super(InputValuesError, self).__init__() self.message = message class InputValuesQuery(Model): """InputValuesQuery. :param current_values: :type current_values: dict :param input_values: The input values to return on input, and the result from the consumer on output. :type input_values: list of :class:`InputValues ` :param resource: Subscription containing information about the publisher/consumer and the current input values :type resource: object """ _attribute_map = { 'current_values': {'key': 'currentValues', 'type': '{str}'}, 'input_values': {'key': 'inputValues', 'type': '[InputValues]'}, 'resource': {'key': 'resource', 'type': 'object'} } def __init__(self, current_values=None, input_values=None, resource=None): super(InputValuesQuery, self).__init__() self.current_values = current_values self.input_values = input_values self.resource = resource class Notification(Model): """Notification. :param created_date: Gets or sets date and time that this result was created. :type created_date: datetime :param details: Details about this notification (if available) :type details: :class:`NotificationDetails ` :param event_id: The event id associated with this notification :type event_id: str :param id: The notification id :type id: int :param modified_date: Gets or sets date and time that this result was last modified. :type modified_date: datetime :param result: Result of the notification :type result: object :param status: Status of the notification :type status: object :param subscriber_id: The subscriber Id associated with this notification. This is the last identity who touched in the subscription. In case of test notifications it can be the tester if the subscription is not created yet. :type subscriber_id: str :param subscription_id: The subscription id associated with this notification :type subscription_id: str """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'details': {'key': 'details', 'type': 'NotificationDetails'}, 'event_id': {'key': 'eventId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, 'result': {'key': 'result', 'type': 'object'}, 'status': {'key': 'status', 'type': 'object'}, 'subscriber_id': {'key': 'subscriberId', 'type': 'str'}, 'subscription_id': {'key': 'subscriptionId', 'type': 'str'} } def __init__(self, created_date=None, details=None, event_id=None, id=None, modified_date=None, result=None, status=None, subscriber_id=None, subscription_id=None): super(Notification, self).__init__() self.created_date = created_date self.details = details self.event_id = event_id self.id = id self.modified_date = modified_date self.result = result self.status = status self.subscriber_id = subscriber_id self.subscription_id = subscription_id class NotificationDetails(Model): """NotificationDetails. :param completed_date: Gets or sets the time that this notification was completed (response received from the consumer) :type completed_date: datetime :param consumer_action_id: Gets or sets this notification detail's consumer action identifier. :type consumer_action_id: str :param consumer_id: Gets or sets this notification detail's consumer identifier. :type consumer_id: str :param consumer_inputs: Gets or sets this notification detail's consumer inputs. :type consumer_inputs: dict :param dequeued_date: Gets or sets the time that this notification was dequeued for processing :type dequeued_date: datetime :param error_detail: Gets or sets this notification detail's error detail. :type error_detail: str :param error_message: Gets or sets this notification detail's error message. :type error_message: str :param event: Gets or sets this notification detail's event content. :type event: :class:`Event ` :param event_type: Gets or sets this notification detail's event type. :type event_type: str :param processed_date: Gets or sets the time that this notification was finished processing (just before the request is sent to the consumer) :type processed_date: datetime :param publisher_id: Gets or sets this notification detail's publisher identifier. :type publisher_id: str :param publisher_inputs: Gets or sets this notification detail's publisher inputs. :type publisher_inputs: dict :param queued_date: Gets or sets the time that this notification was queued (created) :type queued_date: datetime :param request: Gets or sets this notification detail's request. :type request: str :param request_attempts: Number of requests attempted to be sent to the consumer :type request_attempts: int :param request_duration: Duration of the request to the consumer in seconds :type request_duration: float :param response: Gets or sets this notification detail's reponse. :type response: str """ _attribute_map = { 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, 'consumer_action_id': {'key': 'consumerActionId', 'type': 'str'}, 'consumer_id': {'key': 'consumerId', 'type': 'str'}, 'consumer_inputs': {'key': 'consumerInputs', 'type': '{str}'}, 'dequeued_date': {'key': 'dequeuedDate', 'type': 'iso-8601'}, 'error_detail': {'key': 'errorDetail', 'type': 'str'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'event': {'key': 'event', 'type': 'Event'}, 'event_type': {'key': 'eventType', 'type': 'str'}, 'processed_date': {'key': 'processedDate', 'type': 'iso-8601'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_inputs': {'key': 'publisherInputs', 'type': '{str}'}, 'queued_date': {'key': 'queuedDate', 'type': 'iso-8601'}, 'request': {'key': 'request', 'type': 'str'}, 'request_attempts': {'key': 'requestAttempts', 'type': 'int'}, 'request_duration': {'key': 'requestDuration', 'type': 'float'}, 'response': {'key': 'response', 'type': 'str'} } def __init__(self, completed_date=None, consumer_action_id=None, consumer_id=None, consumer_inputs=None, dequeued_date=None, error_detail=None, error_message=None, event=None, event_type=None, processed_date=None, publisher_id=None, publisher_inputs=None, queued_date=None, request=None, request_attempts=None, request_duration=None, response=None): super(NotificationDetails, self).__init__() self.completed_date = completed_date self.consumer_action_id = consumer_action_id self.consumer_id = consumer_id self.consumer_inputs = consumer_inputs self.dequeued_date = dequeued_date self.error_detail = error_detail self.error_message = error_message self.event = event self.event_type = event_type self.processed_date = processed_date self.publisher_id = publisher_id self.publisher_inputs = publisher_inputs self.queued_date = queued_date self.request = request self.request_attempts = request_attempts self.request_duration = request_duration self.response = response class NotificationResultsSummaryDetail(Model): """NotificationResultsSummaryDetail. :param notification_count: Count of notification sent out with a matching result. :type notification_count: int :param result: Result of the notification :type result: object """ _attribute_map = { 'notification_count': {'key': 'notificationCount', 'type': 'int'}, 'result': {'key': 'result', 'type': 'object'} } def __init__(self, notification_count=None, result=None): super(NotificationResultsSummaryDetail, self).__init__() self.notification_count = notification_count self.result = result class NotificationsQuery(Model): """NotificationsQuery. :param associated_subscriptions: The subscriptions associated with the notifications returned from the query :type associated_subscriptions: list of :class:`Subscription ` :param include_details: If true, we will return all notification history for the query provided; otherwise, the summary is returned. :type include_details: bool :param max_created_date: Optional maximum date at which the notification was created :type max_created_date: datetime :param max_results: Optional maximum number of overall results to include :type max_results: int :param max_results_per_subscription: Optional maximum number of results for each subscription. Only takes effect when a list of subscription ids is supplied in the query. :type max_results_per_subscription: int :param min_created_date: Optional minimum date at which the notification was created :type min_created_date: datetime :param publisher_id: Optional publisher id to restrict the results to :type publisher_id: str :param results: Results from the query :type results: list of :class:`Notification ` :param result_type: Optional notification result type to filter results to :type result_type: object :param status: Optional notification status to filter results to :type status: object :param subscription_ids: Optional list of subscription ids to restrict the results to :type subscription_ids: list of str :param summary: Summary of notifications - the count of each result type (success, fail, ..). :type summary: list of :class:`NotificationSummary ` """ _attribute_map = { 'associated_subscriptions': {'key': 'associatedSubscriptions', 'type': '[Subscription]'}, 'include_details': {'key': 'includeDetails', 'type': 'bool'}, 'max_created_date': {'key': 'maxCreatedDate', 'type': 'iso-8601'}, 'max_results': {'key': 'maxResults', 'type': 'int'}, 'max_results_per_subscription': {'key': 'maxResultsPerSubscription', 'type': 'int'}, 'min_created_date': {'key': 'minCreatedDate', 'type': 'iso-8601'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'results': {'key': 'results', 'type': '[Notification]'}, 'result_type': {'key': 'resultType', 'type': 'object'}, 'status': {'key': 'status', 'type': 'object'}, 'subscription_ids': {'key': 'subscriptionIds', 'type': '[str]'}, 'summary': {'key': 'summary', 'type': '[NotificationSummary]'} } def __init__(self, associated_subscriptions=None, include_details=None, max_created_date=None, max_results=None, max_results_per_subscription=None, min_created_date=None, publisher_id=None, results=None, result_type=None, status=None, subscription_ids=None, summary=None): super(NotificationsQuery, self).__init__() self.associated_subscriptions = associated_subscriptions self.include_details = include_details self.max_created_date = max_created_date self.max_results = max_results self.max_results_per_subscription = max_results_per_subscription self.min_created_date = min_created_date self.publisher_id = publisher_id self.results = results self.result_type = result_type self.status = status self.subscription_ids = subscription_ids self.summary = summary class NotificationSummary(Model): """NotificationSummary. :param results: The notification results for this particular subscription. :type results: list of :class:`NotificationResultsSummaryDetail ` :param subscription_id: The subscription id associated with this notification :type subscription_id: str """ _attribute_map = { 'results': {'key': 'results', 'type': '[NotificationResultsSummaryDetail]'}, 'subscription_id': {'key': 'subscriptionId', 'type': 'str'} } def __init__(self, results=None, subscription_id=None): super(NotificationSummary, self).__init__() self.results = results self.subscription_id = subscription_id class Publisher(Model): """Publisher. :param _links: Reference Links :type _links: :class:`ReferenceLinks ` :param description: Gets this publisher's localized description. :type description: str :param id: Gets this publisher's identifier. :type id: str :param input_descriptors: Publisher-specific inputs :type input_descriptors: list of :class:`InputDescriptor ` :param name: Gets this publisher's localized name. :type name: str :param service_instance_type: The service instance type of the first party publisher. :type service_instance_type: str :param supported_events: Gets this publisher's supported event types. :type supported_events: list of :class:`EventTypeDescriptor ` :param url: The url for this resource :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'name': {'key': 'name', 'type': 'str'}, 'service_instance_type': {'key': 'serviceInstanceType', 'type': 'str'}, 'supported_events': {'key': 'supportedEvents', 'type': '[EventTypeDescriptor]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, description=None, id=None, input_descriptors=None, name=None, service_instance_type=None, supported_events=None, url=None): super(Publisher, self).__init__() self._links = _links self.description = description self.id = id self.input_descriptors = input_descriptors self.name = name self.service_instance_type = service_instance_type self.supported_events = supported_events self.url = url class PublisherEvent(Model): """PublisherEvent. :param diagnostics: Add key/value pairs which will be stored with a published notification in the SH service DB. This key/value pairs are for diagnostic purposes only and will have not effect on the delivery of a notificaton. :type diagnostics: dict :param event: The event being published :type event: :class:`Event ` :param is_filtered_event: Gets or sets flag for filtered events :type is_filtered_event: bool :param notification_data: Additional data that needs to be sent as part of notification to complement the Resource data in the Event :type notification_data: dict :param other_resource_versions: Gets or sets the array of older supported resource versions. :type other_resource_versions: list of :class:`VersionedResource ` :param publisher_input_filters: Optional publisher-input filters which restricts the set of subscriptions which are triggered by the event :type publisher_input_filters: list of :class:`InputFilter ` :param subscription: Gets or sets matchd hooks subscription which caused this event. :type subscription: :class:`Subscription ` """ _attribute_map = { 'diagnostics': {'key': 'diagnostics', 'type': '{str}'}, 'event': {'key': 'event', 'type': 'Event'}, 'is_filtered_event': {'key': 'isFilteredEvent', 'type': 'bool'}, 'notification_data': {'key': 'notificationData', 'type': '{str}'}, 'other_resource_versions': {'key': 'otherResourceVersions', 'type': '[VersionedResource]'}, 'publisher_input_filters': {'key': 'publisherInputFilters', 'type': '[InputFilter]'}, 'subscription': {'key': 'subscription', 'type': 'Subscription'} } def __init__(self, diagnostics=None, event=None, is_filtered_event=None, notification_data=None, other_resource_versions=None, publisher_input_filters=None, subscription=None): super(PublisherEvent, self).__init__() self.diagnostics = diagnostics self.event = event self.is_filtered_event = is_filtered_event self.notification_data = notification_data self.other_resource_versions = other_resource_versions self.publisher_input_filters = publisher_input_filters self.subscription = subscription class PublishersQuery(Model): """PublishersQuery. :param publisher_ids: Optional list of publisher ids to restrict the results to :type publisher_ids: list of str :param publisher_inputs: Filter for publisher inputs :type publisher_inputs: dict :param results: Results from the query :type results: list of :class:`Publisher ` """ _attribute_map = { 'publisher_ids': {'key': 'publisherIds', 'type': '[str]'}, 'publisher_inputs': {'key': 'publisherInputs', 'type': '{str}'}, 'results': {'key': 'results', 'type': '[Publisher]'} } def __init__(self, publisher_ids=None, publisher_inputs=None, results=None): super(PublishersQuery, self).__init__() self.publisher_ids = publisher_ids self.publisher_inputs = publisher_inputs self.results = results class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class ResourceContainer(Model): """ResourceContainer. :param base_url: Gets or sets the container's base URL, i.e. the URL of the host (collection, application, or deploument) containing the container resource. :type base_url: str :param id: Gets or sets the container's specific Id. :type id: str :param name: Gets or sets the container's name. :type name: str :param url: Gets or sets the container's REST API URL. :type url: str """ _attribute_map = { 'base_url': {'key': 'baseUrl', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, base_url=None, id=None, name=None, url=None): super(ResourceContainer, self).__init__() self.base_url = base_url self.id = id self.name = name self.url = url class SessionToken(Model): """SessionToken. :param error: The error message in case of error :type error: str :param token: The access token :type token: str :param valid_to: The expiration date in UTC :type valid_to: datetime """ _attribute_map = { 'error': {'key': 'error', 'type': 'str'}, 'token': {'key': 'token', 'type': 'str'}, 'valid_to': {'key': 'validTo', 'type': 'iso-8601'} } def __init__(self, error=None, token=None, valid_to=None): super(SessionToken, self).__init__() self.error = error self.token = token self.valid_to = valid_to class Subscription(Model): """Subscription. :param _links: Reference Links :type _links: :class:`ReferenceLinks ` :param action_description: :type action_description: str :param consumer_action_id: :type consumer_action_id: str :param consumer_id: :type consumer_id: str :param consumer_inputs: Consumer input values :type consumer_inputs: dict :param created_by: :type created_by: :class:`IdentityRef ` :param created_date: :type created_date: datetime :param event_description: :type event_description: str :param event_type: :type event_type: str :param id: :type id: str :param modified_by: :type modified_by: :class:`IdentityRef ` :param modified_date: :type modified_date: datetime :param probation_retries: :type probation_retries: str :param publisher_id: :type publisher_id: str :param publisher_inputs: Publisher input values :type publisher_inputs: dict :param resource_version: :type resource_version: str :param status: :type status: object :param subscriber: :type subscriber: :class:`IdentityRef ` :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'action_description': {'key': 'actionDescription', 'type': 'str'}, 'consumer_action_id': {'key': 'consumerActionId', 'type': 'str'}, 'consumer_id': {'key': 'consumerId', 'type': 'str'}, 'consumer_inputs': {'key': 'consumerInputs', 'type': '{str}'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'event_description': {'key': 'eventDescription', 'type': 'str'}, 'event_type': {'key': 'eventType', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, 'probation_retries': {'key': 'probationRetries', 'type': 'str'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_inputs': {'key': 'publisherInputs', 'type': '{str}'}, 'resource_version': {'key': 'resourceVersion', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'subscriber': {'key': 'subscriber', 'type': 'IdentityRef'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, action_description=None, consumer_action_id=None, consumer_id=None, consumer_inputs=None, created_by=None, created_date=None, event_description=None, event_type=None, id=None, modified_by=None, modified_date=None, probation_retries=None, publisher_id=None, publisher_inputs=None, resource_version=None, status=None, subscriber=None, url=None): super(Subscription, self).__init__() self._links = _links self.action_description = action_description self.consumer_action_id = consumer_action_id self.consumer_id = consumer_id self.consumer_inputs = consumer_inputs self.created_by = created_by self.created_date = created_date self.event_description = event_description self.event_type = event_type self.id = id self.modified_by = modified_by self.modified_date = modified_date self.probation_retries = probation_retries self.publisher_id = publisher_id self.publisher_inputs = publisher_inputs self.resource_version = resource_version self.status = status self.subscriber = subscriber self.url = url class SubscriptionDiagnostics(Model): """SubscriptionDiagnostics. :param delivery_results: :type delivery_results: :class:`SubscriptionTracing ` :param delivery_tracing: :type delivery_tracing: :class:`SubscriptionTracing ` :param evaluation_tracing: :type evaluation_tracing: :class:`SubscriptionTracing ` """ _attribute_map = { 'delivery_results': {'key': 'deliveryResults', 'type': 'SubscriptionTracing'}, 'delivery_tracing': {'key': 'deliveryTracing', 'type': 'SubscriptionTracing'}, 'evaluation_tracing': {'key': 'evaluationTracing', 'type': 'SubscriptionTracing'} } def __init__(self, delivery_results=None, delivery_tracing=None, evaluation_tracing=None): super(SubscriptionDiagnostics, self).__init__() self.delivery_results = delivery_results self.delivery_tracing = delivery_tracing self.evaluation_tracing = evaluation_tracing class SubscriptionsQuery(Model): """SubscriptionsQuery. :param consumer_action_id: Optional consumer action id to restrict the results to (null for any) :type consumer_action_id: str :param consumer_id: Optional consumer id to restrict the results to (null for any) :type consumer_id: str :param consumer_input_filters: Filter for subscription consumer inputs :type consumer_input_filters: list of :class:`InputFilter ` :param event_type: Optional event type id to restrict the results to (null for any) :type event_type: str :param publisher_id: Optional publisher id to restrict the results to (null for any) :type publisher_id: str :param publisher_input_filters: Filter for subscription publisher inputs :type publisher_input_filters: list of :class:`InputFilter ` :param results: Results from the query :type results: list of :class:`Subscription ` :param subscriber_id: Optional subscriber filter. :type subscriber_id: str """ _attribute_map = { 'consumer_action_id': {'key': 'consumerActionId', 'type': 'str'}, 'consumer_id': {'key': 'consumerId', 'type': 'str'}, 'consumer_input_filters': {'key': 'consumerInputFilters', 'type': '[InputFilter]'}, 'event_type': {'key': 'eventType', 'type': 'str'}, 'publisher_id': {'key': 'publisherId', 'type': 'str'}, 'publisher_input_filters': {'key': 'publisherInputFilters', 'type': '[InputFilter]'}, 'results': {'key': 'results', 'type': '[Subscription]'}, 'subscriber_id': {'key': 'subscriberId', 'type': 'str'} } def __init__(self, consumer_action_id=None, consumer_id=None, consumer_input_filters=None, event_type=None, publisher_id=None, publisher_input_filters=None, results=None, subscriber_id=None): super(SubscriptionsQuery, self).__init__() self.consumer_action_id = consumer_action_id self.consumer_id = consumer_id self.consumer_input_filters = consumer_input_filters self.event_type = event_type self.publisher_id = publisher_id self.publisher_input_filters = publisher_input_filters self.results = results self.subscriber_id = subscriber_id class SubscriptionTracing(Model): """SubscriptionTracing. :param enabled: :type enabled: bool :param end_date: Trace until the specified end date. :type end_date: datetime :param max_traced_entries: The maximum number of result details to trace. :type max_traced_entries: int :param start_date: The date and time tracing started. :type start_date: datetime :param traced_entries: Trace until remaining count reaches 0. :type traced_entries: int """ _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, 'max_traced_entries': {'key': 'maxTracedEntries', 'type': 'int'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'traced_entries': {'key': 'tracedEntries', 'type': 'int'} } def __init__(self, enabled=None, end_date=None, max_traced_entries=None, start_date=None, traced_entries=None): super(SubscriptionTracing, self).__init__() self.enabled = enabled self.end_date = end_date self.max_traced_entries = max_traced_entries self.start_date = start_date self.traced_entries = traced_entries class UpdateSubscripitonDiagnosticsParameters(Model): """UpdateSubscripitonDiagnosticsParameters. :param delivery_results: :type delivery_results: :class:`UpdateSubscripitonTracingParameters ` :param delivery_tracing: :type delivery_tracing: :class:`UpdateSubscripitonTracingParameters ` :param evaluation_tracing: :type evaluation_tracing: :class:`UpdateSubscripitonTracingParameters ` """ _attribute_map = { 'delivery_results': {'key': 'deliveryResults', 'type': 'UpdateSubscripitonTracingParameters'}, 'delivery_tracing': {'key': 'deliveryTracing', 'type': 'UpdateSubscripitonTracingParameters'}, 'evaluation_tracing': {'key': 'evaluationTracing', 'type': 'UpdateSubscripitonTracingParameters'} } def __init__(self, delivery_results=None, delivery_tracing=None, evaluation_tracing=None): super(UpdateSubscripitonDiagnosticsParameters, self).__init__() self.delivery_results = delivery_results self.delivery_tracing = delivery_tracing self.evaluation_tracing = evaluation_tracing class UpdateSubscripitonTracingParameters(Model): """UpdateSubscripitonTracingParameters. :param enabled: :type enabled: bool """ _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'} } def __init__(self, enabled=None): super(UpdateSubscripitonTracingParameters, self).__init__() self.enabled = enabled class VersionedResource(Model): """VersionedResource. :param compatible_with: Gets or sets the reference to the compatible version. :type compatible_with: str :param resource: Gets or sets the resource data. :type resource: object :param resource_version: Gets or sets the version of the resource data. :type resource_version: str """ _attribute_map = { 'compatible_with': {'key': 'compatibleWith', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'object'}, 'resource_version': {'key': 'resourceVersion', 'type': 'str'} } def __init__(self, compatible_with=None, resource=None, resource_version=None): super(VersionedResource, self).__init__() self.compatible_with = compatible_with self.resource = resource self.resource_version = resource_version __all__ = [ 'Consumer', 'ConsumerAction', 'Event', 'EventTypeDescriptor', 'ExternalConfigurationDescriptor', 'FormattedEventMessage', 'GraphSubjectBase', 'IdentityRef', 'InputDescriptor', 'InputFilter', 'InputFilterCondition', 'InputValidation', 'InputValue', 'InputValues', 'InputValuesError', 'InputValuesQuery', 'Notification', 'NotificationDetails', 'NotificationResultsSummaryDetail', 'NotificationsQuery', 'NotificationSummary', 'Publisher', 'PublisherEvent', 'PublishersQuery', 'ReferenceLinks', 'ResourceContainer', 'SessionToken', 'Subscription', 'SubscriptionDiagnostics', 'SubscriptionsQuery', 'SubscriptionTracing', 'UpdateSubscripitonDiagnosticsParameters', 'UpdateSubscripitonTracingParameters', 'VersionedResource', ] service_hooks_client.py000066400000000000000000000516211360605530400364210ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/service_hooks# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class ServiceHooksClient(Client): """ServiceHooks :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(ServiceHooksClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_consumer_action(self, consumer_id, consumer_action_id, publisher_id=None): """GetConsumerAction. Get details about a specific consumer action. :param str consumer_id: ID for a consumer. :param str consumer_action_id: ID for a consumerActionId. :param str publisher_id: :rtype: :class:` ` """ route_values = {} if consumer_id is not None: route_values['consumerId'] = self._serialize.url('consumer_id', consumer_id, 'str') if consumer_action_id is not None: route_values['consumerActionId'] = self._serialize.url('consumer_action_id', consumer_action_id, 'str') query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='c3428e90-7a69-4194-8ed8-0f153185ee0d', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ConsumerAction', response) def list_consumer_actions(self, consumer_id, publisher_id=None): """ListConsumerActions. Get a list of consumer actions for a specific consumer. :param str consumer_id: ID for a consumer. :param str publisher_id: :rtype: [ConsumerAction] """ route_values = {} if consumer_id is not None: route_values['consumerId'] = self._serialize.url('consumer_id', consumer_id, 'str') query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='c3428e90-7a69-4194-8ed8-0f153185ee0d', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ConsumerAction]', self._unwrap_collection(response)) def get_consumer(self, consumer_id, publisher_id=None): """GetConsumer. Get a specific consumer service. Optionally filter out consumer actions that do not support any event types for the specified publisher. :param str consumer_id: ID for a consumer. :param str publisher_id: :rtype: :class:` ` """ route_values = {} if consumer_id is not None: route_values['consumerId'] = self._serialize.url('consumer_id', consumer_id, 'str') query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='4301c514-5f34-4f5d-a145-f0ea7b5b7d19', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Consumer', response) def list_consumers(self, publisher_id=None): """ListConsumers. Get a list of available service hook consumer services. Optionally filter by consumers that support at least one event type from the specific publisher. :param str publisher_id: :rtype: [Consumer] """ query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='4301c514-5f34-4f5d-a145-f0ea7b5b7d19', version='5.0', query_parameters=query_parameters) return self._deserialize('[Consumer]', self._unwrap_collection(response)) def get_subscription_diagnostics(self, subscription_id): """GetSubscriptionDiagnostics. [Preview API] :param str subscription_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') response = self._send(http_method='GET', location_id='3b36bcb5-02ad-43c6-bbfa-6dfc6f8e9d68', version='5.0-preview.1', route_values=route_values) return self._deserialize('SubscriptionDiagnostics', response) def update_subscription_diagnostics(self, update_parameters, subscription_id): """UpdateSubscriptionDiagnostics. [Preview API] :param :class:` ` update_parameters: :param str subscription_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') content = self._serialize.body(update_parameters, 'UpdateSubscripitonDiagnosticsParameters') response = self._send(http_method='PUT', location_id='3b36bcb5-02ad-43c6-bbfa-6dfc6f8e9d68', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('SubscriptionDiagnostics', response) def get_event_type(self, publisher_id, event_type_id): """GetEventType. Get a specific event type. :param str publisher_id: ID for a publisher. :param str event_type_id: :rtype: :class:` ` """ route_values = {} if publisher_id is not None: route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') if event_type_id is not None: route_values['eventTypeId'] = self._serialize.url('event_type_id', event_type_id, 'str') response = self._send(http_method='GET', location_id='db4777cd-8e08-4a84-8ba3-c974ea033718', version='5.0', route_values=route_values) return self._deserialize('EventTypeDescriptor', response) def list_event_types(self, publisher_id): """ListEventTypes. Get the event types for a specific publisher. :param str publisher_id: ID for a publisher. :rtype: [EventTypeDescriptor] """ route_values = {} if publisher_id is not None: route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='db4777cd-8e08-4a84-8ba3-c974ea033718', version='5.0', route_values=route_values) return self._deserialize('[EventTypeDescriptor]', self._unwrap_collection(response)) def get_notification(self, subscription_id, notification_id): """GetNotification. Get a specific notification for a subscription. :param str subscription_id: ID for a subscription. :param int notification_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') if notification_id is not None: route_values['notificationId'] = self._serialize.url('notification_id', notification_id, 'int') response = self._send(http_method='GET', location_id='0c62d343-21b0-4732-997b-017fde84dc28', version='5.0', route_values=route_values) return self._deserialize('Notification', response) def get_notifications(self, subscription_id, max_results=None, status=None, result=None): """GetNotifications. Get a list of notifications for a specific subscription. A notification includes details about the event, the request to and the response from the consumer service. :param str subscription_id: ID for a subscription. :param int max_results: Maximum number of notifications to return. Default is **100**. :param str status: Get only notifications with this status. :param str result: Get only notifications with this result type. :rtype: [Notification] """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') query_parameters = {} if max_results is not None: query_parameters['maxResults'] = self._serialize.query('max_results', max_results, 'int') if status is not None: query_parameters['status'] = self._serialize.query('status', status, 'str') if result is not None: query_parameters['result'] = self._serialize.query('result', result, 'str') response = self._send(http_method='GET', location_id='0c62d343-21b0-4732-997b-017fde84dc28', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Notification]', self._unwrap_collection(response)) def query_notifications(self, query): """QueryNotifications. Query for notifications. A notification includes details about the event, the request to and the response from the consumer service. :param :class:` ` query: :rtype: :class:` ` """ content = self._serialize.body(query, 'NotificationsQuery') response = self._send(http_method='POST', location_id='1a57562f-160a-4b5c-9185-905e95b39d36', version='5.0', content=content) return self._deserialize('NotificationsQuery', response) def query_input_values(self, input_values_query, publisher_id): """QueryInputValues. :param :class:` ` input_values_query: :param str publisher_id: :rtype: :class:` ` """ route_values = {} if publisher_id is not None: route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') content = self._serialize.body(input_values_query, 'InputValuesQuery') response = self._send(http_method='POST', location_id='d815d352-a566-4dc1-a3e3-fd245acf688c', version='5.0', route_values=route_values, content=content) return self._deserialize('InputValuesQuery', response) def get_publisher(self, publisher_id): """GetPublisher. Get a specific service hooks publisher. :param str publisher_id: ID for a publisher. :rtype: :class:` ` """ route_values = {} if publisher_id is not None: route_values['publisherId'] = self._serialize.url('publisher_id', publisher_id, 'str') response = self._send(http_method='GET', location_id='1e83a210-5b53-43bc-90f0-d476a4e5d731', version='5.0', route_values=route_values) return self._deserialize('Publisher', response) def list_publishers(self): """ListPublishers. Get a list of publishers. :rtype: [Publisher] """ response = self._send(http_method='GET', location_id='1e83a210-5b53-43bc-90f0-d476a4e5d731', version='5.0') return self._deserialize('[Publisher]', self._unwrap_collection(response)) def query_publishers(self, query): """QueryPublishers. Query for service hook publishers. :param :class:` ` query: :rtype: :class:` ` """ content = self._serialize.body(query, 'PublishersQuery') response = self._send(http_method='POST', location_id='99b44a8a-65a8-4670-8f3e-e7f7842cce64', version='5.0', content=content) return self._deserialize('PublishersQuery', response) def create_subscription(self, subscription): """CreateSubscription. Create a subscription. :param :class:` ` subscription: Subscription to be created. :rtype: :class:` ` """ content = self._serialize.body(subscription, 'Subscription') response = self._send(http_method='POST', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.0', content=content) return self._deserialize('Subscription', response) def delete_subscription(self, subscription_id): """DeleteSubscription. Delete a specific service hooks subscription. :param str subscription_id: ID for a subscription. """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') self._send(http_method='DELETE', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.0', route_values=route_values) def get_subscription(self, subscription_id): """GetSubscription. Get a specific service hooks subscription. :param str subscription_id: ID for a subscription. :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') response = self._send(http_method='GET', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.0', route_values=route_values) return self._deserialize('Subscription', response) def list_subscriptions(self, publisher_id=None, event_type=None, consumer_id=None, consumer_action_id=None): """ListSubscriptions. Get a list of subscriptions. :param str publisher_id: ID for a subscription. :param str event_type: Maximum number of notifications to return. Default is 100. :param str consumer_id: ID for a consumer. :param str consumer_action_id: ID for a consumerActionId. :rtype: [Subscription] """ query_parameters = {} if publisher_id is not None: query_parameters['publisherId'] = self._serialize.query('publisher_id', publisher_id, 'str') if event_type is not None: query_parameters['eventType'] = self._serialize.query('event_type', event_type, 'str') if consumer_id is not None: query_parameters['consumerId'] = self._serialize.query('consumer_id', consumer_id, 'str') if consumer_action_id is not None: query_parameters['consumerActionId'] = self._serialize.query('consumer_action_id', consumer_action_id, 'str') response = self._send(http_method='GET', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.0', query_parameters=query_parameters) return self._deserialize('[Subscription]', self._unwrap_collection(response)) def replace_subscription(self, subscription, subscription_id=None): """ReplaceSubscription. Update a subscription. ID for a subscription that you wish to update. :param :class:` ` subscription: :param str subscription_id: :rtype: :class:` ` """ route_values = {} if subscription_id is not None: route_values['subscriptionId'] = self._serialize.url('subscription_id', subscription_id, 'str') content = self._serialize.body(subscription, 'Subscription') response = self._send(http_method='PUT', location_id='fc50d02a-849f-41fb-8af1-0a5216103269', version='5.0', route_values=route_values, content=content) return self._deserialize('Subscription', response) def create_subscriptions_query(self, query): """CreateSubscriptionsQuery. Query for service hook subscriptions. :param :class:` ` query: :rtype: :class:` ` """ content = self._serialize.body(query, 'SubscriptionsQuery') response = self._send(http_method='POST', location_id='c7c3c1cf-9e05-4c0d-a425-a0f922c2c6ed', version='5.0', content=content) return self._deserialize('SubscriptionsQuery', response) def create_test_notification(self, test_notification, use_real_data=None): """CreateTestNotification. Sends a test notification. This is useful for verifying the configuration of an updated or new service hooks subscription. :param :class:` ` test_notification: :param bool use_real_data: Only allow testing with real data in existing subscriptions. :rtype: :class:` ` """ query_parameters = {} if use_real_data is not None: query_parameters['useRealData'] = self._serialize.query('use_real_data', use_real_data, 'bool') content = self._serialize.body(test_notification, 'Notification') response = self._send(http_method='POST', location_id='1139462c-7e27-4524-a997-31b9b73551fe', version='5.0', query_parameters=query_parameters, content=content) return self._deserialize('Notification', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/settings/000077500000000000000000000000001360605530400307155ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/settings/__init__.py000066400000000000000000000011761360605530400330330ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .settings_client import SettingsClient __all__ = [ 'SettingsClient' ] settings_client.py000066400000000000000000000167271360605530400344230ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/settings# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client class SettingsClient(Client): """Settings :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(SettingsClient, self).__init__(base_url, creds) self._serialize = Serializer() self._deserialize = Deserializer() resource_area_identifier = None def get_entries(self, user_scope, key=None): """GetEntries. [Preview API] Get all setting entries for the given user/all-users scope :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. :param str key: Optional key under which to filter all the entries :rtype: {object} """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') if key is not None: route_values['key'] = self._serialize.url('key', key, 'str') response = self._send(http_method='GET', location_id='cd006711-163d-4cd4-a597-b05bad2556ff', version='5.0-preview.1', route_values=route_values) return self._deserialize('{object}', self._unwrap_collection(response)) def remove_entries(self, user_scope, key): """RemoveEntries. [Preview API] Remove the entry or entries under the specified path :param str user_scope: User-Scope at which to remove the value. Should be "me" for the current user or "host" for all users. :param str key: Root key of the entry or entries to remove """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') if key is not None: route_values['key'] = self._serialize.url('key', key, 'str') self._send(http_method='DELETE', location_id='cd006711-163d-4cd4-a597-b05bad2556ff', version='5.0-preview.1', route_values=route_values) def set_entries(self, entries, user_scope): """SetEntries. [Preview API] Set the specified setting entry values for the given user/all-users scope :param {object} entries: The entries to set :param str user_scope: User-Scope at which to set the values. Should be "me" for the current user or "host" for all users. """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') content = self._serialize.body(entries, '{object}') self._send(http_method='PATCH', location_id='cd006711-163d-4cd4-a597-b05bad2556ff', version='5.0-preview.1', route_values=route_values, content=content) def get_entries_for_scope(self, user_scope, scope_name, scope_value, key=None): """GetEntriesForScope. [Preview API] Get all setting entries for the given named scope :param str user_scope: User-Scope at which to get the value. Should be "me" for the current user or "host" for all users. :param str scope_name: Scope at which to get the setting for (e.g. "project" or "team") :param str scope_value: Value of the scope (e.g. the project or team id) :param str key: Optional key under which to filter all the entries :rtype: {object} """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') if scope_name is not None: route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') if scope_value is not None: route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') if key is not None: route_values['key'] = self._serialize.url('key', key, 'str') response = self._send(http_method='GET', location_id='4cbaafaf-e8af-4570-98d1-79ee99c56327', version='5.0-preview.1', route_values=route_values) return self._deserialize('{object}', self._unwrap_collection(response)) def remove_entries_for_scope(self, user_scope, scope_name, scope_value, key): """RemoveEntriesForScope. [Preview API] Remove the entry or entries under the specified path :param str user_scope: User-Scope at which to remove the value. Should be "me" for the current user or "host" for all users. :param str scope_name: Scope at which to get the setting for (e.g. "project" or "team") :param str scope_value: Value of the scope (e.g. the project or team id) :param str key: Root key of the entry or entries to remove """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') if scope_name is not None: route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') if scope_value is not None: route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') if key is not None: route_values['key'] = self._serialize.url('key', key, 'str') self._send(http_method='DELETE', location_id='4cbaafaf-e8af-4570-98d1-79ee99c56327', version='5.0-preview.1', route_values=route_values) def set_entries_for_scope(self, entries, user_scope, scope_name, scope_value): """SetEntriesForScope. [Preview API] Set the specified entries for the given named scope :param {object} entries: The entries to set :param str user_scope: User-Scope at which to set the values. Should be "me" for the current user or "host" for all users. :param str scope_name: Scope at which to set the settings on (e.g. "project" or "team") :param str scope_value: Value of the scope (e.g. the project or team id) """ route_values = {} if user_scope is not None: route_values['userScope'] = self._serialize.url('user_scope', user_scope, 'str') if scope_name is not None: route_values['scopeName'] = self._serialize.url('scope_name', scope_name, 'str') if scope_value is not None: route_values['scopeValue'] = self._serialize.url('scope_value', scope_value, 'str') content = self._serialize.body(entries, '{object}') self._send(http_method='PATCH', location_id='4cbaafaf-e8af-4570-98d1-79ee99c56327', version='5.0-preview.1', route_values=route_values, content=content) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/symbol/000077500000000000000000000000001360605530400303625ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/symbol/__init__.py000066400000000000000000000014671360605530400325030ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .symbol_client import SymbolClient __all__ = [ 'DebugEntry', 'DebugEntryCreateBatch', 'JsonBlobBlockHash', 'JsonBlobIdentifier', 'JsonBlobIdentifierWithBlocks', 'Request', 'ResourceBase', 'SymbolClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/symbol/models.py000066400000000000000000000235271360605530400322300ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class DebugEntryCreateBatch(Model): """DebugEntryCreateBatch. :param create_behavior: Defines what to do when a debug entry in the batch already exists. :type create_behavior: object :param debug_entries: The debug entries. :type debug_entries: list of :class:`DebugEntry ` """ _attribute_map = { 'create_behavior': {'key': 'createBehavior', 'type': 'object'}, 'debug_entries': {'key': 'debugEntries', 'type': '[DebugEntry]'} } def __init__(self, create_behavior=None, debug_entries=None): super(DebugEntryCreateBatch, self).__init__() self.create_behavior = create_behavior self.debug_entries = debug_entries class JsonBlobBlockHash(Model): """JsonBlobBlockHash. :param hash_bytes: :type hash_bytes: str """ _attribute_map = { 'hash_bytes': {'key': 'hashBytes', 'type': 'str'} } def __init__(self, hash_bytes=None): super(JsonBlobBlockHash, self).__init__() self.hash_bytes = hash_bytes class JsonBlobIdentifier(Model): """JsonBlobIdentifier. :param identifier_value: :type identifier_value: str """ _attribute_map = { 'identifier_value': {'key': 'identifierValue', 'type': 'str'} } def __init__(self, identifier_value=None): super(JsonBlobIdentifier, self).__init__() self.identifier_value = identifier_value class JsonBlobIdentifierWithBlocks(Model): """JsonBlobIdentifierWithBlocks. :param block_hashes: :type block_hashes: list of :class:`JsonBlobBlockHash ` :param identifier_value: :type identifier_value: str """ _attribute_map = { 'block_hashes': {'key': 'blockHashes', 'type': '[JsonBlobBlockHash]'}, 'identifier_value': {'key': 'identifierValue', 'type': 'str'} } def __init__(self, block_hashes=None, identifier_value=None): super(JsonBlobIdentifierWithBlocks, self).__init__() self.block_hashes = block_hashes self.identifier_value = identifier_value class ResourceBase(Model): """ResourceBase. :param created_by: The ID of user who created this item. Optional. :type created_by: str :param created_date: The date time when this item is created. Optional. :type created_date: datetime :param id: An identifier for this item. Optional. :type id: str :param storage_eTag: An opaque ETag used to synchronize with the version stored at server end. Optional. :type storage_eTag: str :param url: A URI which can be used to retrieve this item in its raw format. Optional. Note this is distinguished from other URIs that are present in a derived resource. :type url: str """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'storage_eTag': {'key': 'storageETag', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, created_by=None, created_date=None, id=None, storage_eTag=None, url=None): super(ResourceBase, self).__init__() self.created_by = created_by self.created_date = created_date self.id = id self.storage_eTag = storage_eTag self.url = url class DebugEntry(ResourceBase): """DebugEntry. :param created_by: The ID of user who created this item. Optional. :type created_by: str :param created_date: The date time when this item is created. Optional. :type created_date: datetime :param id: An identifier for this item. Optional. :type id: str :param storage_eTag: An opaque ETag used to synchronize with the version stored at server end. Optional. :type storage_eTag: str :param url: A URI which can be used to retrieve this item in its raw format. Optional. Note this is distinguished from other URIs that are present in a derived resource. :type url: str :param blob_details: :type blob_details: :class:`JsonBlobIdentifierWithBlocks ` :param blob_identifier: A blob identifier of the symbol file to upload to this debug entry. This property is mostly used during creation of debug entry (a.k.a. symbol publishing) to allow the server to query the existence of the blob. :type blob_identifier: :class:`JsonBlobIdentifier ` :param blob_uri: The URI to get the symbol file. Provided by the server, the URI contains authentication information and is readily accessible by plain HTTP GET request. The client is recommended to retrieve the file as soon as it can since the URI will expire in a short period. :type blob_uri: str :param client_key: A key the client (debugger, for example) uses to find the debug entry. Note it is not unique for each different symbol file as it does not distinguish between those which only differ by information level. :type client_key: str :param information_level: The information level this debug entry contains. :type information_level: object :param request_id: The identifier of symbol request to which this debug entry belongs. :type request_id: str :param status: The status of debug entry. :type status: object """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'storage_eTag': {'key': 'storageETag', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'blob_details': {'key': 'blobDetails', 'type': 'JsonBlobIdentifierWithBlocks'}, 'blob_identifier': {'key': 'blobIdentifier', 'type': 'JsonBlobIdentifier'}, 'blob_uri': {'key': 'blobUri', 'type': 'str'}, 'client_key': {'key': 'clientKey', 'type': 'str'}, 'information_level': {'key': 'informationLevel', 'type': 'object'}, 'request_id': {'key': 'requestId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, created_by=None, created_date=None, id=None, storage_eTag=None, url=None, blob_details=None, blob_identifier=None, blob_uri=None, client_key=None, information_level=None, request_id=None, status=None): super(DebugEntry, self).__init__(created_by=created_by, created_date=created_date, id=id, storage_eTag=storage_eTag, url=url) self.blob_details = blob_details self.blob_identifier = blob_identifier self.blob_uri = blob_uri self.client_key = client_key self.information_level = information_level self.request_id = request_id self.status = status class Request(ResourceBase): """Request. :param created_by: The ID of user who created this item. Optional. :type created_by: str :param created_date: The date time when this item is created. Optional. :type created_date: datetime :param id: An identifier for this item. Optional. :type id: str :param storage_eTag: An opaque ETag used to synchronize with the version stored at server end. Optional. :type storage_eTag: str :param url: A URI which can be used to retrieve this item in its raw format. Optional. Note this is distinguished from other URIs that are present in a derived resource. :type url: str :param description: An optional human-facing description. :type description: str :param expiration_date: An optional expiration date for the request. The request will become inaccessible and get deleted after the date, regardless of its status. On an HTTP POST, if expiration date is null/missing, the server will assign a default expiration data (30 days unless overwridden in the registry at the account level). On PATCH, if expiration date is null/missing, the behavior is to not change whatever the request's current expiration date is. :type expiration_date: datetime :param name: A human-facing name for the request. Required on POST, ignored on PATCH. :type name: str :param status: The status for this request. :type status: object """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'storage_eTag': {'key': 'storageETag', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'expiration_date': {'key': 'expirationDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, created_by=None, created_date=None, id=None, storage_eTag=None, url=None, description=None, expiration_date=None, name=None, status=None): super(Request, self).__init__(created_by=created_by, created_date=created_date, id=id, storage_eTag=storage_eTag, url=url) self.description = description self.expiration_date = expiration_date self.name = name self.status = status __all__ = [ 'DebugEntryCreateBatch', 'JsonBlobBlockHash', 'JsonBlobIdentifier', 'JsonBlobIdentifierWithBlocks', 'ResourceBase', 'DebugEntry', 'Request', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/symbol/symbol_client.py000066400000000000000000000305161360605530400336040ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class SymbolClient(Client): """Symbol :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(SymbolClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'af607f94-69ba-4821-8159-f04e37b66350' def check_availability(self): """CheckAvailability. [Preview API] Check the availability of symbol service. This includes checking for feature flag, and possibly license in future. Note this is NOT an anonymous endpoint, and the caller will be redirected to authentication before hitting it. """ self._send(http_method='GET', location_id='97c893cc-e861-4ef4-8c43-9bad4a963dee', version='5.0-preview.1') def get_client(self, client_type): """GetClient. [Preview API] Get the client package. :param str client_type: Either "EXE" for a zip file containing a Windows symbol client (a.k.a. symbol.exe) along with dependencies, or "TASK" for a VSTS task that can be run on a VSTS build agent. All the other values are invalid. The parameter is case-insensitive. :rtype: object """ route_values = {} if client_type is not None: route_values['clientType'] = self._serialize.url('client_type', client_type, 'str') response = self._send(http_method='GET', location_id='79c83865-4de3-460c-8a16-01be238e0818', version='5.0-preview.1', route_values=route_values) return self._deserialize('object', response) def head_client(self): """HeadClient. [Preview API] Get client version information. """ self._send(http_method='HEAD', location_id='79c83865-4de3-460c-8a16-01be238e0818', version='5.0-preview.1') def create_requests(self, request_to_create): """CreateRequests. [Preview API] Create a new symbol request. :param :class:` ` request_to_create: The symbol request to create. :rtype: :class:` ` """ content = self._serialize.body(request_to_create, 'Request') response = self._send(http_method='POST', location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', version='5.0-preview.1', content=content) return self._deserialize('Request', response) def create_requests_request_id_debug_entries(self, batch, request_id, collection): """CreateRequestsRequestIdDebugEntries. [Preview API] Create debug entries for a symbol request as specified by its identifier. :param :class:` ` batch: A batch that contains debug entries to create. :param str request_id: The symbol request identifier. :param str collection: A valid debug entry collection name. Must be "debugentries". :rtype: [DebugEntry] """ route_values = {} if request_id is not None: route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') query_parameters = {} if collection is not None: query_parameters['collection'] = self._serialize.query('collection', collection, 'str') content = self._serialize.body(batch, 'DebugEntryCreateBatch') response = self._send(http_method='POST', location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[DebugEntry]', self._unwrap_collection(response)) def create_requests_request_name_debug_entries(self, batch, request_name, collection): """CreateRequestsRequestNameDebugEntries. [Preview API] Create debug entries for a symbol request as specified by its name. :param :class:` ` batch: A batch that contains debug entries to create. :param str request_name: :param str collection: A valid debug entry collection name. Must be "debugentries". :rtype: [DebugEntry] """ query_parameters = {} if request_name is not None: query_parameters['requestName'] = self._serialize.query('request_name', request_name, 'str') if collection is not None: query_parameters['collection'] = self._serialize.query('collection', collection, 'str') content = self._serialize.body(batch, 'DebugEntryCreateBatch') response = self._send(http_method='POST', location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', version='5.0-preview.1', query_parameters=query_parameters, content=content) return self._deserialize('[DebugEntry]', self._unwrap_collection(response)) def delete_requests_request_id(self, request_id, synchronous=None): """DeleteRequestsRequestId. [Preview API] Delete a symbol request by request identifier. :param str request_id: The symbol request identifier. :param bool synchronous: If true, delete all the debug entries under this request synchronously in the current session. If false, the deletion will be postponed to a later point and be executed automatically by the system. """ route_values = {} if request_id is not None: route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') query_parameters = {} if synchronous is not None: query_parameters['synchronous'] = self._serialize.query('synchronous', synchronous, 'bool') self._send(http_method='DELETE', location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) def delete_requests_request_name(self, request_name, synchronous=None): """DeleteRequestsRequestName. [Preview API] Delete a symbol request by request name. :param str request_name: :param bool synchronous: If true, delete all the debug entries under this request synchronously in the current session. If false, the deletion will be postponed to a later point and be executed automatically by the system. """ query_parameters = {} if request_name is not None: query_parameters['requestName'] = self._serialize.query('request_name', request_name, 'str') if synchronous is not None: query_parameters['synchronous'] = self._serialize.query('synchronous', synchronous, 'bool') self._send(http_method='DELETE', location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', version='5.0-preview.1', query_parameters=query_parameters) def get_requests_request_id(self, request_id): """GetRequestsRequestId. [Preview API] Get a symbol request by request identifier. :param str request_id: The symbol request identifier. :rtype: :class:` ` """ route_values = {} if request_id is not None: route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') response = self._send(http_method='GET', location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', version='5.0-preview.1', route_values=route_values) return self._deserialize('Request', response) def get_requests_request_name(self, request_name): """GetRequestsRequestName. [Preview API] Get a symbol request by request name. :param str request_name: :rtype: :class:` ` """ query_parameters = {} if request_name is not None: query_parameters['requestName'] = self._serialize.query('request_name', request_name, 'str') response = self._send(http_method='GET', location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('Request', response) def update_requests_request_id(self, update_request, request_id): """UpdateRequestsRequestId. [Preview API] Update a symbol request by request identifier. :param :class:` ` update_request: The symbol request. :param str request_id: The symbol request identifier. :rtype: :class:` ` """ route_values = {} if request_id is not None: route_values['requestId'] = self._serialize.url('request_id', request_id, 'str') content = self._serialize.body(update_request, 'Request') response = self._send(http_method='PATCH', location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Request', response) def update_requests_request_name(self, update_request, request_name): """UpdateRequestsRequestName. [Preview API] Update a symbol request by request name. :param :class:` ` update_request: The symbol request. :param str request_name: :rtype: :class:` ` """ query_parameters = {} if request_name is not None: query_parameters['requestName'] = self._serialize.query('request_name', request_name, 'str') content = self._serialize.body(update_request, 'Request') response = self._send(http_method='PATCH', location_id='ebc09fe3-1b20-4667-abc5-f2b60fe8de52', version='5.0-preview.1', query_parameters=query_parameters, content=content) return self._deserialize('Request', response) def get_sym_srv_debug_entry_client_key(self, debug_entry_client_key): """GetSymSrvDebugEntryClientKey. [Preview API] Given a client key, returns the best matched debug entry. :param str debug_entry_client_key: A "client key" used by both ends of Microsoft's symbol protocol to identify a debug entry. The semantics of client key is governed by symsrv and is beyond the scope of this documentation. """ route_values = {} if debug_entry_client_key is not None: route_values['debugEntryClientKey'] = self._serialize.url('debug_entry_client_key', debug_entry_client_key, 'str') self._send(http_method='GET', location_id='9648e256-c9f9-4f16-8a27-630b06396942', version='5.0-preview.1', route_values=route_values) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/task/000077500000000000000000000000001360605530400300175ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/task/__init__.py000066400000000000000000000023701360605530400321320ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .task_client import TaskClient __all__ = [ 'Issue', 'JobOption', 'MaskHint', 'PlanEnvironment', 'ProjectReference', 'ReferenceLinks', 'TaskAttachment', 'TaskLog', 'TaskLogReference', 'TaskOrchestrationContainer', 'TaskOrchestrationItem', 'TaskOrchestrationOwner', 'TaskOrchestrationPlan', 'TaskOrchestrationPlanGroupsQueueMetrics', 'TaskOrchestrationPlanReference', 'TaskOrchestrationQueuedPlan', 'TaskOrchestrationQueuedPlanGroup', 'TaskReference', 'Timeline', 'TimelineAttempt', 'TimelineRecord', 'TimelineRecordFeedLinesWrapper', 'TimelineReference', 'VariableValue', 'TaskClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/task/models.py000066400000000000000000000706561360605530400316720ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class Issue(Model): """Issue. :param category: :type category: str :param data: :type data: dict :param message: :type message: str :param type: :type type: object """ _attribute_map = { 'category': {'key': 'category', 'type': 'str'}, 'data': {'key': 'data', 'type': '{str}'}, 'message': {'key': 'message', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, category=None, data=None, message=None, type=None): super(Issue, self).__init__() self.category = category self.data = data self.message = message self.type = type class JobOption(Model): """JobOption. :param data: :type data: dict :param id: Gets the id of the option. :type id: str """ _attribute_map = { 'data': {'key': 'data', 'type': '{str}'}, 'id': {'key': 'id', 'type': 'str'} } def __init__(self, data=None, id=None): super(JobOption, self).__init__() self.data = data self.id = id class MaskHint(Model): """MaskHint. :param type: :type type: object :param value: :type value: str """ _attribute_map = { 'type': {'key': 'type', 'type': 'object'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, type=None, value=None): super(MaskHint, self).__init__() self.type = type self.value = value class PlanEnvironment(Model): """PlanEnvironment. :param mask: :type mask: list of :class:`MaskHint ` :param options: :type options: dict :param variables: :type variables: dict """ _attribute_map = { 'mask': {'key': 'mask', 'type': '[MaskHint]'}, 'options': {'key': 'options', 'type': '{JobOption}'}, 'variables': {'key': 'variables', 'type': '{str}'} } def __init__(self, mask=None, options=None, variables=None): super(PlanEnvironment, self).__init__() self.mask = mask self.options = options self.variables = variables class ProjectReference(Model): """ProjectReference. :param id: :type id: str :param name: :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(ProjectReference, self).__init__() self.id = id self.name = name class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class TaskAttachment(Model): """TaskAttachment. :param _links: :type _links: :class:`ReferenceLinks ` :param created_on: :type created_on: datetime :param last_changed_by: :type last_changed_by: str :param last_changed_on: :type last_changed_on: datetime :param name: :type name: str :param record_id: :type record_id: str :param timeline_id: :type timeline_id: str :param type: :type type: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'last_changed_by': {'key': 'lastChangedBy', 'type': 'str'}, 'last_changed_on': {'key': 'lastChangedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'record_id': {'key': 'recordId', 'type': 'str'}, 'timeline_id': {'key': 'timelineId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, _links=None, created_on=None, last_changed_by=None, last_changed_on=None, name=None, record_id=None, timeline_id=None, type=None): super(TaskAttachment, self).__init__() self._links = _links self.created_on = created_on self.last_changed_by = last_changed_by self.last_changed_on = last_changed_on self.name = name self.record_id = record_id self.timeline_id = timeline_id self.type = type class TaskLogReference(Model): """TaskLogReference. :param id: :type id: int :param location: :type location: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'location': {'key': 'location', 'type': 'str'} } def __init__(self, id=None, location=None): super(TaskLogReference, self).__init__() self.id = id self.location = location class TaskOrchestrationItem(Model): """TaskOrchestrationItem. :param item_type: :type item_type: object """ _attribute_map = { 'item_type': {'key': 'itemType', 'type': 'object'} } def __init__(self, item_type=None): super(TaskOrchestrationItem, self).__init__() self.item_type = item_type class TaskOrchestrationOwner(Model): """TaskOrchestrationOwner. :param _links: :type _links: :class:`ReferenceLinks ` :param id: :type id: int :param name: :type name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, _links=None, id=None, name=None): super(TaskOrchestrationOwner, self).__init__() self._links = _links self.id = id self.name = name class TaskOrchestrationPlanGroupsQueueMetrics(Model): """TaskOrchestrationPlanGroupsQueueMetrics. :param count: :type count: int :param status: :type status: object """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, count=None, status=None): super(TaskOrchestrationPlanGroupsQueueMetrics, self).__init__() self.count = count self.status = status class TaskOrchestrationPlanReference(Model): """TaskOrchestrationPlanReference. :param artifact_location: :type artifact_location: str :param artifact_uri: :type artifact_uri: str :param definition: :type definition: :class:`TaskOrchestrationOwner ` :param owner: :type owner: :class:`TaskOrchestrationOwner ` :param plan_group: :type plan_group: str :param plan_id: :type plan_id: str :param plan_type: :type plan_type: str :param scope_identifier: :type scope_identifier: str :param version: :type version: int """ _attribute_map = { 'artifact_location': {'key': 'artifactLocation', 'type': 'str'}, 'artifact_uri': {'key': 'artifactUri', 'type': 'str'}, 'definition': {'key': 'definition', 'type': 'TaskOrchestrationOwner'}, 'owner': {'key': 'owner', 'type': 'TaskOrchestrationOwner'}, 'plan_group': {'key': 'planGroup', 'type': 'str'}, 'plan_id': {'key': 'planId', 'type': 'str'}, 'plan_type': {'key': 'planType', 'type': 'str'}, 'scope_identifier': {'key': 'scopeIdentifier', 'type': 'str'}, 'version': {'key': 'version', 'type': 'int'} } def __init__(self, artifact_location=None, artifact_uri=None, definition=None, owner=None, plan_group=None, plan_id=None, plan_type=None, scope_identifier=None, version=None): super(TaskOrchestrationPlanReference, self).__init__() self.artifact_location = artifact_location self.artifact_uri = artifact_uri self.definition = definition self.owner = owner self.plan_group = plan_group self.plan_id = plan_id self.plan_type = plan_type self.scope_identifier = scope_identifier self.version = version class TaskOrchestrationQueuedPlan(Model): """TaskOrchestrationQueuedPlan. :param assign_time: :type assign_time: datetime :param definition: :type definition: :class:`TaskOrchestrationOwner ` :param owner: :type owner: :class:`TaskOrchestrationOwner ` :param plan_group: :type plan_group: str :param plan_id: :type plan_id: str :param pool_id: :type pool_id: int :param queue_position: :type queue_position: int :param queue_time: :type queue_time: datetime :param scope_identifier: :type scope_identifier: str """ _attribute_map = { 'assign_time': {'key': 'assignTime', 'type': 'iso-8601'}, 'definition': {'key': 'definition', 'type': 'TaskOrchestrationOwner'}, 'owner': {'key': 'owner', 'type': 'TaskOrchestrationOwner'}, 'plan_group': {'key': 'planGroup', 'type': 'str'}, 'plan_id': {'key': 'planId', 'type': 'str'}, 'pool_id': {'key': 'poolId', 'type': 'int'}, 'queue_position': {'key': 'queuePosition', 'type': 'int'}, 'queue_time': {'key': 'queueTime', 'type': 'iso-8601'}, 'scope_identifier': {'key': 'scopeIdentifier', 'type': 'str'} } def __init__(self, assign_time=None, definition=None, owner=None, plan_group=None, plan_id=None, pool_id=None, queue_position=None, queue_time=None, scope_identifier=None): super(TaskOrchestrationQueuedPlan, self).__init__() self.assign_time = assign_time self.definition = definition self.owner = owner self.plan_group = plan_group self.plan_id = plan_id self.pool_id = pool_id self.queue_position = queue_position self.queue_time = queue_time self.scope_identifier = scope_identifier class TaskOrchestrationQueuedPlanGroup(Model): """TaskOrchestrationQueuedPlanGroup. :param definition: :type definition: :class:`TaskOrchestrationOwner ` :param owner: :type owner: :class:`TaskOrchestrationOwner ` :param plan_group: :type plan_group: str :param plans: :type plans: list of :class:`TaskOrchestrationQueuedPlan ` :param project: :type project: :class:`ProjectReference ` :param queue_position: :type queue_position: int """ _attribute_map = { 'definition': {'key': 'definition', 'type': 'TaskOrchestrationOwner'}, 'owner': {'key': 'owner', 'type': 'TaskOrchestrationOwner'}, 'plan_group': {'key': 'planGroup', 'type': 'str'}, 'plans': {'key': 'plans', 'type': '[TaskOrchestrationQueuedPlan]'}, 'project': {'key': 'project', 'type': 'ProjectReference'}, 'queue_position': {'key': 'queuePosition', 'type': 'int'} } def __init__(self, definition=None, owner=None, plan_group=None, plans=None, project=None, queue_position=None): super(TaskOrchestrationQueuedPlanGroup, self).__init__() self.definition = definition self.owner = owner self.plan_group = plan_group self.plans = plans self.project = project self.queue_position = queue_position class TaskReference(Model): """TaskReference. :param id: :type id: str :param inputs: :type inputs: dict :param name: :type name: str :param version: :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'inputs': {'key': 'inputs', 'type': '{str}'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, inputs=None, name=None, version=None): super(TaskReference, self).__init__() self.id = id self.inputs = inputs self.name = name self.version = version class TimelineAttempt(Model): """TimelineAttempt. :param attempt: Gets or sets the attempt of the record. :type attempt: int :param identifier: Gets or sets the unique identifier for the record. :type identifier: str :param record_id: Gets or sets the record identifier located within the specified timeline. :type record_id: str :param timeline_id: Gets or sets the timeline identifier which owns the record representing this attempt. :type timeline_id: str """ _attribute_map = { 'attempt': {'key': 'attempt', 'type': 'int'}, 'identifier': {'key': 'identifier', 'type': 'str'}, 'record_id': {'key': 'recordId', 'type': 'str'}, 'timeline_id': {'key': 'timelineId', 'type': 'str'} } def __init__(self, attempt=None, identifier=None, record_id=None, timeline_id=None): super(TimelineAttempt, self).__init__() self.attempt = attempt self.identifier = identifier self.record_id = record_id self.timeline_id = timeline_id class TimelineRecord(Model): """TimelineRecord. :param attempt: :type attempt: int :param change_id: :type change_id: int :param current_operation: :type current_operation: str :param details: :type details: :class:`TimelineReference ` :param error_count: :type error_count: int :param finish_time: :type finish_time: datetime :param id: :type id: str :param identifier: :type identifier: str :param issues: :type issues: list of :class:`Issue ` :param last_modified: :type last_modified: datetime :param location: :type location: str :param log: :type log: :class:`TaskLogReference ` :param name: :type name: str :param order: :type order: int :param parent_id: :type parent_id: str :param percent_complete: :type percent_complete: int :param previous_attempts: :type previous_attempts: list of :class:`TimelineAttempt ` :param ref_name: :type ref_name: str :param result: :type result: object :param result_code: :type result_code: str :param start_time: :type start_time: datetime :param state: :type state: object :param task: :type task: :class:`TaskReference ` :param type: :type type: str :param variables: :type variables: dict :param warning_count: :type warning_count: int :param worker_name: :type worker_name: str """ _attribute_map = { 'attempt': {'key': 'attempt', 'type': 'int'}, 'change_id': {'key': 'changeId', 'type': 'int'}, 'current_operation': {'key': 'currentOperation', 'type': 'str'}, 'details': {'key': 'details', 'type': 'TimelineReference'}, 'error_count': {'key': 'errorCount', 'type': 'int'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'identifier': {'key': 'identifier', 'type': 'str'}, 'issues': {'key': 'issues', 'type': '[Issue]'}, 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, 'location': {'key': 'location', 'type': 'str'}, 'log': {'key': 'log', 'type': 'TaskLogReference'}, 'name': {'key': 'name', 'type': 'str'}, 'order': {'key': 'order', 'type': 'int'}, 'parent_id': {'key': 'parentId', 'type': 'str'}, 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, 'previous_attempts': {'key': 'previousAttempts', 'type': '[TimelineAttempt]'}, 'ref_name': {'key': 'refName', 'type': 'str'}, 'result': {'key': 'result', 'type': 'object'}, 'result_code': {'key': 'resultCode', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'state': {'key': 'state', 'type': 'object'}, 'task': {'key': 'task', 'type': 'TaskReference'}, 'type': {'key': 'type', 'type': 'str'}, 'variables': {'key': 'variables', 'type': '{VariableValue}'}, 'warning_count': {'key': 'warningCount', 'type': 'int'}, 'worker_name': {'key': 'workerName', 'type': 'str'} } def __init__(self, attempt=None, change_id=None, current_operation=None, details=None, error_count=None, finish_time=None, id=None, identifier=None, issues=None, last_modified=None, location=None, log=None, name=None, order=None, parent_id=None, percent_complete=None, previous_attempts=None, ref_name=None, result=None, result_code=None, start_time=None, state=None, task=None, type=None, variables=None, warning_count=None, worker_name=None): super(TimelineRecord, self).__init__() self.attempt = attempt self.change_id = change_id self.current_operation = current_operation self.details = details self.error_count = error_count self.finish_time = finish_time self.id = id self.identifier = identifier self.issues = issues self.last_modified = last_modified self.location = location self.log = log self.name = name self.order = order self.parent_id = parent_id self.percent_complete = percent_complete self.previous_attempts = previous_attempts self.ref_name = ref_name self.result = result self.result_code = result_code self.start_time = start_time self.state = state self.task = task self.type = type self.variables = variables self.warning_count = warning_count self.worker_name = worker_name class TimelineRecordFeedLinesWrapper(Model): """TimelineRecordFeedLinesWrapper. :param count: :type count: int :param step_id: :type step_id: str :param value: :type value: list of str """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'step_id': {'key': 'stepId', 'type': 'str'}, 'value': {'key': 'value', 'type': '[str]'} } def __init__(self, count=None, step_id=None, value=None): super(TimelineRecordFeedLinesWrapper, self).__init__() self.count = count self.step_id = step_id self.value = value class TimelineReference(Model): """TimelineReference. :param change_id: :type change_id: int :param id: :type id: str :param location: :type location: str """ _attribute_map = { 'change_id': {'key': 'changeId', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'} } def __init__(self, change_id=None, id=None, location=None): super(TimelineReference, self).__init__() self.change_id = change_id self.id = id self.location = location class VariableValue(Model): """VariableValue. :param is_secret: :type is_secret: bool :param value: :type value: str """ _attribute_map = { 'is_secret': {'key': 'isSecret', 'type': 'bool'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, is_secret=None, value=None): super(VariableValue, self).__init__() self.is_secret = is_secret self.value = value class TaskLog(TaskLogReference): """TaskLog. :param id: :type id: int :param location: :type location: str :param created_on: :type created_on: datetime :param index_location: :type index_location: str :param last_changed_on: :type last_changed_on: datetime :param line_count: :type line_count: long :param path: :type path: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'location': {'key': 'location', 'type': 'str'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'index_location': {'key': 'indexLocation', 'type': 'str'}, 'last_changed_on': {'key': 'lastChangedOn', 'type': 'iso-8601'}, 'line_count': {'key': 'lineCount', 'type': 'long'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, id=None, location=None, created_on=None, index_location=None, last_changed_on=None, line_count=None, path=None): super(TaskLog, self).__init__(id=id, location=location) self.created_on = created_on self.index_location = index_location self.last_changed_on = last_changed_on self.line_count = line_count self.path = path class TaskOrchestrationContainer(TaskOrchestrationItem): """TaskOrchestrationContainer. :param item_type: :type item_type: object :param children: :type children: list of :class:`TaskOrchestrationItem ` :param continue_on_error: :type continue_on_error: bool :param data: :type data: dict :param max_concurrency: :type max_concurrency: int :param parallel: :type parallel: bool :param rollback: :type rollback: :class:`TaskOrchestrationContainer ` """ _attribute_map = { 'item_type': {'key': 'itemType', 'type': 'object'}, 'children': {'key': 'children', 'type': '[TaskOrchestrationItem]'}, 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, 'data': {'key': 'data', 'type': '{str}'}, 'max_concurrency': {'key': 'maxConcurrency', 'type': 'int'}, 'parallel': {'key': 'parallel', 'type': 'bool'}, 'rollback': {'key': 'rollback', 'type': 'TaskOrchestrationContainer'} } def __init__(self, item_type=None, children=None, continue_on_error=None, data=None, max_concurrency=None, parallel=None, rollback=None): super(TaskOrchestrationContainer, self).__init__(item_type=item_type) self.children = children self.continue_on_error = continue_on_error self.data = data self.max_concurrency = max_concurrency self.parallel = parallel self.rollback = rollback class TaskOrchestrationPlan(TaskOrchestrationPlanReference): """TaskOrchestrationPlan. :param artifact_location: :type artifact_location: str :param artifact_uri: :type artifact_uri: str :param definition: :type definition: :class:`TaskOrchestrationOwner ` :param owner: :type owner: :class:`TaskOrchestrationOwner ` :param plan_group: :type plan_group: str :param plan_id: :type plan_id: str :param plan_type: :type plan_type: str :param scope_identifier: :type scope_identifier: str :param version: :type version: int :param environment: :type environment: :class:`PlanEnvironment ` :param finish_time: :type finish_time: datetime :param implementation: :type implementation: :class:`TaskOrchestrationContainer ` :param initialization_log: :type initialization_log: :class:`TaskLogReference ` :param requested_by_id: :type requested_by_id: str :param requested_for_id: :type requested_for_id: str :param result: :type result: object :param result_code: :type result_code: str :param start_time: :type start_time: datetime :param state: :type state: object :param timeline: :type timeline: :class:`TimelineReference ` """ _attribute_map = { 'artifact_location': {'key': 'artifactLocation', 'type': 'str'}, 'artifact_uri': {'key': 'artifactUri', 'type': 'str'}, 'definition': {'key': 'definition', 'type': 'TaskOrchestrationOwner'}, 'owner': {'key': 'owner', 'type': 'TaskOrchestrationOwner'}, 'plan_group': {'key': 'planGroup', 'type': 'str'}, 'plan_id': {'key': 'planId', 'type': 'str'}, 'plan_type': {'key': 'planType', 'type': 'str'}, 'scope_identifier': {'key': 'scopeIdentifier', 'type': 'str'}, 'version': {'key': 'version', 'type': 'int'}, 'environment': {'key': 'environment', 'type': 'PlanEnvironment'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'implementation': {'key': 'implementation', 'type': 'TaskOrchestrationContainer'}, 'initialization_log': {'key': 'initializationLog', 'type': 'TaskLogReference'}, 'requested_by_id': {'key': 'requestedById', 'type': 'str'}, 'requested_for_id': {'key': 'requestedForId', 'type': 'str'}, 'result': {'key': 'result', 'type': 'object'}, 'result_code': {'key': 'resultCode', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'state': {'key': 'state', 'type': 'object'}, 'timeline': {'key': 'timeline', 'type': 'TimelineReference'} } def __init__(self, artifact_location=None, artifact_uri=None, definition=None, owner=None, plan_group=None, plan_id=None, plan_type=None, scope_identifier=None, version=None, environment=None, finish_time=None, implementation=None, initialization_log=None, requested_by_id=None, requested_for_id=None, result=None, result_code=None, start_time=None, state=None, timeline=None): super(TaskOrchestrationPlan, self).__init__(artifact_location=artifact_location, artifact_uri=artifact_uri, definition=definition, owner=owner, plan_group=plan_group, plan_id=plan_id, plan_type=plan_type, scope_identifier=scope_identifier, version=version) self.environment = environment self.finish_time = finish_time self.implementation = implementation self.initialization_log = initialization_log self.requested_by_id = requested_by_id self.requested_for_id = requested_for_id self.result = result self.result_code = result_code self.start_time = start_time self.state = state self.timeline = timeline class Timeline(TimelineReference): """Timeline. :param change_id: :type change_id: int :param id: :type id: str :param location: :type location: str :param last_changed_by: :type last_changed_by: str :param last_changed_on: :type last_changed_on: datetime :param records: :type records: list of :class:`TimelineRecord ` """ _attribute_map = { 'change_id': {'key': 'changeId', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'last_changed_by': {'key': 'lastChangedBy', 'type': 'str'}, 'last_changed_on': {'key': 'lastChangedOn', 'type': 'iso-8601'}, 'records': {'key': 'records', 'type': '[TimelineRecord]'} } def __init__(self, change_id=None, id=None, location=None, last_changed_by=None, last_changed_on=None, records=None): super(Timeline, self).__init__(change_id=change_id, id=id, location=location) self.last_changed_by = last_changed_by self.last_changed_on = last_changed_on self.records = records __all__ = [ 'Issue', 'JobOption', 'MaskHint', 'PlanEnvironment', 'ProjectReference', 'ReferenceLinks', 'TaskAttachment', 'TaskLogReference', 'TaskOrchestrationItem', 'TaskOrchestrationOwner', 'TaskOrchestrationPlanGroupsQueueMetrics', 'TaskOrchestrationPlanReference', 'TaskOrchestrationQueuedPlan', 'TaskOrchestrationQueuedPlanGroup', 'TaskReference', 'TimelineAttempt', 'TimelineRecord', 'TimelineRecordFeedLinesWrapper', 'TimelineReference', 'VariableValue', 'TaskLog', 'TaskOrchestrationContainer', 'TaskOrchestrationPlan', 'Timeline', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/task/task_client.py000066400000000000000000000567401360605530400327050ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class TaskClient(Client): """Task :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TaskClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_plan_attachments(self, scope_identifier, hub_name, plan_id, type): """GetPlanAttachments. [Preview API] :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str type: :rtype: [TaskAttachment] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='eb55e5d6-2f30-4295-b5ed-38da50b1fc52', version='5.0-preview.1', route_values=route_values) return self._deserialize('[TaskAttachment]', self._unwrap_collection(response)) def create_attachment(self, upload_stream, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name, **kwargs): """CreateAttachment. [Preview API] :param object upload_stream: Stream to upload :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :param str record_id: :param str type: :param str name: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') if record_id is not None: route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='7898f959-9cdf-4096-b29e-7f293031629e', version='5.0-preview.1', route_values=route_values, content=content, media_type='application/octet-stream') return self._deserialize('TaskAttachment', response) def get_attachment(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name): """GetAttachment. [Preview API] :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :param str record_id: :param str type: :param str name: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') if record_id is not None: route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='7898f959-9cdf-4096-b29e-7f293031629e', version='5.0-preview.1', route_values=route_values) return self._deserialize('TaskAttachment', response) def get_attachment_content(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type, name, **kwargs): """GetAttachmentContent. [Preview API] :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :param str record_id: :param str type: :param str name: :rtype: object """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') if record_id is not None: route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='7898f959-9cdf-4096-b29e-7f293031629e', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_attachments(self, scope_identifier, hub_name, plan_id, timeline_id, record_id, type): """GetAttachments. [Preview API] :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :param str record_id: :param str type: :rtype: [TaskAttachment] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') if record_id is not None: route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='7898f959-9cdf-4096-b29e-7f293031629e', version='5.0-preview.1', route_values=route_values) return self._deserialize('[TaskAttachment]', self._unwrap_collection(response)) def append_log_content(self, upload_stream, scope_identifier, hub_name, plan_id, log_id, **kwargs): """AppendLogContent. :param object upload_stream: Stream to upload :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param int log_id: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', version='5.0', route_values=route_values, content=content, media_type='application/octet-stream') return self._deserialize('TaskLog', response) def create_log(self, log, scope_identifier, hub_name, plan_id): """CreateLog. :param :class:` ` log: :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') content = self._serialize.body(log, 'TaskLog') response = self._send(http_method='POST', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', version='5.0', route_values=route_values, content=content) return self._deserialize('TaskLog', response) def get_log(self, scope_identifier, hub_name, plan_id, log_id, start_line=None, end_line=None): """GetLog. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param int log_id: :param long start_line: :param long end_line: :rtype: [str] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def get_logs(self, scope_identifier, hub_name, plan_id): """GetLogs. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :rtype: [TaskLog] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='46f5667d-263a-4684-91b1-dff7fdcf64e2', version='5.0', route_values=route_values) return self._deserialize('[TaskLog]', self._unwrap_collection(response)) def get_records(self, scope_identifier, hub_name, plan_id, timeline_id, change_id=None): """GetRecords. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :param int change_id: :rtype: [TimelineRecord] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') query_parameters = {} if change_id is not None: query_parameters['changeId'] = self._serialize.query('change_id', change_id, 'int') response = self._send(http_method='GET', location_id='8893bc5b-35b2-4be7-83cb-99e683551db4', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TimelineRecord]', self._unwrap_collection(response)) def update_records(self, records, scope_identifier, hub_name, plan_id, timeline_id): """UpdateRecords. :param :class:` ` records: :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :rtype: [TimelineRecord] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') content = self._serialize.body(records, 'VssJsonCollectionWrapper') response = self._send(http_method='PATCH', location_id='8893bc5b-35b2-4be7-83cb-99e683551db4', version='5.0', route_values=route_values, content=content) return self._deserialize('[TimelineRecord]', self._unwrap_collection(response)) def create_timeline(self, timeline, scope_identifier, hub_name, plan_id): """CreateTimeline. :param :class:` ` timeline: :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') content = self._serialize.body(timeline, 'Timeline') response = self._send(http_method='POST', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', version='5.0', route_values=route_values, content=content) return self._deserialize('Timeline', response) def delete_timeline(self, scope_identifier, hub_name, plan_id, timeline_id): """DeleteTimeline. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') self._send(http_method='DELETE', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', version='5.0', route_values=route_values) def get_timeline(self, scope_identifier, hub_name, plan_id, timeline_id, change_id=None, include_records=None): """GetTimeline. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :param str timeline_id: :param int change_id: :param bool include_records: :rtype: :class:` ` """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') query_parameters = {} if change_id is not None: query_parameters['changeId'] = self._serialize.query('change_id', change_id, 'int') if include_records is not None: query_parameters['includeRecords'] = self._serialize.query('include_records', include_records, 'bool') response = self._send(http_method='GET', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Timeline', response) def get_timelines(self, scope_identifier, hub_name, plan_id): """GetTimelines. :param str scope_identifier: The project GUID to scope the request :param str hub_name: The name of the server hub: "build" for the Build server or "rm" for the Release Management server :param str plan_id: :rtype: [Timeline] """ route_values = {} if scope_identifier is not None: route_values['scopeIdentifier'] = self._serialize.url('scope_identifier', scope_identifier, 'str') if hub_name is not None: route_values['hubName'] = self._serialize.url('hub_name', hub_name, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='83597576-cc2c-453c-bea6-2882ae6a1653', version='5.0', route_values=route_values) return self._deserialize('[Timeline]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/task_agent/000077500000000000000000000000001360605530400311755ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/task_agent/__init__.py000066400000000000000000000075601360605530400333160ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .task_agent_client import TaskAgentClient __all__ = [ 'AadOauthTokenRequest', 'AadOauthTokenResult', 'AuthenticationSchemeReference', 'AuthorizationHeader', 'AzureManagementGroup', 'AzureManagementGroupQueryResult', 'AzureSubscription', 'AzureSubscriptionQueryResult', 'ClientCertificate', 'DataSource', 'DataSourceBinding', 'DataSourceBindingBase', 'DataSourceDetails', 'DependencyBinding', 'DependencyData', 'DependsOn', 'DeploymentGroup', 'DeploymentGroupCreateParameter', 'DeploymentGroupCreateParameterPoolProperty', 'DeploymentGroupMetrics', 'DeploymentGroupReference', 'DeploymentGroupUpdateParameter', 'DeploymentMachine', 'DeploymentMachineGroup', 'DeploymentMachineGroupReference', 'DeploymentPoolSummary', 'DeploymentTargetUpdateParameter', 'EndpointAuthorization', 'EndpointUrl', 'Environment', 'EnvironmentCreateParameter', 'EnvironmentReference', 'EnvironmentUpdateParameter', 'GraphSubjectBase', 'HelpLink', 'IdentityRef', 'InputDescriptor', 'InputValidation', 'InputValidationRequest', 'InputValue', 'InputValues', 'InputValuesError', 'KubernetesServiceGroup', 'KubernetesServiceGroupCreateParameters', 'MarketplacePurchasedLicense', 'MetricsColumnMetaData', 'MetricsColumnsHeader', 'MetricsRow', 'PackageMetadata', 'PackageVersion', 'ProjectReference', 'PublishTaskGroupMetadata', 'ReferenceLinks', 'ResourceLimit', 'ResourceUsage', 'ResultTransformationDetails', 'SecureFile', 'ServiceEndpoint', 'ServiceEndpointAuthenticationScheme', 'ServiceEndpointDetails', 'ServiceEndpointExecutionData', 'ServiceEndpointExecutionRecord', 'ServiceEndpointExecutionRecordsInput', 'ServiceEndpointRequest', 'ServiceEndpointRequestResult', 'ServiceEndpointType', 'ServiceGroup', 'ServiceGroupReference', 'TaskAgent', 'TaskAgentAuthorization', 'TaskAgentCloud', 'TaskAgentCloudRequest', 'TaskAgentCloudType', 'TaskAgentDelaySource', 'TaskAgentJobRequest', 'TaskAgentMessage', 'TaskAgentPool', 'TaskAgentPoolMaintenanceDefinition', 'TaskAgentPoolMaintenanceJob', 'TaskAgentPoolMaintenanceJobTargetAgent', 'TaskAgentPoolMaintenanceOptions', 'TaskAgentPoolMaintenanceRetentionPolicy', 'TaskAgentPoolMaintenanceSchedule', 'TaskAgentPoolReference', 'TaskAgentPublicKey', 'TaskAgentQueue', 'TaskAgentReference', 'TaskAgentSession', 'TaskAgentSessionKey', 'TaskAgentUpdate', 'TaskAgentUpdateReason', 'TaskDefinition', 'TaskDefinitionEndpoint', 'TaskDefinitionReference', 'TaskExecution', 'TaskGroup', 'TaskGroupCreateParameter', 'TaskGroupDefinition', 'TaskGroupRevision', 'TaskGroupStep', 'TaskGroupUpdateParameter', 'TaskHubLicenseDetails', 'TaskInputDefinition', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskOrchestrationOwner', 'TaskOutputVariable', 'TaskPackageMetadata', 'TaskReference', 'TaskSourceDefinition', 'TaskSourceDefinitionBase', 'TaskVersion', 'ValidationItem', 'VariableGroup', 'VariableGroupParameters', 'VariableGroupProviderData', 'VariableValue', 'TaskAgentClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/task_agent/models.py000066400000000000000000005263751360605530400330540ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AadOauthTokenRequest(Model): """AadOauthTokenRequest. :param refresh: :type refresh: bool :param resource: :type resource: str :param tenant_id: :type tenant_id: str :param token: :type token: str """ _attribute_map = { 'refresh': {'key': 'refresh', 'type': 'bool'}, 'resource': {'key': 'resource', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'}, 'token': {'key': 'token', 'type': 'str'} } def __init__(self, refresh=None, resource=None, tenant_id=None, token=None): super(AadOauthTokenRequest, self).__init__() self.refresh = refresh self.resource = resource self.tenant_id = tenant_id self.token = token class AadOauthTokenResult(Model): """AadOauthTokenResult. :param access_token: :type access_token: str :param refresh_token_cache: :type refresh_token_cache: str """ _attribute_map = { 'access_token': {'key': 'accessToken', 'type': 'str'}, 'refresh_token_cache': {'key': 'refreshTokenCache', 'type': 'str'} } def __init__(self, access_token=None, refresh_token_cache=None): super(AadOauthTokenResult, self).__init__() self.access_token = access_token self.refresh_token_cache = refresh_token_cache class AuthenticationSchemeReference(Model): """AuthenticationSchemeReference. :param inputs: :type inputs: dict :param type: :type type: str """ _attribute_map = { 'inputs': {'key': 'inputs', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, inputs=None, type=None): super(AuthenticationSchemeReference, self).__init__() self.inputs = inputs self.type = type class AuthorizationHeader(Model): """AuthorizationHeader. :param name: Gets or sets the name of authorization header. :type name: str :param value: Gets or sets the value of authorization header. :type value: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, name=None, value=None): super(AuthorizationHeader, self).__init__() self.name = name self.value = value class AzureManagementGroup(Model): """AzureManagementGroup. :param display_name: Display name of azure management group :type display_name: str :param id: Id of azure management group :type id: str :param name: Azure management group name :type name: str :param tenant_id: Id of tenant from which azure management group belogs :type tenant_id: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'tenant_id': {'key': 'tenantId', 'type': 'str'} } def __init__(self, display_name=None, id=None, name=None, tenant_id=None): super(AzureManagementGroup, self).__init__() self.display_name = display_name self.id = id self.name = name self.tenant_id = tenant_id class AzureManagementGroupQueryResult(Model): """AzureManagementGroupQueryResult. :param error_message: Error message in case of an exception :type error_message: str :param value: List of azure management groups :type value: list of :class:`AzureManagementGroup ` """ _attribute_map = { 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'value': {'key': 'value', 'type': '[AzureManagementGroup]'} } def __init__(self, error_message=None, value=None): super(AzureManagementGroupQueryResult, self).__init__() self.error_message = error_message self.value = value class AzureSubscription(Model): """AzureSubscription. :param display_name: :type display_name: str :param subscription_id: :type subscription_id: str :param subscription_tenant_id: :type subscription_tenant_id: str :param subscription_tenant_name: :type subscription_tenant_name: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'subscription_id': {'key': 'subscriptionId', 'type': 'str'}, 'subscription_tenant_id': {'key': 'subscriptionTenantId', 'type': 'str'}, 'subscription_tenant_name': {'key': 'subscriptionTenantName', 'type': 'str'} } def __init__(self, display_name=None, subscription_id=None, subscription_tenant_id=None, subscription_tenant_name=None): super(AzureSubscription, self).__init__() self.display_name = display_name self.subscription_id = subscription_id self.subscription_tenant_id = subscription_tenant_id self.subscription_tenant_name = subscription_tenant_name class AzureSubscriptionQueryResult(Model): """AzureSubscriptionQueryResult. :param error_message: :type error_message: str :param value: :type value: list of :class:`AzureSubscription ` """ _attribute_map = { 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'value': {'key': 'value', 'type': '[AzureSubscription]'} } def __init__(self, error_message=None, value=None): super(AzureSubscriptionQueryResult, self).__init__() self.error_message = error_message self.value = value class ClientCertificate(Model): """ClientCertificate. :param value: Gets or sets the value of client certificate. :type value: str """ _attribute_map = { 'value': {'key': 'value', 'type': 'str'} } def __init__(self, value=None): super(ClientCertificate, self).__init__() self.value = value class DataSource(Model): """DataSource. :param authentication_scheme: :type authentication_scheme: :class:`AuthenticationSchemeReference ` :param endpoint_url: :type endpoint_url: str :param headers: :type headers: list of :class:`AuthorizationHeader ` :param name: :type name: str :param resource_url: :type resource_url: str :param result_selector: :type result_selector: str """ _attribute_map = { 'authentication_scheme': {'key': 'authenticationScheme', 'type': 'AuthenticationSchemeReference'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'name': {'key': 'name', 'type': 'str'}, 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'} } def __init__(self, authentication_scheme=None, endpoint_url=None, headers=None, name=None, resource_url=None, result_selector=None): super(DataSource, self).__init__() self.authentication_scheme = authentication_scheme self.endpoint_url = endpoint_url self.headers = headers self.name = name self.resource_url = resource_url self.result_selector = result_selector class DataSourceBindingBase(Model): """DataSourceBindingBase. :param callback_context_template: Pagination format supported by this data source(ContinuationToken/SkipTop). :type callback_context_template: str :param callback_required_template: Subsequent calls needed? :type callback_required_template: str :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: Defines the initial value of the query params :type initial_context_template: str :param parameters: Gets or sets the parameters for the data source. :type parameters: dict :param result_selector: Gets or sets the result selector. :type result_selector: str :param result_template: Gets or sets the result template. :type result_template: str :param target: Gets or sets the target of the data source. :type target: str """ _attribute_map = { 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'}, 'result_template': {'key': 'resultTemplate', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, callback_context_template=None, callback_required_template=None, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, initial_context_template=None, parameters=None, result_selector=None, result_template=None, target=None): super(DataSourceBindingBase, self).__init__() self.callback_context_template = callback_context_template self.callback_required_template = callback_required_template self.data_source_name = data_source_name self.endpoint_id = endpoint_id self.endpoint_url = endpoint_url self.headers = headers self.initial_context_template = initial_context_template self.parameters = parameters self.result_selector = result_selector self.result_template = result_template self.target = target class DataSourceDetails(Model): """DataSourceDetails. :param data_source_name: :type data_source_name: str :param data_source_url: :type data_source_url: str :param headers: :type headers: list of :class:`AuthorizationHeader ` :param parameters: :type parameters: dict :param resource_url: :type resource_url: str :param result_selector: :type result_selector: str """ _attribute_map = { 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'data_source_url': {'key': 'dataSourceUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'resource_url': {'key': 'resourceUrl', 'type': 'str'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'} } def __init__(self, data_source_name=None, data_source_url=None, headers=None, parameters=None, resource_url=None, result_selector=None): super(DataSourceDetails, self).__init__() self.data_source_name = data_source_name self.data_source_url = data_source_url self.headers = headers self.parameters = parameters self.resource_url = resource_url self.result_selector = result_selector class DependencyBinding(Model): """DependencyBinding. :param key: :type key: str :param value: :type value: str """ _attribute_map = { 'key': {'key': 'key', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, key=None, value=None): super(DependencyBinding, self).__init__() self.key = key self.value = value class DependencyData(Model): """DependencyData. :param input: :type input: str :param map: :type map: list of { key: str; value: [{ key: str; value: str }] } """ _attribute_map = { 'input': {'key': 'input', 'type': 'str'}, 'map': {'key': 'map', 'type': '[{ key: str; value: [{ key: str; value: str }] }]'} } def __init__(self, input=None, map=None): super(DependencyData, self).__init__() self.input = input self.map = map class DependsOn(Model): """DependsOn. :param input: :type input: str :param map: :type map: list of :class:`DependencyBinding ` """ _attribute_map = { 'input': {'key': 'input', 'type': 'str'}, 'map': {'key': 'map', 'type': '[DependencyBinding]'} } def __init__(self, input=None, map=None): super(DependsOn, self).__init__() self.input = input self.map = map class DeploymentGroupCreateParameter(Model): """DeploymentGroupCreateParameter. :param description: Description of the deployment group. :type description: str :param name: Name of the deployment group. :type name: str :param pool: Deployment pool in which deployment agents are registered. This is obsolete. Kept for compatibility. Will be marked obsolete explicitly by M132. :type pool: :class:`DeploymentGroupCreateParameterPoolProperty ` :param pool_id: Identifier of the deployment pool in which deployment agents are registered. :type pool_id: int """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'pool': {'key': 'pool', 'type': 'DeploymentGroupCreateParameterPoolProperty'}, 'pool_id': {'key': 'poolId', 'type': 'int'} } def __init__(self, description=None, name=None, pool=None, pool_id=None): super(DeploymentGroupCreateParameter, self).__init__() self.description = description self.name = name self.pool = pool self.pool_id = pool_id class DeploymentGroupCreateParameterPoolProperty(Model): """DeploymentGroupCreateParameterPoolProperty. :param id: Deployment pool identifier. :type id: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'} } def __init__(self, id=None): super(DeploymentGroupCreateParameterPoolProperty, self).__init__() self.id = id class DeploymentGroupMetrics(Model): """DeploymentGroupMetrics. :param columns_header: List of deployment group properties. And types of metrics provided for those properties. :type columns_header: :class:`MetricsColumnsHeader ` :param deployment_group: Deployment group. :type deployment_group: :class:`DeploymentGroupReference ` :param rows: Values of properties and the metrics. E.g. 1: total count of deployment targets for which 'TargetState' is 'offline'. E.g. 2: Average time of deployment to the deployment targets for which 'LastJobStatus' is 'passed' and 'TargetState' is 'online'. :type rows: list of :class:`MetricsRow ` """ _attribute_map = { 'columns_header': {'key': 'columnsHeader', 'type': 'MetricsColumnsHeader'}, 'deployment_group': {'key': 'deploymentGroup', 'type': 'DeploymentGroupReference'}, 'rows': {'key': 'rows', 'type': '[MetricsRow]'} } def __init__(self, columns_header=None, deployment_group=None, rows=None): super(DeploymentGroupMetrics, self).__init__() self.columns_header = columns_header self.deployment_group = deployment_group self.rows = rows class DeploymentGroupReference(Model): """DeploymentGroupReference. :param id: Deployment group identifier. :type id: int :param name: Name of the deployment group. :type name: str :param pool: Deployment pool in which deployment agents are registered. :type pool: :class:`TaskAgentPoolReference ` :param project: Project to which the deployment group belongs. :type project: :class:`ProjectReference ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'project': {'key': 'project', 'type': 'ProjectReference'} } def __init__(self, id=None, name=None, pool=None, project=None): super(DeploymentGroupReference, self).__init__() self.id = id self.name = name self.pool = pool self.project = project class DeploymentGroupUpdateParameter(Model): """DeploymentGroupUpdateParameter. :param description: Description of the deployment group. :type description: str :param name: Name of the deployment group. :type name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, description=None, name=None): super(DeploymentGroupUpdateParameter, self).__init__() self.description = description self.name = name class DeploymentMachine(Model): """DeploymentMachine. :param agent: Deployment agent. :type agent: :class:`TaskAgent ` :param id: Deployment target Identifier. :type id: int :param tags: Tags of the deployment target. :type tags: list of str """ _attribute_map = { 'agent': {'key': 'agent', 'type': 'TaskAgent'}, 'id': {'key': 'id', 'type': 'int'}, 'tags': {'key': 'tags', 'type': '[str]'} } def __init__(self, agent=None, id=None, tags=None): super(DeploymentMachine, self).__init__() self.agent = agent self.id = id self.tags = tags class DeploymentMachineGroupReference(Model): """DeploymentMachineGroupReference. :param id: :type id: int :param name: :type name: str :param pool: :type pool: :class:`TaskAgentPoolReference ` :param project: :type project: :class:`ProjectReference ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'project': {'key': 'project', 'type': 'ProjectReference'} } def __init__(self, id=None, name=None, pool=None, project=None): super(DeploymentMachineGroupReference, self).__init__() self.id = id self.name = name self.pool = pool self.project = project class DeploymentPoolSummary(Model): """DeploymentPoolSummary. :param deployment_groups: List of deployment groups referring to the deployment pool. :type deployment_groups: list of :class:`DeploymentGroupReference ` :param offline_agents_count: Number of deployment agents that are offline. :type offline_agents_count: int :param online_agents_count: Number of deployment agents that are online. :type online_agents_count: int :param pool: Deployment pool. :type pool: :class:`TaskAgentPoolReference ` """ _attribute_map = { 'deployment_groups': {'key': 'deploymentGroups', 'type': '[DeploymentGroupReference]'}, 'offline_agents_count': {'key': 'offlineAgentsCount', 'type': 'int'}, 'online_agents_count': {'key': 'onlineAgentsCount', 'type': 'int'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'} } def __init__(self, deployment_groups=None, offline_agents_count=None, online_agents_count=None, pool=None): super(DeploymentPoolSummary, self).__init__() self.deployment_groups = deployment_groups self.offline_agents_count = offline_agents_count self.online_agents_count = online_agents_count self.pool = pool class DeploymentTargetUpdateParameter(Model): """DeploymentTargetUpdateParameter. :param id: Identifier of the deployment target. :type id: int :param tags: :type tags: list of str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'tags': {'key': 'tags', 'type': '[str]'} } def __init__(self, id=None, tags=None): super(DeploymentTargetUpdateParameter, self).__init__() self.id = id self.tags = tags class EndpointAuthorization(Model): """EndpointAuthorization. :param parameters: Gets or sets the parameters for the selected authorization scheme. :type parameters: dict :param scheme: Gets or sets the scheme used for service endpoint authentication. :type scheme: str """ _attribute_map = { 'parameters': {'key': 'parameters', 'type': '{str}'}, 'scheme': {'key': 'scheme', 'type': 'str'} } def __init__(self, parameters=None, scheme=None): super(EndpointAuthorization, self).__init__() self.parameters = parameters self.scheme = scheme class EndpointUrl(Model): """EndpointUrl. :param depends_on: Gets or sets the dependency bindings. :type depends_on: :class:`DependsOn ` :param display_name: Gets or sets the display name of service endpoint url. :type display_name: str :param help_text: Gets or sets the help text of service endpoint url. :type help_text: str :param is_visible: Gets or sets the visibility of service endpoint url. :type is_visible: str :param value: Gets or sets the value of service endpoint url. :type value: str """ _attribute_map = { 'depends_on': {'key': 'dependsOn', 'type': 'DependsOn'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'help_text': {'key': 'helpText', 'type': 'str'}, 'is_visible': {'key': 'isVisible', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, depends_on=None, display_name=None, help_text=None, is_visible=None, value=None): super(EndpointUrl, self).__init__() self.depends_on = depends_on self.display_name = display_name self.help_text = help_text self.is_visible = is_visible self.value = value class Environment(Model): """Environment. :param created_by: Identity reference of the user who created the Environment. :type created_by: :class:`IdentityRef ` :param created_on: Creation time of the Environment :type created_on: datetime :param description: Description of the Environment. :type description: str :param id: Id of the Environment :type id: int :param last_modified_by: Identity reference of the user who last modified the Environment. :type last_modified_by: :class:`IdentityRef ` :param last_modified_on: Last modified time of the Environment :type last_modified_on: datetime :param name: Name of the Environment. :type name: str :param service_groups: :type service_groups: list of :class:`ServiceGroupReference ` """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'service_groups': {'key': 'serviceGroups', 'type': '[ServiceGroupReference]'} } def __init__(self, created_by=None, created_on=None, description=None, id=None, last_modified_by=None, last_modified_on=None, name=None, service_groups=None): super(Environment, self).__init__() self.created_by = created_by self.created_on = created_on self.description = description self.id = id self.last_modified_by = last_modified_by self.last_modified_on = last_modified_on self.name = name self.service_groups = service_groups class EnvironmentCreateParameter(Model): """EnvironmentCreateParameter. :param description: Description of the environment. :type description: str :param name: Name of the environment. :type name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, description=None, name=None): super(EnvironmentCreateParameter, self).__init__() self.description = description self.name = name class EnvironmentReference(Model): """EnvironmentReference. :param id: :type id: int :param name: :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(EnvironmentReference, self).__init__() self.id = id self.name = name class EnvironmentUpdateParameter(Model): """EnvironmentUpdateParameter. :param description: Description of the environment. :type description: str :param name: Name of the environment. :type name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, description=None, name=None): super(EnvironmentUpdateParameter, self).__init__() self.description = description self.name = name class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class HelpLink(Model): """HelpLink. :param text: :type text: str :param url: :type url: str """ _attribute_map = { 'text': {'key': 'text', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, text=None, url=None): super(HelpLink, self).__init__() self.text = text self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class InputDescriptor(Model): """InputDescriptor. :param dependency_input_ids: The ids of all inputs that the value of this input is dependent on. :type dependency_input_ids: list of str :param description: Description of what this input is used for :type description: str :param group_name: The group localized name to which this input belongs and can be shown as a header for the container that will include all the inputs in the group. :type group_name: str :param has_dynamic_value_information: If true, the value information for this input is dynamic and should be fetched when the value of dependency inputs change. :type has_dynamic_value_information: bool :param id: Identifier for the subscription input :type id: str :param input_mode: Mode in which the value of this input should be entered :type input_mode: object :param is_confidential: Gets whether this input is confidential, such as for a password or application key :type is_confidential: bool :param name: Localized name which can be shown as a label for the subscription input :type name: str :param properties: Custom properties for the input which can be used by the service provider :type properties: dict :param type: Underlying data type for the input value. When this value is specified, InputMode, Validation and Values are optional. :type type: str :param use_in_default_description: Gets whether this input is included in the default generated action description. :type use_in_default_description: bool :param validation: Information to use to validate this input's value :type validation: :class:`InputValidation ` :param value_hint: A hint for input value. It can be used in the UI as the input placeholder. :type value_hint: str :param values: Information about possible values for this input :type values: :class:`InputValues ` """ _attribute_map = { 'dependency_input_ids': {'key': 'dependencyInputIds', 'type': '[str]'}, 'description': {'key': 'description', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'has_dynamic_value_information': {'key': 'hasDynamicValueInformation', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'input_mode': {'key': 'inputMode', 'type': 'object'}, 'is_confidential': {'key': 'isConfidential', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'str'}, 'use_in_default_description': {'key': 'useInDefaultDescription', 'type': 'bool'}, 'validation': {'key': 'validation', 'type': 'InputValidation'}, 'value_hint': {'key': 'valueHint', 'type': 'str'}, 'values': {'key': 'values', 'type': 'InputValues'} } def __init__(self, dependency_input_ids=None, description=None, group_name=None, has_dynamic_value_information=None, id=None, input_mode=None, is_confidential=None, name=None, properties=None, type=None, use_in_default_description=None, validation=None, value_hint=None, values=None): super(InputDescriptor, self).__init__() self.dependency_input_ids = dependency_input_ids self.description = description self.group_name = group_name self.has_dynamic_value_information = has_dynamic_value_information self.id = id self.input_mode = input_mode self.is_confidential = is_confidential self.name = name self.properties = properties self.type = type self.use_in_default_description = use_in_default_description self.validation = validation self.value_hint = value_hint self.values = values class InputValidation(Model): """InputValidation. :param data_type: :type data_type: object :param is_required: :type is_required: bool :param max_length: :type max_length: int :param max_value: :type max_value: decimal :param min_length: :type min_length: int :param min_value: :type min_value: decimal :param pattern: :type pattern: str :param pattern_mismatch_error_message: :type pattern_mismatch_error_message: str """ _attribute_map = { 'data_type': {'key': 'dataType', 'type': 'object'}, 'is_required': {'key': 'isRequired', 'type': 'bool'}, 'max_length': {'key': 'maxLength', 'type': 'int'}, 'max_value': {'key': 'maxValue', 'type': 'decimal'}, 'min_length': {'key': 'minLength', 'type': 'int'}, 'min_value': {'key': 'minValue', 'type': 'decimal'}, 'pattern': {'key': 'pattern', 'type': 'str'}, 'pattern_mismatch_error_message': {'key': 'patternMismatchErrorMessage', 'type': 'str'} } def __init__(self, data_type=None, is_required=None, max_length=None, max_value=None, min_length=None, min_value=None, pattern=None, pattern_mismatch_error_message=None): super(InputValidation, self).__init__() self.data_type = data_type self.is_required = is_required self.max_length = max_length self.max_value = max_value self.min_length = min_length self.min_value = min_value self.pattern = pattern self.pattern_mismatch_error_message = pattern_mismatch_error_message class InputValidationRequest(Model): """InputValidationRequest. :param inputs: :type inputs: dict """ _attribute_map = { 'inputs': {'key': 'inputs', 'type': '{ValidationItem}'} } def __init__(self, inputs=None): super(InputValidationRequest, self).__init__() self.inputs = inputs class InputValue(Model): """InputValue. :param data: Any other data about this input :type data: dict :param display_value: The text to show for the display of this value :type display_value: str :param value: The value to store for this input :type value: str """ _attribute_map = { 'data': {'key': 'data', 'type': '{object}'}, 'display_value': {'key': 'displayValue', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, data=None, display_value=None, value=None): super(InputValue, self).__init__() self.data = data self.display_value = display_value self.value = value class InputValues(Model): """InputValues. :param default_value: The default value to use for this input :type default_value: str :param error: Errors encountered while computing dynamic values. :type error: :class:`InputValuesError ` :param input_id: The id of the input :type input_id: str :param is_disabled: Should this input be disabled :type is_disabled: bool :param is_limited_to_possible_values: Should the value be restricted to one of the values in the PossibleValues (True) or are the values in PossibleValues just a suggestion (False) :type is_limited_to_possible_values: bool :param is_read_only: Should this input be made read-only :type is_read_only: bool :param possible_values: Possible values that this input can take :type possible_values: list of :class:`InputValue ` """ _attribute_map = { 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'error': {'key': 'error', 'type': 'InputValuesError'}, 'input_id': {'key': 'inputId', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'is_limited_to_possible_values': {'key': 'isLimitedToPossibleValues', 'type': 'bool'}, 'is_read_only': {'key': 'isReadOnly', 'type': 'bool'}, 'possible_values': {'key': 'possibleValues', 'type': '[InputValue]'} } def __init__(self, default_value=None, error=None, input_id=None, is_disabled=None, is_limited_to_possible_values=None, is_read_only=None, possible_values=None): super(InputValues, self).__init__() self.default_value = default_value self.error = error self.input_id = input_id self.is_disabled = is_disabled self.is_limited_to_possible_values = is_limited_to_possible_values self.is_read_only = is_read_only self.possible_values = possible_values class InputValuesError(Model): """InputValuesError. :param message: The error message. :type message: str """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'} } def __init__(self, message=None): super(InputValuesError, self).__init__() self.message = message class KubernetesServiceGroupCreateParameters(Model): """KubernetesServiceGroupCreateParameters. :param name: :type name: str :param namespace: :type namespace: str :param service_endpoint_id: :type service_endpoint_id: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'namespace': {'key': 'namespace', 'type': 'str'}, 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'} } def __init__(self, name=None, namespace=None, service_endpoint_id=None): super(KubernetesServiceGroupCreateParameters, self).__init__() self.name = name self.namespace = namespace self.service_endpoint_id = service_endpoint_id class MarketplacePurchasedLicense(Model): """MarketplacePurchasedLicense. :param marketplace_name: The Marketplace display name. :type marketplace_name: str :param purchaser_name: The name of the identity making the purchase as seen by the marketplace :type purchaser_name: str :param purchase_unit_count: The quantity purchased. :type purchase_unit_count: int """ _attribute_map = { 'marketplace_name': {'key': 'marketplaceName', 'type': 'str'}, 'purchaser_name': {'key': 'purchaserName', 'type': 'str'}, 'purchase_unit_count': {'key': 'purchaseUnitCount', 'type': 'int'} } def __init__(self, marketplace_name=None, purchaser_name=None, purchase_unit_count=None): super(MarketplacePurchasedLicense, self).__init__() self.marketplace_name = marketplace_name self.purchaser_name = purchaser_name self.purchase_unit_count = purchase_unit_count class MetricsColumnMetaData(Model): """MetricsColumnMetaData. :param column_name: Name. :type column_name: str :param column_value_type: Data type. :type column_value_type: str """ _attribute_map = { 'column_name': {'key': 'columnName', 'type': 'str'}, 'column_value_type': {'key': 'columnValueType', 'type': 'str'} } def __init__(self, column_name=None, column_value_type=None): super(MetricsColumnMetaData, self).__init__() self.column_name = column_name self.column_value_type = column_value_type class MetricsColumnsHeader(Model): """MetricsColumnsHeader. :param dimensions: Properties of deployment group for which metrics are provided. E.g. 1: LastJobStatus E.g. 2: TargetState :type dimensions: list of :class:`MetricsColumnMetaData ` :param metrics: The types of metrics. E.g. 1: total count of deployment targets. E.g. 2: Average time of deployment to the deployment targets. :type metrics: list of :class:`MetricsColumnMetaData ` """ _attribute_map = { 'dimensions': {'key': 'dimensions', 'type': '[MetricsColumnMetaData]'}, 'metrics': {'key': 'metrics', 'type': '[MetricsColumnMetaData]'} } def __init__(self, dimensions=None, metrics=None): super(MetricsColumnsHeader, self).__init__() self.dimensions = dimensions self.metrics = metrics class MetricsRow(Model): """MetricsRow. :param dimensions: The values of the properties mentioned as 'Dimensions' in column header. E.g. 1: For a property 'LastJobStatus' - metrics will be provided for 'passed', 'failed', etc. E.g. 2: For a property 'TargetState' - metrics will be provided for 'online', 'offline' targets. :type dimensions: list of str :param metrics: Metrics in serialized format. Should be deserialized based on the data type provided in header. :type metrics: list of str """ _attribute_map = { 'dimensions': {'key': 'dimensions', 'type': '[str]'}, 'metrics': {'key': 'metrics', 'type': '[str]'} } def __init__(self, dimensions=None, metrics=None): super(MetricsRow, self).__init__() self.dimensions = dimensions self.metrics = metrics class PackageMetadata(Model): """PackageMetadata. :param created_on: The date the package was created :type created_on: datetime :param download_url: A direct link to download the package. :type download_url: str :param filename: The UI uses this to display instructions, i.e. "unzip MyAgent.zip" :type filename: str :param hash_value: MD5 hash as a base64 string :type hash_value: str :param info_url: A link to documentation :type info_url: str :param platform: The platform (win7, linux, etc.) :type platform: str :param type: The type of package (e.g. "agent") :type type: str :param version: The package version. :type version: :class:`PackageVersion ` """ _attribute_map = { 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'download_url': {'key': 'downloadUrl', 'type': 'str'}, 'filename': {'key': 'filename', 'type': 'str'}, 'hash_value': {'key': 'hashValue', 'type': 'str'}, 'info_url': {'key': 'infoUrl', 'type': 'str'}, 'platform': {'key': 'platform', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'version': {'key': 'version', 'type': 'PackageVersion'} } def __init__(self, created_on=None, download_url=None, filename=None, hash_value=None, info_url=None, platform=None, type=None, version=None): super(PackageMetadata, self).__init__() self.created_on = created_on self.download_url = download_url self.filename = filename self.hash_value = hash_value self.info_url = info_url self.platform = platform self.type = type self.version = version class PackageVersion(Model): """PackageVersion. :param major: :type major: int :param minor: :type minor: int :param patch: :type patch: int """ _attribute_map = { 'major': {'key': 'major', 'type': 'int'}, 'minor': {'key': 'minor', 'type': 'int'}, 'patch': {'key': 'patch', 'type': 'int'} } def __init__(self, major=None, minor=None, patch=None): super(PackageVersion, self).__init__() self.major = major self.minor = minor self.patch = patch class ProjectReference(Model): """ProjectReference. :param id: :type id: str :param name: :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(ProjectReference, self).__init__() self.id = id self.name = name class PublishTaskGroupMetadata(Model): """PublishTaskGroupMetadata. :param comment: :type comment: str :param parent_definition_revision: :type parent_definition_revision: int :param preview: :type preview: bool :param task_group_id: :type task_group_id: str :param task_group_revision: :type task_group_revision: int """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'parent_definition_revision': {'key': 'parentDefinitionRevision', 'type': 'int'}, 'preview': {'key': 'preview', 'type': 'bool'}, 'task_group_id': {'key': 'taskGroupId', 'type': 'str'}, 'task_group_revision': {'key': 'taskGroupRevision', 'type': 'int'} } def __init__(self, comment=None, parent_definition_revision=None, preview=None, task_group_id=None, task_group_revision=None): super(PublishTaskGroupMetadata, self).__init__() self.comment = comment self.parent_definition_revision = parent_definition_revision self.preview = preview self.task_group_id = task_group_id self.task_group_revision = task_group_revision class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class ResourceLimit(Model): """ResourceLimit. :param failed_to_reach_all_providers: :type failed_to_reach_all_providers: bool :param host_id: :type host_id: str :param is_hosted: :type is_hosted: bool :param is_premium: :type is_premium: bool :param parallelism_tag: :type parallelism_tag: str :param resource_limits_data: :type resource_limits_data: dict :param total_count: :type total_count: int :param total_minutes: :type total_minutes: int """ _attribute_map = { 'failed_to_reach_all_providers': {'key': 'failedToReachAllProviders', 'type': 'bool'}, 'host_id': {'key': 'hostId', 'type': 'str'}, 'is_hosted': {'key': 'isHosted', 'type': 'bool'}, 'is_premium': {'key': 'isPremium', 'type': 'bool'}, 'parallelism_tag': {'key': 'parallelismTag', 'type': 'str'}, 'resource_limits_data': {'key': 'resourceLimitsData', 'type': '{str}'}, 'total_count': {'key': 'totalCount', 'type': 'int'}, 'total_minutes': {'key': 'totalMinutes', 'type': 'int'} } def __init__(self, failed_to_reach_all_providers=None, host_id=None, is_hosted=None, is_premium=None, parallelism_tag=None, resource_limits_data=None, total_count=None, total_minutes=None): super(ResourceLimit, self).__init__() self.failed_to_reach_all_providers = failed_to_reach_all_providers self.host_id = host_id self.is_hosted = is_hosted self.is_premium = is_premium self.parallelism_tag = parallelism_tag self.resource_limits_data = resource_limits_data self.total_count = total_count self.total_minutes = total_minutes class ResourceUsage(Model): """ResourceUsage. :param resource_limit: :type resource_limit: :class:`ResourceLimit ` :param running_requests: :type running_requests: list of :class:`TaskAgentJobRequest ` :param used_count: :type used_count: int :param used_minutes: :type used_minutes: int """ _attribute_map = { 'resource_limit': {'key': 'resourceLimit', 'type': 'ResourceLimit'}, 'running_requests': {'key': 'runningRequests', 'type': '[TaskAgentJobRequest]'}, 'used_count': {'key': 'usedCount', 'type': 'int'}, 'used_minutes': {'key': 'usedMinutes', 'type': 'int'} } def __init__(self, resource_limit=None, running_requests=None, used_count=None, used_minutes=None): super(ResourceUsage, self).__init__() self.resource_limit = resource_limit self.running_requests = running_requests self.used_count = used_count self.used_minutes = used_minutes class ResultTransformationDetails(Model): """ResultTransformationDetails. :param result_template: :type result_template: str """ _attribute_map = { 'result_template': {'key': 'resultTemplate', 'type': 'str'} } def __init__(self, result_template=None): super(ResultTransformationDetails, self).__init__() self.result_template = result_template class SecureFile(Model): """SecureFile. :param created_by: :type created_by: :class:`IdentityRef ` :param created_on: :type created_on: datetime :param id: :type id: str :param modified_by: :type modified_by: :class:`IdentityRef ` :param modified_on: :type modified_on: datetime :param name: :type name: str :param properties: :type properties: dict :param ticket: :type ticket: str """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'ticket': {'key': 'ticket', 'type': 'str'} } def __init__(self, created_by=None, created_on=None, id=None, modified_by=None, modified_on=None, name=None, properties=None, ticket=None): super(SecureFile, self).__init__() self.created_by = created_by self.created_on = created_on self.id = id self.modified_by = modified_by self.modified_on = modified_on self.name = name self.properties = properties self.ticket = ticket class ServiceEndpoint(Model): """ServiceEndpoint. :param administrators_group: Gets or sets the identity reference for the administrators group of the service endpoint. :type administrators_group: :class:`IdentityRef ` :param authorization: Gets or sets the authorization data for talking to the endpoint. :type authorization: :class:`EndpointAuthorization ` :param created_by: Gets or sets the identity reference for the user who created the Service endpoint. :type created_by: :class:`IdentityRef ` :param data: :type data: dict :param description: Gets or sets the description of endpoint. :type description: str :param group_scope_id: :type group_scope_id: str :param id: Gets or sets the identifier of this endpoint. :type id: str :param is_ready: EndPoint state indictor :type is_ready: bool :param is_shared: Indicates whether service endpoint is shared with other projects or not. :type is_shared: bool :param name: Gets or sets the friendly name of the endpoint. :type name: str :param operation_status: Error message during creation/deletion of endpoint :type operation_status: :class:`object ` :param readers_group: Gets or sets the identity reference for the readers group of the service endpoint. :type readers_group: :class:`IdentityRef ` :param type: Gets or sets the type of the endpoint. :type type: str :param url: Gets or sets the url of the endpoint. :type url: str """ _attribute_map = { 'administrators_group': {'key': 'administratorsGroup', 'type': 'IdentityRef'}, 'authorization': {'key': 'authorization', 'type': 'EndpointAuthorization'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'data': {'key': 'data', 'type': '{str}'}, 'description': {'key': 'description', 'type': 'str'}, 'group_scope_id': {'key': 'groupScopeId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_ready': {'key': 'isReady', 'type': 'bool'}, 'is_shared': {'key': 'isShared', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'operation_status': {'key': 'operationStatus', 'type': 'object'}, 'readers_group': {'key': 'readersGroup', 'type': 'IdentityRef'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, administrators_group=None, authorization=None, created_by=None, data=None, description=None, group_scope_id=None, id=None, is_ready=None, is_shared=None, name=None, operation_status=None, readers_group=None, type=None, url=None): super(ServiceEndpoint, self).__init__() self.administrators_group = administrators_group self.authorization = authorization self.created_by = created_by self.data = data self.description = description self.group_scope_id = group_scope_id self.id = id self.is_ready = is_ready self.is_shared = is_shared self.name = name self.operation_status = operation_status self.readers_group = readers_group self.type = type self.url = url class ServiceEndpointAuthenticationScheme(Model): """ServiceEndpointAuthenticationScheme. :param authorization_headers: Gets or sets the authorization headers of service endpoint authentication scheme. :type authorization_headers: list of :class:`AuthorizationHeader ` :param client_certificates: Gets or sets the certificates of service endpoint authentication scheme. :type client_certificates: list of :class:`ClientCertificate ` :param display_name: Gets or sets the display name for the service endpoint authentication scheme. :type display_name: str :param input_descriptors: Gets or sets the input descriptors for the service endpoint authentication scheme. :type input_descriptors: list of :class:`InputDescriptor ` :param scheme: Gets or sets the scheme for service endpoint authentication. :type scheme: str """ _attribute_map = { 'authorization_headers': {'key': 'authorizationHeaders', 'type': '[AuthorizationHeader]'}, 'client_certificates': {'key': 'clientCertificates', 'type': '[ClientCertificate]'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'scheme': {'key': 'scheme', 'type': 'str'} } def __init__(self, authorization_headers=None, client_certificates=None, display_name=None, input_descriptors=None, scheme=None): super(ServiceEndpointAuthenticationScheme, self).__init__() self.authorization_headers = authorization_headers self.client_certificates = client_certificates self.display_name = display_name self.input_descriptors = input_descriptors self.scheme = scheme class ServiceEndpointDetails(Model): """ServiceEndpointDetails. :param authorization: :type authorization: :class:`EndpointAuthorization ` :param data: :type data: dict :param type: :type type: str :param url: :type url: str """ _attribute_map = { 'authorization': {'key': 'authorization', 'type': 'EndpointAuthorization'}, 'data': {'key': 'data', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, authorization=None, data=None, type=None, url=None): super(ServiceEndpointDetails, self).__init__() self.authorization = authorization self.data = data self.type = type self.url = url class ServiceEndpointExecutionData(Model): """ServiceEndpointExecutionData. :param definition: Gets the definition of service endpoint execution owner. :type definition: :class:`TaskOrchestrationOwner ` :param finish_time: Gets the finish time of service endpoint execution. :type finish_time: datetime :param id: Gets the Id of service endpoint execution data. :type id: long :param owner: Gets the owner of service endpoint execution data. :type owner: :class:`TaskOrchestrationOwner ` :param plan_type: Gets the plan type of service endpoint execution data. :type plan_type: str :param result: Gets the result of service endpoint execution. :type result: object :param start_time: Gets the start time of service endpoint execution. :type start_time: datetime """ _attribute_map = { 'definition': {'key': 'definition', 'type': 'TaskOrchestrationOwner'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'long'}, 'owner': {'key': 'owner', 'type': 'TaskOrchestrationOwner'}, 'plan_type': {'key': 'planType', 'type': 'str'}, 'result': {'key': 'result', 'type': 'object'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'} } def __init__(self, definition=None, finish_time=None, id=None, owner=None, plan_type=None, result=None, start_time=None): super(ServiceEndpointExecutionData, self).__init__() self.definition = definition self.finish_time = finish_time self.id = id self.owner = owner self.plan_type = plan_type self.result = result self.start_time = start_time class ServiceEndpointExecutionRecord(Model): """ServiceEndpointExecutionRecord. :param data: Gets the execution data of service endpoint execution. :type data: :class:`ServiceEndpointExecutionData ` :param endpoint_id: Gets the Id of service endpoint. :type endpoint_id: str """ _attribute_map = { 'data': {'key': 'data', 'type': 'ServiceEndpointExecutionData'}, 'endpoint_id': {'key': 'endpointId', 'type': 'str'} } def __init__(self, data=None, endpoint_id=None): super(ServiceEndpointExecutionRecord, self).__init__() self.data = data self.endpoint_id = endpoint_id class ServiceEndpointExecutionRecordsInput(Model): """ServiceEndpointExecutionRecordsInput. :param data: :type data: :class:`ServiceEndpointExecutionData ` :param endpoint_ids: :type endpoint_ids: list of str """ _attribute_map = { 'data': {'key': 'data', 'type': 'ServiceEndpointExecutionData'}, 'endpoint_ids': {'key': 'endpointIds', 'type': '[str]'} } def __init__(self, data=None, endpoint_ids=None): super(ServiceEndpointExecutionRecordsInput, self).__init__() self.data = data self.endpoint_ids = endpoint_ids class ServiceEndpointRequest(Model): """ServiceEndpointRequest. :param data_source_details: :type data_source_details: :class:`DataSourceDetails ` :param result_transformation_details: :type result_transformation_details: :class:`ResultTransformationDetails ` :param service_endpoint_details: :type service_endpoint_details: :class:`ServiceEndpointDetails ` """ _attribute_map = { 'data_source_details': {'key': 'dataSourceDetails', 'type': 'DataSourceDetails'}, 'result_transformation_details': {'key': 'resultTransformationDetails', 'type': 'ResultTransformationDetails'}, 'service_endpoint_details': {'key': 'serviceEndpointDetails', 'type': 'ServiceEndpointDetails'} } def __init__(self, data_source_details=None, result_transformation_details=None, service_endpoint_details=None): super(ServiceEndpointRequest, self).__init__() self.data_source_details = data_source_details self.result_transformation_details = result_transformation_details self.service_endpoint_details = service_endpoint_details class ServiceEndpointRequestResult(Model): """ServiceEndpointRequestResult. :param error_message: :type error_message: str :param result: :type result: :class:`object ` :param status_code: :type status_code: object """ _attribute_map = { 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'result': {'key': 'result', 'type': 'object'}, 'status_code': {'key': 'statusCode', 'type': 'object'} } def __init__(self, error_message=None, result=None, status_code=None): super(ServiceEndpointRequestResult, self).__init__() self.error_message = error_message self.result = result self.status_code = status_code class ServiceEndpointType(Model): """ServiceEndpointType. :param authentication_schemes: Authentication scheme of service endpoint type. :type authentication_schemes: list of :class:`ServiceEndpointAuthenticationScheme ` :param data_sources: Data sources of service endpoint type. :type data_sources: list of :class:`DataSource ` :param dependency_data: Dependency data of service endpoint type. :type dependency_data: list of :class:`DependencyData ` :param description: Gets or sets the description of service endpoint type. :type description: str :param display_name: Gets or sets the display name of service endpoint type. :type display_name: str :param endpoint_url: Gets or sets the endpoint url of service endpoint type. :type endpoint_url: :class:`EndpointUrl ` :param help_link: Gets or sets the help link of service endpoint type. :type help_link: :class:`HelpLink ` :param help_mark_down: :type help_mark_down: str :param icon_url: Gets or sets the icon url of service endpoint type. :type icon_url: str :param input_descriptors: Input descriptor of service endpoint type. :type input_descriptors: list of :class:`InputDescriptor ` :param name: Gets or sets the name of service endpoint type. :type name: str :param trusted_hosts: Trusted hosts of a service endpoint type. :type trusted_hosts: list of str :param ui_contribution_id: Gets or sets the ui contribution id of service endpoint type. :type ui_contribution_id: str """ _attribute_map = { 'authentication_schemes': {'key': 'authenticationSchemes', 'type': '[ServiceEndpointAuthenticationScheme]'}, 'data_sources': {'key': 'dataSources', 'type': '[DataSource]'}, 'dependency_data': {'key': 'dependencyData', 'type': '[DependencyData]'}, 'description': {'key': 'description', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'EndpointUrl'}, 'help_link': {'key': 'helpLink', 'type': 'HelpLink'}, 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, 'icon_url': {'key': 'iconUrl', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'name': {'key': 'name', 'type': 'str'}, 'trusted_hosts': {'key': 'trustedHosts', 'type': '[str]'}, 'ui_contribution_id': {'key': 'uiContributionId', 'type': 'str'} } def __init__(self, authentication_schemes=None, data_sources=None, dependency_data=None, description=None, display_name=None, endpoint_url=None, help_link=None, help_mark_down=None, icon_url=None, input_descriptors=None, name=None, trusted_hosts=None, ui_contribution_id=None): super(ServiceEndpointType, self).__init__() self.authentication_schemes = authentication_schemes self.data_sources = data_sources self.dependency_data = dependency_data self.description = description self.display_name = display_name self.endpoint_url = endpoint_url self.help_link = help_link self.help_mark_down = help_mark_down self.icon_url = icon_url self.input_descriptors = input_descriptors self.name = name self.trusted_hosts = trusted_hosts self.ui_contribution_id = ui_contribution_id class ServiceGroup(Model): """ServiceGroup. :param created_by: :type created_by: :class:`IdentityRef ` :param created_on: :type created_on: datetime :param environment_reference: :type environment_reference: :class:`EnvironmentReference ` :param id: :type id: int :param last_modified_by: :type last_modified_by: :class:`IdentityRef ` :param last_modified_on: :type last_modified_on: datetime :param name: :type name: str :param type: :type type: object """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'environment_reference': {'key': 'environmentReference', 'type': 'EnvironmentReference'}, 'id': {'key': 'id', 'type': 'int'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, created_by=None, created_on=None, environment_reference=None, id=None, last_modified_by=None, last_modified_on=None, name=None, type=None): super(ServiceGroup, self).__init__() self.created_by = created_by self.created_on = created_on self.environment_reference = environment_reference self.id = id self.last_modified_by = last_modified_by self.last_modified_on = last_modified_on self.name = name self.type = type class ServiceGroupReference(Model): """ServiceGroupReference. :param id: Id of the Service Group. :type id: int :param name: Name of the service group. :type name: str :param type: Type of the service group. :type type: object """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, id=None, name=None, type=None): super(ServiceGroupReference, self).__init__() self.id = id self.name = name self.type = type class TaskAgentAuthorization(Model): """TaskAgentAuthorization. :param authorization_url: Gets or sets the endpoint used to obtain access tokens from the configured token service. :type authorization_url: str :param client_id: Gets or sets the client identifier for this agent. :type client_id: str :param public_key: Gets or sets the public key used to verify the identity of this agent. :type public_key: :class:`TaskAgentPublicKey ` """ _attribute_map = { 'authorization_url': {'key': 'authorizationUrl', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, 'public_key': {'key': 'publicKey', 'type': 'TaskAgentPublicKey'} } def __init__(self, authorization_url=None, client_id=None, public_key=None): super(TaskAgentAuthorization, self).__init__() self.authorization_url = authorization_url self.client_id = client_id self.public_key = public_key class TaskAgentCloud(Model): """TaskAgentCloud. :param acquire_agent_endpoint: Gets or sets a AcquireAgentEndpoint using which a request can be made to acquire new agent :type acquire_agent_endpoint: str :param agent_cloud_id: :type agent_cloud_id: int :param get_agent_definition_endpoint: :type get_agent_definition_endpoint: str :param get_agent_request_status_endpoint: :type get_agent_request_status_endpoint: str :param internal: Signifies that this Agent Cloud is internal and should not be user-manageable :type internal: bool :param name: :type name: str :param release_agent_endpoint: :type release_agent_endpoint: str :param shared_secret: :type shared_secret: str :param type: Gets or sets the type of the endpoint. :type type: str """ _attribute_map = { 'acquire_agent_endpoint': {'key': 'acquireAgentEndpoint', 'type': 'str'}, 'agent_cloud_id': {'key': 'agentCloudId', 'type': 'int'}, 'get_agent_definition_endpoint': {'key': 'getAgentDefinitionEndpoint', 'type': 'str'}, 'get_agent_request_status_endpoint': {'key': 'getAgentRequestStatusEndpoint', 'type': 'str'}, 'internal': {'key': 'internal', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'release_agent_endpoint': {'key': 'releaseAgentEndpoint', 'type': 'str'}, 'shared_secret': {'key': 'sharedSecret', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, acquire_agent_endpoint=None, agent_cloud_id=None, get_agent_definition_endpoint=None, get_agent_request_status_endpoint=None, internal=None, name=None, release_agent_endpoint=None, shared_secret=None, type=None): super(TaskAgentCloud, self).__init__() self.acquire_agent_endpoint = acquire_agent_endpoint self.agent_cloud_id = agent_cloud_id self.get_agent_definition_endpoint = get_agent_definition_endpoint self.get_agent_request_status_endpoint = get_agent_request_status_endpoint self.internal = internal self.name = name self.release_agent_endpoint = release_agent_endpoint self.shared_secret = shared_secret self.type = type class TaskAgentCloudRequest(Model): """TaskAgentCloudRequest. :param agent: :type agent: :class:`TaskAgentReference ` :param agent_cloud_id: :type agent_cloud_id: int :param agent_connected_time: :type agent_connected_time: datetime :param agent_data: :type agent_data: :class:`object ` :param agent_specification: :type agent_specification: :class:`object ` :param pool: :type pool: :class:`TaskAgentPoolReference ` :param provisioned_time: :type provisioned_time: datetime :param provision_request_time: :type provision_request_time: datetime :param release_request_time: :type release_request_time: datetime :param request_id: :type request_id: str """ _attribute_map = { 'agent': {'key': 'agent', 'type': 'TaskAgentReference'}, 'agent_cloud_id': {'key': 'agentCloudId', 'type': 'int'}, 'agent_connected_time': {'key': 'agentConnectedTime', 'type': 'iso-8601'}, 'agent_data': {'key': 'agentData', 'type': 'object'}, 'agent_specification': {'key': 'agentSpecification', 'type': 'object'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'provisioned_time': {'key': 'provisionedTime', 'type': 'iso-8601'}, 'provision_request_time': {'key': 'provisionRequestTime', 'type': 'iso-8601'}, 'release_request_time': {'key': 'releaseRequestTime', 'type': 'iso-8601'}, 'request_id': {'key': 'requestId', 'type': 'str'} } def __init__(self, agent=None, agent_cloud_id=None, agent_connected_time=None, agent_data=None, agent_specification=None, pool=None, provisioned_time=None, provision_request_time=None, release_request_time=None, request_id=None): super(TaskAgentCloudRequest, self).__init__() self.agent = agent self.agent_cloud_id = agent_cloud_id self.agent_connected_time = agent_connected_time self.agent_data = agent_data self.agent_specification = agent_specification self.pool = pool self.provisioned_time = provisioned_time self.provision_request_time = provision_request_time self.release_request_time = release_request_time self.request_id = request_id class TaskAgentCloudType(Model): """TaskAgentCloudType. :param display_name: Gets or sets the display name of agnet cloud type. :type display_name: str :param input_descriptors: Gets or sets the input descriptors :type input_descriptors: list of :class:`InputDescriptor ` :param name: Gets or sets the name of agent cloud type. :type name: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'input_descriptors': {'key': 'inputDescriptors', 'type': '[InputDescriptor]'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, display_name=None, input_descriptors=None, name=None): super(TaskAgentCloudType, self).__init__() self.display_name = display_name self.input_descriptors = input_descriptors self.name = name class TaskAgentDelaySource(Model): """TaskAgentDelaySource. :param delays: :type delays: list of object :param task_agent: :type task_agent: :class:`TaskAgentReference ` """ _attribute_map = { 'delays': {'key': 'delays', 'type': '[object]'}, 'task_agent': {'key': 'taskAgent', 'type': 'TaskAgentReference'} } def __init__(self, delays=None, task_agent=None): super(TaskAgentDelaySource, self).__init__() self.delays = delays self.task_agent = task_agent class TaskAgentJobRequest(Model): """TaskAgentJobRequest. :param agent_delays: :type agent_delays: list of :class:`TaskAgentDelaySource ` :param agent_specification: :type agent_specification: :class:`object ` :param assign_time: :type assign_time: datetime :param data: :type data: dict :param definition: :type definition: :class:`TaskOrchestrationOwner ` :param demands: :type demands: list of :class:`object ` :param expected_duration: :type expected_duration: object :param finish_time: :type finish_time: datetime :param host_id: :type host_id: str :param job_id: :type job_id: str :param job_name: :type job_name: str :param locked_until: :type locked_until: datetime :param matched_agents: :type matched_agents: list of :class:`TaskAgentReference ` :param orchestration_id: :type orchestration_id: str :param owner: :type owner: :class:`TaskOrchestrationOwner ` :param plan_group: :type plan_group: str :param plan_id: :type plan_id: str :param plan_type: :type plan_type: str :param pool_id: :type pool_id: int :param queue_id: :type queue_id: int :param queue_time: :type queue_time: datetime :param receive_time: :type receive_time: datetime :param request_id: :type request_id: long :param reserved_agent: :type reserved_agent: :class:`TaskAgentReference ` :param result: :type result: object :param scope_id: :type scope_id: str :param service_owner: :type service_owner: str """ _attribute_map = { 'agent_delays': {'key': 'agentDelays', 'type': '[TaskAgentDelaySource]'}, 'agent_specification': {'key': 'agentSpecification', 'type': 'object'}, 'assign_time': {'key': 'assignTime', 'type': 'iso-8601'}, 'data': {'key': 'data', 'type': '{str}'}, 'definition': {'key': 'definition', 'type': 'TaskOrchestrationOwner'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'expected_duration': {'key': 'expectedDuration', 'type': 'object'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'host_id': {'key': 'hostId', 'type': 'str'}, 'job_id': {'key': 'jobId', 'type': 'str'}, 'job_name': {'key': 'jobName', 'type': 'str'}, 'locked_until': {'key': 'lockedUntil', 'type': 'iso-8601'}, 'matched_agents': {'key': 'matchedAgents', 'type': '[TaskAgentReference]'}, 'orchestration_id': {'key': 'orchestrationId', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'TaskOrchestrationOwner'}, 'plan_group': {'key': 'planGroup', 'type': 'str'}, 'plan_id': {'key': 'planId', 'type': 'str'}, 'plan_type': {'key': 'planType', 'type': 'str'}, 'pool_id': {'key': 'poolId', 'type': 'int'}, 'queue_id': {'key': 'queueId', 'type': 'int'}, 'queue_time': {'key': 'queueTime', 'type': 'iso-8601'}, 'receive_time': {'key': 'receiveTime', 'type': 'iso-8601'}, 'request_id': {'key': 'requestId', 'type': 'long'}, 'reserved_agent': {'key': 'reservedAgent', 'type': 'TaskAgentReference'}, 'result': {'key': 'result', 'type': 'object'}, 'scope_id': {'key': 'scopeId', 'type': 'str'}, 'service_owner': {'key': 'serviceOwner', 'type': 'str'} } def __init__(self, agent_delays=None, agent_specification=None, assign_time=None, data=None, definition=None, demands=None, expected_duration=None, finish_time=None, host_id=None, job_id=None, job_name=None, locked_until=None, matched_agents=None, orchestration_id=None, owner=None, plan_group=None, plan_id=None, plan_type=None, pool_id=None, queue_id=None, queue_time=None, receive_time=None, request_id=None, reserved_agent=None, result=None, scope_id=None, service_owner=None): super(TaskAgentJobRequest, self).__init__() self.agent_delays = agent_delays self.agent_specification = agent_specification self.assign_time = assign_time self.data = data self.definition = definition self.demands = demands self.expected_duration = expected_duration self.finish_time = finish_time self.host_id = host_id self.job_id = job_id self.job_name = job_name self.locked_until = locked_until self.matched_agents = matched_agents self.orchestration_id = orchestration_id self.owner = owner self.plan_group = plan_group self.plan_id = plan_id self.plan_type = plan_type self.pool_id = pool_id self.queue_id = queue_id self.queue_time = queue_time self.receive_time = receive_time self.request_id = request_id self.reserved_agent = reserved_agent self.result = result self.scope_id = scope_id self.service_owner = service_owner class TaskAgentMessage(Model): """TaskAgentMessage. :param body: Gets or sets the body of the message. If the IV property is provided the body will need to be decrypted using the TaskAgentSession.EncryptionKey value in addition to the IV. :type body: str :param iv: Gets or sets the intialization vector used to encrypt this message. :type iv: str :param message_id: Gets or sets the message identifier. :type message_id: long :param message_type: Gets or sets the message type, describing the data contract found in TaskAgentMessage.Body. :type message_type: str """ _attribute_map = { 'body': {'key': 'body', 'type': 'str'}, 'iv': {'key': 'iv', 'type': 'str'}, 'message_id': {'key': 'messageId', 'type': 'long'}, 'message_type': {'key': 'messageType', 'type': 'str'} } def __init__(self, body=None, iv=None, message_id=None, message_type=None): super(TaskAgentMessage, self).__init__() self.body = body self.iv = iv self.message_id = message_id self.message_type = message_type class TaskAgentPoolMaintenanceDefinition(Model): """TaskAgentPoolMaintenanceDefinition. :param enabled: Enable maintenance :type enabled: bool :param id: Id :type id: int :param job_timeout_in_minutes: Maintenance job timeout per agent :type job_timeout_in_minutes: int :param max_concurrent_agents_percentage: Max percentage of agents within a pool running maintenance job at given time :type max_concurrent_agents_percentage: int :param options: :type options: :class:`TaskAgentPoolMaintenanceOptions ` :param pool: Pool reference for the maintenance definition :type pool: :class:`TaskAgentPoolReference ` :param retention_policy: :type retention_policy: :class:`TaskAgentPoolMaintenanceRetentionPolicy ` :param schedule_setting: :type schedule_setting: :class:`TaskAgentPoolMaintenanceSchedule ` """ _attribute_map = { 'enabled': {'key': 'enabled', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'int'}, 'job_timeout_in_minutes': {'key': 'jobTimeoutInMinutes', 'type': 'int'}, 'max_concurrent_agents_percentage': {'key': 'maxConcurrentAgentsPercentage', 'type': 'int'}, 'options': {'key': 'options', 'type': 'TaskAgentPoolMaintenanceOptions'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'retention_policy': {'key': 'retentionPolicy', 'type': 'TaskAgentPoolMaintenanceRetentionPolicy'}, 'schedule_setting': {'key': 'scheduleSetting', 'type': 'TaskAgentPoolMaintenanceSchedule'} } def __init__(self, enabled=None, id=None, job_timeout_in_minutes=None, max_concurrent_agents_percentage=None, options=None, pool=None, retention_policy=None, schedule_setting=None): super(TaskAgentPoolMaintenanceDefinition, self).__init__() self.enabled = enabled self.id = id self.job_timeout_in_minutes = job_timeout_in_minutes self.max_concurrent_agents_percentage = max_concurrent_agents_percentage self.options = options self.pool = pool self.retention_policy = retention_policy self.schedule_setting = schedule_setting class TaskAgentPoolMaintenanceJob(Model): """TaskAgentPoolMaintenanceJob. :param definition_id: The maintenance definition for the maintenance job :type definition_id: int :param error_count: The total error counts during the maintenance job :type error_count: int :param finish_time: Time that the maintenance job was completed :type finish_time: datetime :param job_id: Id of the maintenance job :type job_id: int :param logs_download_url: The log download url for the maintenance job :type logs_download_url: str :param orchestration_id: Orchestration/Plan Id for the maintenance job :type orchestration_id: str :param pool: Pool reference for the maintenance job :type pool: :class:`TaskAgentPoolReference ` :param queue_time: Time that the maintenance job was queued :type queue_time: datetime :param requested_by: The identity that queued the maintenance job :type requested_by: :class:`IdentityRef ` :param result: The maintenance job result :type result: object :param start_time: Time that the maintenance job was started :type start_time: datetime :param status: Status of the maintenance job :type status: object :param target_agents: :type target_agents: list of :class:`TaskAgentPoolMaintenanceJobTargetAgent ` :param warning_count: The total warning counts during the maintenance job :type warning_count: int """ _attribute_map = { 'definition_id': {'key': 'definitionId', 'type': 'int'}, 'error_count': {'key': 'errorCount', 'type': 'int'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'job_id': {'key': 'jobId', 'type': 'int'}, 'logs_download_url': {'key': 'logsDownloadUrl', 'type': 'str'}, 'orchestration_id': {'key': 'orchestrationId', 'type': 'str'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'queue_time': {'key': 'queueTime', 'type': 'iso-8601'}, 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, 'result': {'key': 'result', 'type': 'object'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'target_agents': {'key': 'targetAgents', 'type': '[TaskAgentPoolMaintenanceJobTargetAgent]'}, 'warning_count': {'key': 'warningCount', 'type': 'int'} } def __init__(self, definition_id=None, error_count=None, finish_time=None, job_id=None, logs_download_url=None, orchestration_id=None, pool=None, queue_time=None, requested_by=None, result=None, start_time=None, status=None, target_agents=None, warning_count=None): super(TaskAgentPoolMaintenanceJob, self).__init__() self.definition_id = definition_id self.error_count = error_count self.finish_time = finish_time self.job_id = job_id self.logs_download_url = logs_download_url self.orchestration_id = orchestration_id self.pool = pool self.queue_time = queue_time self.requested_by = requested_by self.result = result self.start_time = start_time self.status = status self.target_agents = target_agents self.warning_count = warning_count class TaskAgentPoolMaintenanceJobTargetAgent(Model): """TaskAgentPoolMaintenanceJobTargetAgent. :param agent: :type agent: :class:`TaskAgentReference ` :param job_id: :type job_id: int :param result: :type result: object :param status: :type status: object """ _attribute_map = { 'agent': {'key': 'agent', 'type': 'TaskAgentReference'}, 'job_id': {'key': 'jobId', 'type': 'int'}, 'result': {'key': 'result', 'type': 'object'}, 'status': {'key': 'status', 'type': 'object'} } def __init__(self, agent=None, job_id=None, result=None, status=None): super(TaskAgentPoolMaintenanceJobTargetAgent, self).__init__() self.agent = agent self.job_id = job_id self.result = result self.status = status class TaskAgentPoolMaintenanceOptions(Model): """TaskAgentPoolMaintenanceOptions. :param working_directory_expiration_in_days: time to consider a System.DefaultWorkingDirectory is stale :type working_directory_expiration_in_days: int """ _attribute_map = { 'working_directory_expiration_in_days': {'key': 'workingDirectoryExpirationInDays', 'type': 'int'} } def __init__(self, working_directory_expiration_in_days=None): super(TaskAgentPoolMaintenanceOptions, self).__init__() self.working_directory_expiration_in_days = working_directory_expiration_in_days class TaskAgentPoolMaintenanceRetentionPolicy(Model): """TaskAgentPoolMaintenanceRetentionPolicy. :param number_of_history_records_to_keep: Number of records to keep for maintenance job executed with this definition. :type number_of_history_records_to_keep: int """ _attribute_map = { 'number_of_history_records_to_keep': {'key': 'numberOfHistoryRecordsToKeep', 'type': 'int'} } def __init__(self, number_of_history_records_to_keep=None): super(TaskAgentPoolMaintenanceRetentionPolicy, self).__init__() self.number_of_history_records_to_keep = number_of_history_records_to_keep class TaskAgentPoolMaintenanceSchedule(Model): """TaskAgentPoolMaintenanceSchedule. :param days_to_build: Days for a build (flags enum for days of the week) :type days_to_build: object :param schedule_job_id: The Job Id of the Scheduled job that will queue the pool maintenance job. :type schedule_job_id: str :param start_hours: Local timezone hour to start :type start_hours: int :param start_minutes: Local timezone minute to start :type start_minutes: int :param time_zone_id: Time zone of the build schedule (string representation of the time zone id) :type time_zone_id: str """ _attribute_map = { 'days_to_build': {'key': 'daysToBuild', 'type': 'object'}, 'schedule_job_id': {'key': 'scheduleJobId', 'type': 'str'}, 'start_hours': {'key': 'startHours', 'type': 'int'}, 'start_minutes': {'key': 'startMinutes', 'type': 'int'}, 'time_zone_id': {'key': 'timeZoneId', 'type': 'str'} } def __init__(self, days_to_build=None, schedule_job_id=None, start_hours=None, start_minutes=None, time_zone_id=None): super(TaskAgentPoolMaintenanceSchedule, self).__init__() self.days_to_build = days_to_build self.schedule_job_id = schedule_job_id self.start_hours = start_hours self.start_minutes = start_minutes self.time_zone_id = time_zone_id class TaskAgentPoolReference(Model): """TaskAgentPoolReference. :param id: :type id: int :param is_hosted: Gets or sets a value indicating whether or not this pool is managed by the service. :type is_hosted: bool :param name: :type name: str :param pool_type: Gets or sets the type of the pool :type pool_type: object :param scope: :type scope: str :param size: Gets the current size of the pool. :type size: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'is_hosted': {'key': 'isHosted', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'pool_type': {'key': 'poolType', 'type': 'object'}, 'scope': {'key': 'scope', 'type': 'str'}, 'size': {'key': 'size', 'type': 'int'} } def __init__(self, id=None, is_hosted=None, name=None, pool_type=None, scope=None, size=None): super(TaskAgentPoolReference, self).__init__() self.id = id self.is_hosted = is_hosted self.name = name self.pool_type = pool_type self.scope = scope self.size = size class TaskAgentPublicKey(Model): """TaskAgentPublicKey. :param exponent: Gets or sets the exponent for the public key. :type exponent: str :param modulus: Gets or sets the modulus for the public key. :type modulus: str """ _attribute_map = { 'exponent': {'key': 'exponent', 'type': 'str'}, 'modulus': {'key': 'modulus', 'type': 'str'} } def __init__(self, exponent=None, modulus=None): super(TaskAgentPublicKey, self).__init__() self.exponent = exponent self.modulus = modulus class TaskAgentQueue(Model): """TaskAgentQueue. :param id: Id of the queue :type id: int :param name: Name of the queue :type name: str :param pool: Pool reference for this queue :type pool: :class:`TaskAgentPoolReference ` :param project_id: Project Id :type project_id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'project_id': {'key': 'projectId', 'type': 'str'} } def __init__(self, id=None, name=None, pool=None, project_id=None): super(TaskAgentQueue, self).__init__() self.id = id self.name = name self.pool = pool self.project_id = project_id class TaskAgentReference(Model): """TaskAgentReference. :param _links: :type _links: :class:`ReferenceLinks ` :param access_point: Gets the access point of the agent. :type access_point: str :param enabled: Gets or sets a value indicating whether or not this agent should be enabled for job execution. :type enabled: bool :param id: Gets the identifier of the agent. :type id: int :param name: Gets the name of the agent. :type name: str :param os_description: Gets the OS of the agent. :type os_description: str :param provisioning_state: Gets or sets the current provisioning state of this agent :type provisioning_state: str :param status: Gets the current connectivity status of the agent. :type status: object :param version: Gets the version of the agent. :type version: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'access_point': {'key': 'accessPoint', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'os_description': {'key': 'osDescription', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, _links=None, access_point=None, enabled=None, id=None, name=None, os_description=None, provisioning_state=None, status=None, version=None): super(TaskAgentReference, self).__init__() self._links = _links self.access_point = access_point self.enabled = enabled self.id = id self.name = name self.os_description = os_description self.provisioning_state = provisioning_state self.status = status self.version = version class TaskAgentSession(Model): """TaskAgentSession. :param agent: Gets or sets the agent which is the target of the session. :type agent: :class:`TaskAgentReference ` :param encryption_key: Gets the key used to encrypt message traffic for this session. :type encryption_key: :class:`TaskAgentSessionKey ` :param owner_name: Gets or sets the owner name of this session. Generally this will be the machine of origination. :type owner_name: str :param session_id: Gets the unique identifier for this session. :type session_id: str :param system_capabilities: :type system_capabilities: dict """ _attribute_map = { 'agent': {'key': 'agent', 'type': 'TaskAgentReference'}, 'encryption_key': {'key': 'encryptionKey', 'type': 'TaskAgentSessionKey'}, 'owner_name': {'key': 'ownerName', 'type': 'str'}, 'session_id': {'key': 'sessionId', 'type': 'str'}, 'system_capabilities': {'key': 'systemCapabilities', 'type': '{str}'} } def __init__(self, agent=None, encryption_key=None, owner_name=None, session_id=None, system_capabilities=None): super(TaskAgentSession, self).__init__() self.agent = agent self.encryption_key = encryption_key self.owner_name = owner_name self.session_id = session_id self.system_capabilities = system_capabilities class TaskAgentSessionKey(Model): """TaskAgentSessionKey. :param encrypted: Gets or sets a value indicating whether or not the key value is encrypted. If this value is true, the Value property should be decrypted using the RSA key exchanged with the server during registration. :type encrypted: bool :param value: Gets or sets the symmetric key value. :type value: str """ _attribute_map = { 'encrypted': {'key': 'encrypted', 'type': 'bool'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, encrypted=None, value=None): super(TaskAgentSessionKey, self).__init__() self.encrypted = encrypted self.value = value class TaskAgentUpdate(Model): """TaskAgentUpdate. :param current_state: The current state of this agent update :type current_state: str :param reason: The reason of this agent update :type reason: :class:`TaskAgentUpdateReason ` :param requested_by: The identity that request the agent update :type requested_by: :class:`IdentityRef ` :param request_time: Gets the date on which this agent update was requested. :type request_time: datetime :param source_version: Gets or sets the source agent version of the agent update :type source_version: :class:`PackageVersion ` :param target_version: Gets or sets the target agent version of the agent update :type target_version: :class:`PackageVersion ` """ _attribute_map = { 'current_state': {'key': 'currentState', 'type': 'str'}, 'reason': {'key': 'reason', 'type': 'TaskAgentUpdateReason'}, 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, 'request_time': {'key': 'requestTime', 'type': 'iso-8601'}, 'source_version': {'key': 'sourceVersion', 'type': 'PackageVersion'}, 'target_version': {'key': 'targetVersion', 'type': 'PackageVersion'} } def __init__(self, current_state=None, reason=None, requested_by=None, request_time=None, source_version=None, target_version=None): super(TaskAgentUpdate, self).__init__() self.current_state = current_state self.reason = reason self.requested_by = requested_by self.request_time = request_time self.source_version = source_version self.target_version = target_version class TaskAgentUpdateReason(Model): """TaskAgentUpdateReason. :param code: :type code: object """ _attribute_map = { 'code': {'key': 'code', 'type': 'object'} } def __init__(self, code=None): super(TaskAgentUpdateReason, self).__init__() self.code = code class TaskDefinition(Model): """TaskDefinition. :param agent_execution: :type agent_execution: :class:`TaskExecution ` :param author: :type author: str :param category: :type category: str :param contents_uploaded: :type contents_uploaded: bool :param contribution_identifier: :type contribution_identifier: str :param contribution_version: :type contribution_version: str :param data_source_bindings: :type data_source_bindings: list of :class:`DataSourceBinding ` :param definition_type: :type definition_type: str :param demands: :type demands: list of :class:`object ` :param deprecated: :type deprecated: bool :param description: :type description: str :param disabled: :type disabled: bool :param execution: :type execution: dict :param friendly_name: :type friendly_name: str :param groups: :type groups: list of :class:`TaskGroupDefinition ` :param help_mark_down: :type help_mark_down: str :param host_type: :type host_type: str :param icon_url: :type icon_url: str :param id: :type id: str :param inputs: :type inputs: list of :class:`TaskInputDefinition ` :param instance_name_format: :type instance_name_format: str :param minimum_agent_version: :type minimum_agent_version: str :param name: :type name: str :param output_variables: :type output_variables: list of :class:`TaskOutputVariable ` :param package_location: :type package_location: str :param package_type: :type package_type: str :param post_job_execution: :type post_job_execution: dict :param pre_job_execution: :type pre_job_execution: dict :param preview: :type preview: bool :param release_notes: :type release_notes: str :param runs_on: :type runs_on: list of str :param satisfies: :type satisfies: list of str :param server_owned: :type server_owned: bool :param show_environment_variables: :type show_environment_variables: bool :param source_definitions: :type source_definitions: list of :class:`TaskSourceDefinition ` :param source_location: :type source_location: str :param version: :type version: :class:`TaskVersion ` :param visibility: :type visibility: list of str """ _attribute_map = { 'agent_execution': {'key': 'agentExecution', 'type': 'TaskExecution'}, 'author': {'key': 'author', 'type': 'str'}, 'category': {'key': 'category', 'type': 'str'}, 'contents_uploaded': {'key': 'contentsUploaded', 'type': 'bool'}, 'contribution_identifier': {'key': 'contributionIdentifier', 'type': 'str'}, 'contribution_version': {'key': 'contributionVersion', 'type': 'str'}, 'data_source_bindings': {'key': 'dataSourceBindings', 'type': '[DataSourceBinding]'}, 'definition_type': {'key': 'definitionType', 'type': 'str'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'deprecated': {'key': 'deprecated', 'type': 'bool'}, 'description': {'key': 'description', 'type': 'str'}, 'disabled': {'key': 'disabled', 'type': 'bool'}, 'execution': {'key': 'execution', 'type': '{object}'}, 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'groups': {'key': 'groups', 'type': '[TaskGroupDefinition]'}, 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, 'host_type': {'key': 'hostType', 'type': 'str'}, 'icon_url': {'key': 'iconUrl', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'inputs': {'key': 'inputs', 'type': '[TaskInputDefinition]'}, 'instance_name_format': {'key': 'instanceNameFormat', 'type': 'str'}, 'minimum_agent_version': {'key': 'minimumAgentVersion', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'output_variables': {'key': 'outputVariables', 'type': '[TaskOutputVariable]'}, 'package_location': {'key': 'packageLocation', 'type': 'str'}, 'package_type': {'key': 'packageType', 'type': 'str'}, 'post_job_execution': {'key': 'postJobExecution', 'type': '{object}'}, 'pre_job_execution': {'key': 'preJobExecution', 'type': '{object}'}, 'preview': {'key': 'preview', 'type': 'bool'}, 'release_notes': {'key': 'releaseNotes', 'type': 'str'}, 'runs_on': {'key': 'runsOn', 'type': '[str]'}, 'satisfies': {'key': 'satisfies', 'type': '[str]'}, 'server_owned': {'key': 'serverOwned', 'type': 'bool'}, 'show_environment_variables': {'key': 'showEnvironmentVariables', 'type': 'bool'}, 'source_definitions': {'key': 'sourceDefinitions', 'type': '[TaskSourceDefinition]'}, 'source_location': {'key': 'sourceLocation', 'type': 'str'}, 'version': {'key': 'version', 'type': 'TaskVersion'}, 'visibility': {'key': 'visibility', 'type': '[str]'} } def __init__(self, agent_execution=None, author=None, category=None, contents_uploaded=None, contribution_identifier=None, contribution_version=None, data_source_bindings=None, definition_type=None, demands=None, deprecated=None, description=None, disabled=None, execution=None, friendly_name=None, groups=None, help_mark_down=None, host_type=None, icon_url=None, id=None, inputs=None, instance_name_format=None, minimum_agent_version=None, name=None, output_variables=None, package_location=None, package_type=None, post_job_execution=None, pre_job_execution=None, preview=None, release_notes=None, runs_on=None, satisfies=None, server_owned=None, show_environment_variables=None, source_definitions=None, source_location=None, version=None, visibility=None): super(TaskDefinition, self).__init__() self.agent_execution = agent_execution self.author = author self.category = category self.contents_uploaded = contents_uploaded self.contribution_identifier = contribution_identifier self.contribution_version = contribution_version self.data_source_bindings = data_source_bindings self.definition_type = definition_type self.demands = demands self.deprecated = deprecated self.description = description self.disabled = disabled self.execution = execution self.friendly_name = friendly_name self.groups = groups self.help_mark_down = help_mark_down self.host_type = host_type self.icon_url = icon_url self.id = id self.inputs = inputs self.instance_name_format = instance_name_format self.minimum_agent_version = minimum_agent_version self.name = name self.output_variables = output_variables self.package_location = package_location self.package_type = package_type self.post_job_execution = post_job_execution self.pre_job_execution = pre_job_execution self.preview = preview self.release_notes = release_notes self.runs_on = runs_on self.satisfies = satisfies self.server_owned = server_owned self.show_environment_variables = show_environment_variables self.source_definitions = source_definitions self.source_location = source_location self.version = version self.visibility = visibility class TaskDefinitionEndpoint(Model): """TaskDefinitionEndpoint. :param connection_id: An ID that identifies a service connection to be used for authenticating endpoint requests. :type connection_id: str :param key_selector: An Json based keyselector to filter response returned by fetching the endpoint Url.A Json based keyselector must be prefixed with "jsonpath:". KeySelector can be used to specify the filter to get the keys for the values specified with Selector. The following keyselector defines an Json for extracting nodes named 'ServiceName'. endpoint.KeySelector = "jsonpath://ServiceName"; :type key_selector: str :param scope: The scope as understood by Connected Services. Essentialy, a project-id for now. :type scope: str :param selector: An XPath/Json based selector to filter response returned by fetching the endpoint Url. An XPath based selector must be prefixed with the string "xpath:". A Json based selector must be prefixed with "jsonpath:". The following selector defines an XPath for extracting nodes named 'ServiceName'. endpoint.Selector = "xpath://ServiceName"; :type selector: str :param task_id: TaskId that this endpoint belongs to. :type task_id: str :param url: URL to GET. :type url: str """ _attribute_map = { 'connection_id': {'key': 'connectionId', 'type': 'str'}, 'key_selector': {'key': 'keySelector', 'type': 'str'}, 'scope': {'key': 'scope', 'type': 'str'}, 'selector': {'key': 'selector', 'type': 'str'}, 'task_id': {'key': 'taskId', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, connection_id=None, key_selector=None, scope=None, selector=None, task_id=None, url=None): super(TaskDefinitionEndpoint, self).__init__() self.connection_id = connection_id self.key_selector = key_selector self.scope = scope self.selector = selector self.task_id = task_id self.url = url class TaskDefinitionReference(Model): """TaskDefinitionReference. :param definition_type: Gets or sets the definition type. Values can be 'task' or 'metaTask'. :type definition_type: str :param id: Gets or sets the unique identifier of task. :type id: str :param version_spec: Gets or sets the version specification of task. :type version_spec: str """ _attribute_map = { 'definition_type': {'key': 'definitionType', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'version_spec': {'key': 'versionSpec', 'type': 'str'} } def __init__(self, definition_type=None, id=None, version_spec=None): super(TaskDefinitionReference, self).__init__() self.definition_type = definition_type self.id = id self.version_spec = version_spec class TaskExecution(Model): """TaskExecution. :param exec_task: The utility task to run. Specifying this means that this task definition is simply a meta task to call another task. This is useful for tasks that call utility tasks like powershell and commandline :type exec_task: :class:`TaskReference ` :param platform_instructions: If a task is going to run code, then this provides the type/script etc... information by platform. For example, it might look like. net45: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } net20: { typeName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShellTask", assemblyName: "Microsoft.TeamFoundation.Automation.Tasks.PowerShell.dll" } java: { jar: "powershelltask.tasks.automation.teamfoundation.microsoft.com", } node: { script: "powershellhost.js", } :type platform_instructions: dict """ _attribute_map = { 'exec_task': {'key': 'execTask', 'type': 'TaskReference'}, 'platform_instructions': {'key': 'platformInstructions', 'type': '{{str}}'} } def __init__(self, exec_task=None, platform_instructions=None): super(TaskExecution, self).__init__() self.exec_task = exec_task self.platform_instructions = platform_instructions class TaskGroup(TaskDefinition): """TaskGroup. :param agent_execution: :type agent_execution: :class:`TaskExecution ` :param author: :type author: str :param category: :type category: str :param contents_uploaded: :type contents_uploaded: bool :param contribution_identifier: :type contribution_identifier: str :param contribution_version: :type contribution_version: str :param data_source_bindings: :type data_source_bindings: list of :class:`DataSourceBinding ` :param definition_type: :type definition_type: str :param demands: :type demands: list of :class:`object ` :param deprecated: :type deprecated: bool :param description: :type description: str :param disabled: :type disabled: bool :param execution: :type execution: dict :param friendly_name: :type friendly_name: str :param groups: :type groups: list of :class:`TaskGroupDefinition ` :param help_mark_down: :type help_mark_down: str :param host_type: :type host_type: str :param icon_url: :type icon_url: str :param id: :type id: str :param inputs: :type inputs: list of :class:`TaskInputDefinition ` :param instance_name_format: :type instance_name_format: str :param minimum_agent_version: :type minimum_agent_version: str :param name: :type name: str :param output_variables: :type output_variables: list of :class:`TaskOutputVariable ` :param package_location: :type package_location: str :param package_type: :type package_type: str :param post_job_execution: :type post_job_execution: dict :param pre_job_execution: :type pre_job_execution: dict :param preview: :type preview: bool :param release_notes: :type release_notes: str :param runs_on: :type runs_on: list of str :param satisfies: :type satisfies: list of str :param server_owned: :type server_owned: bool :param show_environment_variables: :type show_environment_variables: bool :param source_definitions: :type source_definitions: list of :class:`TaskSourceDefinition ` :param source_location: :type source_location: str :param version: :type version: :class:`TaskVersion ` :param visibility: :type visibility: list of str :param comment: Gets or sets comment. :type comment: str :param created_by: Gets or sets the identity who created. :type created_by: :class:`IdentityRef ` :param created_on: Gets or sets date on which it got created. :type created_on: datetime :param deleted: Gets or sets as 'true' to indicate as deleted, 'false' otherwise. :type deleted: bool :param modified_by: Gets or sets the identity who modified. :type modified_by: :class:`IdentityRef ` :param modified_on: Gets or sets date on which it got modified. :type modified_on: datetime :param owner: Gets or sets the owner. :type owner: str :param parent_definition_id: Gets or sets parent task group Id. This is used while creating a draft task group. :type parent_definition_id: str :param revision: Gets or sets revision. :type revision: int :param tasks: Gets or sets the tasks. :type tasks: list of :class:`TaskGroupStep ` """ _attribute_map = { 'agent_execution': {'key': 'agentExecution', 'type': 'TaskExecution'}, 'author': {'key': 'author', 'type': 'str'}, 'category': {'key': 'category', 'type': 'str'}, 'contents_uploaded': {'key': 'contentsUploaded', 'type': 'bool'}, 'contribution_identifier': {'key': 'contributionIdentifier', 'type': 'str'}, 'contribution_version': {'key': 'contributionVersion', 'type': 'str'}, 'data_source_bindings': {'key': 'dataSourceBindings', 'type': '[DataSourceBinding]'}, 'definition_type': {'key': 'definitionType', 'type': 'str'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'deprecated': {'key': 'deprecated', 'type': 'bool'}, 'description': {'key': 'description', 'type': 'str'}, 'disabled': {'key': 'disabled', 'type': 'bool'}, 'execution': {'key': 'execution', 'type': '{object}'}, 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'groups': {'key': 'groups', 'type': '[TaskGroupDefinition]'}, 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, 'host_type': {'key': 'hostType', 'type': 'str'}, 'icon_url': {'key': 'iconUrl', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'inputs': {'key': 'inputs', 'type': '[TaskInputDefinition]'}, 'instance_name_format': {'key': 'instanceNameFormat', 'type': 'str'}, 'minimum_agent_version': {'key': 'minimumAgentVersion', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'output_variables': {'key': 'outputVariables', 'type': '[TaskOutputVariable]'}, 'package_location': {'key': 'packageLocation', 'type': 'str'}, 'package_type': {'key': 'packageType', 'type': 'str'}, 'post_job_execution': {'key': 'postJobExecution', 'type': '{object}'}, 'pre_job_execution': {'key': 'preJobExecution', 'type': '{object}'}, 'preview': {'key': 'preview', 'type': 'bool'}, 'release_notes': {'key': 'releaseNotes', 'type': 'str'}, 'runs_on': {'key': 'runsOn', 'type': '[str]'}, 'satisfies': {'key': 'satisfies', 'type': '[str]'}, 'server_owned': {'key': 'serverOwned', 'type': 'bool'}, 'show_environment_variables': {'key': 'showEnvironmentVariables', 'type': 'bool'}, 'source_definitions': {'key': 'sourceDefinitions', 'type': '[TaskSourceDefinition]'}, 'source_location': {'key': 'sourceLocation', 'type': 'str'}, 'version': {'key': 'version', 'type': 'TaskVersion'}, 'visibility': {'key': 'visibility', 'type': '[str]'}, 'comment': {'key': 'comment', 'type': 'str'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'deleted': {'key': 'deleted', 'type': 'bool'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'owner': {'key': 'owner', 'type': 'str'}, 'parent_definition_id': {'key': 'parentDefinitionId', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'}, 'tasks': {'key': 'tasks', 'type': '[TaskGroupStep]'} } def __init__(self, agent_execution=None, author=None, category=None, contents_uploaded=None, contribution_identifier=None, contribution_version=None, data_source_bindings=None, definition_type=None, demands=None, deprecated=None, description=None, disabled=None, execution=None, friendly_name=None, groups=None, help_mark_down=None, host_type=None, icon_url=None, id=None, inputs=None, instance_name_format=None, minimum_agent_version=None, name=None, output_variables=None, package_location=None, package_type=None, post_job_execution=None, pre_job_execution=None, preview=None, release_notes=None, runs_on=None, satisfies=None, server_owned=None, show_environment_variables=None, source_definitions=None, source_location=None, version=None, visibility=None, comment=None, created_by=None, created_on=None, deleted=None, modified_by=None, modified_on=None, owner=None, parent_definition_id=None, revision=None, tasks=None): super(TaskGroup, self).__init__(agent_execution=agent_execution, author=author, category=category, contents_uploaded=contents_uploaded, contribution_identifier=contribution_identifier, contribution_version=contribution_version, data_source_bindings=data_source_bindings, definition_type=definition_type, demands=demands, deprecated=deprecated, description=description, disabled=disabled, execution=execution, friendly_name=friendly_name, groups=groups, help_mark_down=help_mark_down, host_type=host_type, icon_url=icon_url, id=id, inputs=inputs, instance_name_format=instance_name_format, minimum_agent_version=minimum_agent_version, name=name, output_variables=output_variables, package_location=package_location, package_type=package_type, post_job_execution=post_job_execution, pre_job_execution=pre_job_execution, preview=preview, release_notes=release_notes, runs_on=runs_on, satisfies=satisfies, server_owned=server_owned, show_environment_variables=show_environment_variables, source_definitions=source_definitions, source_location=source_location, version=version, visibility=visibility) self.comment = comment self.created_by = created_by self.created_on = created_on self.deleted = deleted self.modified_by = modified_by self.modified_on = modified_on self.owner = owner self.parent_definition_id = parent_definition_id self.revision = revision self.tasks = tasks class TaskGroupCreateParameter(Model): """TaskGroupCreateParameter. :param author: Sets author name of the task group. :type author: str :param category: Sets category of the task group. :type category: str :param description: Sets description of the task group. :type description: str :param friendly_name: Sets friendly name of the task group. :type friendly_name: str :param icon_url: Sets url icon of the task group. :type icon_url: str :param inputs: Sets input for the task group. :type inputs: list of :class:`TaskInputDefinition ` :param instance_name_format: Sets display name of the task group. :type instance_name_format: str :param name: Sets name of the task group. :type name: str :param parent_definition_id: Sets parent task group Id. This is used while creating a draft task group. :type parent_definition_id: str :param runs_on: Sets RunsOn of the task group. Value can be 'Agent', 'Server' or 'DeploymentGroup'. :type runs_on: list of str :param tasks: Sets tasks for the task group. :type tasks: list of :class:`TaskGroupStep ` :param version: Sets version of the task group. :type version: :class:`TaskVersion ` """ _attribute_map = { 'author': {'key': 'author', 'type': 'str'}, 'category': {'key': 'category', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'icon_url': {'key': 'iconUrl', 'type': 'str'}, 'inputs': {'key': 'inputs', 'type': '[TaskInputDefinition]'}, 'instance_name_format': {'key': 'instanceNameFormat', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'parent_definition_id': {'key': 'parentDefinitionId', 'type': 'str'}, 'runs_on': {'key': 'runsOn', 'type': '[str]'}, 'tasks': {'key': 'tasks', 'type': '[TaskGroupStep]'}, 'version': {'key': 'version', 'type': 'TaskVersion'} } def __init__(self, author=None, category=None, description=None, friendly_name=None, icon_url=None, inputs=None, instance_name_format=None, name=None, parent_definition_id=None, runs_on=None, tasks=None, version=None): super(TaskGroupCreateParameter, self).__init__() self.author = author self.category = category self.description = description self.friendly_name = friendly_name self.icon_url = icon_url self.inputs = inputs self.instance_name_format = instance_name_format self.name = name self.parent_definition_id = parent_definition_id self.runs_on = runs_on self.tasks = tasks self.version = version class TaskGroupDefinition(Model): """TaskGroupDefinition. :param display_name: :type display_name: str :param is_expanded: :type is_expanded: bool :param name: :type name: str :param tags: :type tags: list of str :param visible_rule: :type visible_rule: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'is_expanded': {'key': 'isExpanded', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'visible_rule': {'key': 'visibleRule', 'type': 'str'} } def __init__(self, display_name=None, is_expanded=None, name=None, tags=None, visible_rule=None): super(TaskGroupDefinition, self).__init__() self.display_name = display_name self.is_expanded = is_expanded self.name = name self.tags = tags self.visible_rule = visible_rule class TaskGroupRevision(Model): """TaskGroupRevision. :param changed_by: :type changed_by: :class:`IdentityRef ` :param changed_date: :type changed_date: datetime :param change_type: :type change_type: object :param comment: :type comment: str :param file_id: :type file_id: int :param revision: :type revision: int :param task_group_id: :type task_group_id: str """ _attribute_map = { 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, 'change_type': {'key': 'changeType', 'type': 'object'}, 'comment': {'key': 'comment', 'type': 'str'}, 'file_id': {'key': 'fileId', 'type': 'int'}, 'revision': {'key': 'revision', 'type': 'int'}, 'task_group_id': {'key': 'taskGroupId', 'type': 'str'} } def __init__(self, changed_by=None, changed_date=None, change_type=None, comment=None, file_id=None, revision=None, task_group_id=None): super(TaskGroupRevision, self).__init__() self.changed_by = changed_by self.changed_date = changed_date self.change_type = change_type self.comment = comment self.file_id = file_id self.revision = revision self.task_group_id = task_group_id class TaskGroupStep(Model): """TaskGroupStep. :param always_run: Gets or sets as 'true' to run the task always, 'false' otherwise. :type always_run: bool :param condition: Gets or sets condition for the task. :type condition: str :param continue_on_error: Gets or sets as 'true' to continue on error, 'false' otherwise. :type continue_on_error: bool :param display_name: Gets or sets the display name. :type display_name: str :param enabled: Gets or sets as task is enabled or not. :type enabled: bool :param environment: Gets dictionary of environment variables. :type environment: dict :param inputs: Gets or sets dictionary of inputs. :type inputs: dict :param task: Gets or sets the reference of the task. :type task: :class:`TaskDefinitionReference ` :param timeout_in_minutes: Gets or sets the maximum time, in minutes, that a task is allowed to execute on agent before being cancelled by server. A zero value indicates an infinite timeout. :type timeout_in_minutes: int """ _attribute_map = { 'always_run': {'key': 'alwaysRun', 'type': 'bool'}, 'condition': {'key': 'condition', 'type': 'str'}, 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'environment': {'key': 'environment', 'type': '{str}'}, 'inputs': {'key': 'inputs', 'type': '{str}'}, 'task': {'key': 'task', 'type': 'TaskDefinitionReference'}, 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} } def __init__(self, always_run=None, condition=None, continue_on_error=None, display_name=None, enabled=None, environment=None, inputs=None, task=None, timeout_in_minutes=None): super(TaskGroupStep, self).__init__() self.always_run = always_run self.condition = condition self.continue_on_error = continue_on_error self.display_name = display_name self.enabled = enabled self.environment = environment self.inputs = inputs self.task = task self.timeout_in_minutes = timeout_in_minutes class TaskGroupUpdateParameter(Model): """TaskGroupUpdateParameter. :param author: Sets author name of the task group. :type author: str :param category: Sets category of the task group. :type category: str :param comment: Sets comment of the task group. :type comment: str :param description: Sets description of the task group. :type description: str :param friendly_name: Sets friendly name of the task group. :type friendly_name: str :param icon_url: Sets url icon of the task group. :type icon_url: str :param id: Sets the unique identifier of this field. :type id: str :param inputs: Sets input for the task group. :type inputs: list of :class:`TaskInputDefinition ` :param instance_name_format: Sets display name of the task group. :type instance_name_format: str :param name: Sets name of the task group. :type name: str :param parent_definition_id: Gets or sets parent task group Id. This is used while creating a draft task group. :type parent_definition_id: str :param revision: Sets revision of the task group. :type revision: int :param runs_on: Sets RunsOn of the task group. Value can be 'Agent', 'Server' or 'DeploymentGroup'. :type runs_on: list of str :param tasks: Sets tasks for the task group. :type tasks: list of :class:`TaskGroupStep ` :param version: Sets version of the task group. :type version: :class:`TaskVersion ` """ _attribute_map = { 'author': {'key': 'author', 'type': 'str'}, 'category': {'key': 'category', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'icon_url': {'key': 'iconUrl', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'inputs': {'key': 'inputs', 'type': '[TaskInputDefinition]'}, 'instance_name_format': {'key': 'instanceNameFormat', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'parent_definition_id': {'key': 'parentDefinitionId', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'}, 'runs_on': {'key': 'runsOn', 'type': '[str]'}, 'tasks': {'key': 'tasks', 'type': '[TaskGroupStep]'}, 'version': {'key': 'version', 'type': 'TaskVersion'} } def __init__(self, author=None, category=None, comment=None, description=None, friendly_name=None, icon_url=None, id=None, inputs=None, instance_name_format=None, name=None, parent_definition_id=None, revision=None, runs_on=None, tasks=None, version=None): super(TaskGroupUpdateParameter, self).__init__() self.author = author self.category = category self.comment = comment self.description = description self.friendly_name = friendly_name self.icon_url = icon_url self.id = id self.inputs = inputs self.instance_name_format = instance_name_format self.name = name self.parent_definition_id = parent_definition_id self.revision = revision self.runs_on = runs_on self.tasks = tasks self.version = version class TaskHubLicenseDetails(Model): """TaskHubLicenseDetails. :param enterprise_users_count: :type enterprise_users_count: int :param failed_to_reach_all_providers: :type failed_to_reach_all_providers: bool :param free_hosted_license_count: :type free_hosted_license_count: int :param free_license_count: :type free_license_count: int :param has_license_count_ever_updated: :type has_license_count_ever_updated: bool :param hosted_agent_minutes_free_count: :type hosted_agent_minutes_free_count: int :param hosted_agent_minutes_used_count: :type hosted_agent_minutes_used_count: int :param hosted_licenses_are_premium: :type hosted_licenses_are_premium: bool :param marketplace_purchased_hosted_licenses: :type marketplace_purchased_hosted_licenses: list of :class:`MarketplacePurchasedLicense ` :param msdn_users_count: :type msdn_users_count: int :param purchased_hosted_license_count: Microsoft-hosted licenses purchased from VSTS directly. :type purchased_hosted_license_count: int :param purchased_license_count: Self-hosted licenses purchased from VSTS directly. :type purchased_license_count: int :param total_hosted_license_count: :type total_hosted_license_count: int :param total_license_count: :type total_license_count: int :param total_private_license_count: :type total_private_license_count: int """ _attribute_map = { 'enterprise_users_count': {'key': 'enterpriseUsersCount', 'type': 'int'}, 'failed_to_reach_all_providers': {'key': 'failedToReachAllProviders', 'type': 'bool'}, 'free_hosted_license_count': {'key': 'freeHostedLicenseCount', 'type': 'int'}, 'free_license_count': {'key': 'freeLicenseCount', 'type': 'int'}, 'has_license_count_ever_updated': {'key': 'hasLicenseCountEverUpdated', 'type': 'bool'}, 'hosted_agent_minutes_free_count': {'key': 'hostedAgentMinutesFreeCount', 'type': 'int'}, 'hosted_agent_minutes_used_count': {'key': 'hostedAgentMinutesUsedCount', 'type': 'int'}, 'hosted_licenses_are_premium': {'key': 'hostedLicensesArePremium', 'type': 'bool'}, 'marketplace_purchased_hosted_licenses': {'key': 'marketplacePurchasedHostedLicenses', 'type': '[MarketplacePurchasedLicense]'}, 'msdn_users_count': {'key': 'msdnUsersCount', 'type': 'int'}, 'purchased_hosted_license_count': {'key': 'purchasedHostedLicenseCount', 'type': 'int'}, 'purchased_license_count': {'key': 'purchasedLicenseCount', 'type': 'int'}, 'total_hosted_license_count': {'key': 'totalHostedLicenseCount', 'type': 'int'}, 'total_license_count': {'key': 'totalLicenseCount', 'type': 'int'}, 'total_private_license_count': {'key': 'totalPrivateLicenseCount', 'type': 'int'} } def __init__(self, enterprise_users_count=None, failed_to_reach_all_providers=None, free_hosted_license_count=None, free_license_count=None, has_license_count_ever_updated=None, hosted_agent_minutes_free_count=None, hosted_agent_minutes_used_count=None, hosted_licenses_are_premium=None, marketplace_purchased_hosted_licenses=None, msdn_users_count=None, purchased_hosted_license_count=None, purchased_license_count=None, total_hosted_license_count=None, total_license_count=None, total_private_license_count=None): super(TaskHubLicenseDetails, self).__init__() self.enterprise_users_count = enterprise_users_count self.failed_to_reach_all_providers = failed_to_reach_all_providers self.free_hosted_license_count = free_hosted_license_count self.free_license_count = free_license_count self.has_license_count_ever_updated = has_license_count_ever_updated self.hosted_agent_minutes_free_count = hosted_agent_minutes_free_count self.hosted_agent_minutes_used_count = hosted_agent_minutes_used_count self.hosted_licenses_are_premium = hosted_licenses_are_premium self.marketplace_purchased_hosted_licenses = marketplace_purchased_hosted_licenses self.msdn_users_count = msdn_users_count self.purchased_hosted_license_count = purchased_hosted_license_count self.purchased_license_count = purchased_license_count self.total_hosted_license_count = total_hosted_license_count self.total_license_count = total_license_count self.total_private_license_count = total_private_license_count class TaskInputDefinitionBase(Model): """TaskInputDefinitionBase. :param aliases: :type aliases: list of str :param default_value: :type default_value: str :param group_name: :type group_name: str :param help_mark_down: :type help_mark_down: str :param label: :type label: str :param name: :type name: str :param options: :type options: dict :param properties: :type properties: dict :param required: :type required: bool :param type: :type type: str :param validation: :type validation: :class:`TaskInputValidation ` :param visible_rule: :type visible_rule: str """ _attribute_map = { 'aliases': {'key': 'aliases', 'type': '[str]'}, 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'options': {'key': 'options', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'str'}, 'validation': {'key': 'validation', 'type': 'TaskInputValidation'}, 'visible_rule': {'key': 'visibleRule', 'type': 'str'} } def __init__(self, aliases=None, default_value=None, group_name=None, help_mark_down=None, label=None, name=None, options=None, properties=None, required=None, type=None, validation=None, visible_rule=None): super(TaskInputDefinitionBase, self).__init__() self.aliases = aliases self.default_value = default_value self.group_name = group_name self.help_mark_down = help_mark_down self.label = label self.name = name self.options = options self.properties = properties self.required = required self.type = type self.validation = validation self.visible_rule = visible_rule class TaskInputValidation(Model): """TaskInputValidation. :param expression: Conditional expression :type expression: str :param message: Message explaining how user can correct if validation fails :type message: str """ _attribute_map = { 'expression': {'key': 'expression', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'} } def __init__(self, expression=None, message=None): super(TaskInputValidation, self).__init__() self.expression = expression self.message = message class TaskOrchestrationOwner(Model): """TaskOrchestrationOwner. :param _links: :type _links: :class:`ReferenceLinks ` :param id: :type id: int :param name: :type name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, _links=None, id=None, name=None): super(TaskOrchestrationOwner, self).__init__() self._links = _links self.id = id self.name = name class TaskOutputVariable(Model): """TaskOutputVariable. :param description: :type description: str :param name: :type name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, description=None, name=None): super(TaskOutputVariable, self).__init__() self.description = description self.name = name class TaskPackageMetadata(Model): """TaskPackageMetadata. :param type: Gets the name of the package. :type type: str :param url: Gets the url of the package. :type url: str :param version: Gets the version of the package. :type version: str """ _attribute_map = { 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, type=None, url=None, version=None): super(TaskPackageMetadata, self).__init__() self.type = type self.url = url self.version = version class TaskReference(Model): """TaskReference. :param id: :type id: str :param inputs: :type inputs: dict :param name: :type name: str :param version: :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'inputs': {'key': 'inputs', 'type': '{str}'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, inputs=None, name=None, version=None): super(TaskReference, self).__init__() self.id = id self.inputs = inputs self.name = name self.version = version class TaskSourceDefinitionBase(Model): """TaskSourceDefinitionBase. :param auth_key: :type auth_key: str :param endpoint: :type endpoint: str :param key_selector: :type key_selector: str :param selector: :type selector: str :param target: :type target: str """ _attribute_map = { 'auth_key': {'key': 'authKey', 'type': 'str'}, 'endpoint': {'key': 'endpoint', 'type': 'str'}, 'key_selector': {'key': 'keySelector', 'type': 'str'}, 'selector': {'key': 'selector', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, auth_key=None, endpoint=None, key_selector=None, selector=None, target=None): super(TaskSourceDefinitionBase, self).__init__() self.auth_key = auth_key self.endpoint = endpoint self.key_selector = key_selector self.selector = selector self.target = target class TaskVersion(Model): """TaskVersion. :param is_test: :type is_test: bool :param major: :type major: int :param minor: :type minor: int :param patch: :type patch: int """ _attribute_map = { 'is_test': {'key': 'isTest', 'type': 'bool'}, 'major': {'key': 'major', 'type': 'int'}, 'minor': {'key': 'minor', 'type': 'int'}, 'patch': {'key': 'patch', 'type': 'int'} } def __init__(self, is_test=None, major=None, minor=None, patch=None): super(TaskVersion, self).__init__() self.is_test = is_test self.major = major self.minor = minor self.patch = patch class ValidationItem(Model): """ValidationItem. :param is_valid: Tells whether the current input is valid or not :type is_valid: bool :param reason: Reason for input validation failure :type reason: str :param type: Type of validation item :type type: str :param value: Value to validate. The conditional expression to validate for the input for "expression" type Eg:eq(variables['Build.SourceBranch'], 'refs/heads/master');eq(value, 'refs/heads/master') :type value: str """ _attribute_map = { 'is_valid': {'key': 'isValid', 'type': 'bool'}, 'reason': {'key': 'reason', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, is_valid=None, reason=None, type=None, value=None): super(ValidationItem, self).__init__() self.is_valid = is_valid self.reason = reason self.type = type self.value = value class VariableGroup(Model): """VariableGroup. :param created_by: Gets or sets the identity who created the variable group. :type created_by: :class:`IdentityRef ` :param created_on: Gets or sets the time when variable group was created. :type created_on: datetime :param description: Gets or sets description of the variable group. :type description: str :param id: Gets or sets id of the variable group. :type id: int :param is_shared: Indicates whether variable group is shared with other projects or not. :type is_shared: bool :param modified_by: Gets or sets the identity who modified the variable group. :type modified_by: :class:`IdentityRef ` :param modified_on: Gets or sets the time when variable group was modified :type modified_on: datetime :param name: Gets or sets name of the variable group. :type name: str :param provider_data: Gets or sets provider data. :type provider_data: :class:`VariableGroupProviderData ` :param type: Gets or sets type of the variable group. :type type: str :param variables: Gets or sets variables contained in the variable group. :type variables: dict """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'is_shared': {'key': 'isShared', 'type': 'bool'}, 'modified_by': {'key': 'modifiedBy', 'type': 'IdentityRef'}, 'modified_on': {'key': 'modifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'provider_data': {'key': 'providerData', 'type': 'VariableGroupProviderData'}, 'type': {'key': 'type', 'type': 'str'}, 'variables': {'key': 'variables', 'type': '{VariableValue}'} } def __init__(self, created_by=None, created_on=None, description=None, id=None, is_shared=None, modified_by=None, modified_on=None, name=None, provider_data=None, type=None, variables=None): super(VariableGroup, self).__init__() self.created_by = created_by self.created_on = created_on self.description = description self.id = id self.is_shared = is_shared self.modified_by = modified_by self.modified_on = modified_on self.name = name self.provider_data = provider_data self.type = type self.variables = variables class VariableGroupParameters(Model): """VariableGroupParameters. :param description: Sets description of the variable group. :type description: str :param name: Sets name of the variable group. :type name: str :param provider_data: Sets provider data. :type provider_data: :class:`VariableGroupProviderData ` :param type: Sets type of the variable group. :type type: str :param variables: Sets variables contained in the variable group. :type variables: dict """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'provider_data': {'key': 'providerData', 'type': 'VariableGroupProviderData'}, 'type': {'key': 'type', 'type': 'str'}, 'variables': {'key': 'variables', 'type': '{VariableValue}'} } def __init__(self, description=None, name=None, provider_data=None, type=None, variables=None): super(VariableGroupParameters, self).__init__() self.description = description self.name = name self.provider_data = provider_data self.type = type self.variables = variables class VariableGroupProviderData(Model): """VariableGroupProviderData. """ _attribute_map = { } def __init__(self): super(VariableGroupProviderData, self).__init__() class VariableValue(Model): """VariableValue. :param is_secret: :type is_secret: bool :param value: :type value: str """ _attribute_map = { 'is_secret': {'key': 'isSecret', 'type': 'bool'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, is_secret=None, value=None): super(VariableValue, self).__init__() self.is_secret = is_secret self.value = value class DataSourceBinding(DataSourceBindingBase): """DataSourceBinding. :param callback_context_template: Pagination format supported by this data source(ContinuationToken/SkipTop). :type callback_context_template: str :param callback_required_template: Subsequent calls needed? :type callback_required_template: str :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: Defines the initial value of the query params :type initial_context_template: str :param parameters: Gets or sets the parameters for the data source. :type parameters: dict :param result_selector: Gets or sets the result selector. :type result_selector: str :param result_template: Gets or sets the result template. :type result_template: str :param target: Gets or sets the target of the data source. :type target: str """ _attribute_map = { 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'}, 'result_template': {'key': 'resultTemplate', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, } def __init__(self, callback_context_template=None, callback_required_template=None, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, initial_context_template=None, parameters=None, result_selector=None, result_template=None, target=None): super(DataSourceBinding, self).__init__(callback_context_template=callback_context_template, callback_required_template=callback_required_template, data_source_name=data_source_name, endpoint_id=endpoint_id, endpoint_url=endpoint_url, headers=headers, initial_context_template=initial_context_template, parameters=parameters, result_selector=result_selector, result_template=result_template, target=target) class DeploymentGroup(DeploymentGroupReference): """DeploymentGroup. :param id: Deployment group identifier. :type id: int :param name: Name of the deployment group. :type name: str :param pool: Deployment pool in which deployment agents are registered. :type pool: :class:`TaskAgentPoolReference ` :param project: Project to which the deployment group belongs. :type project: :class:`ProjectReference ` :param description: Description of the deployment group. :type description: str :param machine_count: Number of deployment targets in the deployment group. :type machine_count: int :param machines: List of deployment targets in the deployment group. :type machines: list of :class:`DeploymentMachine ` :param machine_tags: List of unique tags across all deployment targets in the deployment group. :type machine_tags: list of str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'project': {'key': 'project', 'type': 'ProjectReference'}, 'description': {'key': 'description', 'type': 'str'}, 'machine_count': {'key': 'machineCount', 'type': 'int'}, 'machines': {'key': 'machines', 'type': '[DeploymentMachine]'}, 'machine_tags': {'key': 'machineTags', 'type': '[str]'} } def __init__(self, id=None, name=None, pool=None, project=None, description=None, machine_count=None, machines=None, machine_tags=None): super(DeploymentGroup, self).__init__(id=id, name=name, pool=pool, project=project) self.description = description self.machine_count = machine_count self.machines = machines self.machine_tags = machine_tags class DeploymentMachineGroup(DeploymentMachineGroupReference): """DeploymentMachineGroup. :param id: :type id: int :param name: :type name: str :param pool: :type pool: :class:`TaskAgentPoolReference ` :param project: :type project: :class:`ProjectReference ` :param machines: :type machines: list of :class:`DeploymentMachine ` :param size: :type size: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'project': {'key': 'project', 'type': 'ProjectReference'}, 'machines': {'key': 'machines', 'type': '[DeploymentMachine]'}, 'size': {'key': 'size', 'type': 'int'} } def __init__(self, id=None, name=None, pool=None, project=None, machines=None, size=None): super(DeploymentMachineGroup, self).__init__(id=id, name=name, pool=pool, project=project) self.machines = machines self.size = size class KubernetesServiceGroup(ServiceGroup): """KubernetesServiceGroup. :param created_by: :type created_by: :class:`IdentityRef ` :param created_on: :type created_on: datetime :param environment_reference: :type environment_reference: :class:`EnvironmentReference ` :param id: :type id: int :param last_modified_by: :type last_modified_by: :class:`IdentityRef ` :param last_modified_on: :type last_modified_on: datetime :param name: :type name: str :param type: :type type: object :param namespace: :type namespace: str :param service_endpoint_id: :type service_endpoint_id: str """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'environment_reference': {'key': 'environmentReference', 'type': 'EnvironmentReference'}, 'id': {'key': 'id', 'type': 'int'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityRef'}, 'last_modified_on': {'key': 'lastModifiedOn', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'}, 'namespace': {'key': 'namespace', 'type': 'str'}, 'service_endpoint_id': {'key': 'serviceEndpointId', 'type': 'str'} } def __init__(self, created_by=None, created_on=None, environment_reference=None, id=None, last_modified_by=None, last_modified_on=None, name=None, type=None, namespace=None, service_endpoint_id=None): super(KubernetesServiceGroup, self).__init__(created_by=created_by, created_on=created_on, environment_reference=environment_reference, id=id, last_modified_by=last_modified_by, last_modified_on=last_modified_on, name=name, type=type) self.namespace = namespace self.service_endpoint_id = service_endpoint_id class TaskAgent(TaskAgentReference): """TaskAgent. :param _links: :type _links: :class:`ReferenceLinks ` :param access_point: Gets the access point of the agent. :type access_point: str :param enabled: Gets or sets a value indicating whether or not this agent should be enabled for job execution. :type enabled: bool :param id: Gets the identifier of the agent. :type id: int :param name: Gets the name of the agent. :type name: str :param os_description: Gets the OS of the agent. :type os_description: str :param provisioning_state: Gets or sets the current provisioning state of this agent :type provisioning_state: str :param status: Gets the current connectivity status of the agent. :type status: object :param version: Gets the version of the agent. :type version: str :param assigned_agent_cloud_request: Gets the Agent Cloud Request that's currently associated with this agent :type assigned_agent_cloud_request: :class:`TaskAgentCloudRequest ` :param assigned_request: Gets the request which is currently assigned to this agent. :type assigned_request: :class:`TaskAgentJobRequest ` :param authorization: Gets or sets the authorization information for this agent. :type authorization: :class:`TaskAgentAuthorization ` :param created_on: Gets the date on which this agent was created. :type created_on: datetime :param last_completed_request: Gets the last request which was completed by this agent. :type last_completed_request: :class:`TaskAgentJobRequest ` :param max_parallelism: Gets or sets the maximum job parallelism allowed on this host. :type max_parallelism: int :param pending_update: Gets the pending update for this agent. :type pending_update: :class:`TaskAgentUpdate ` :param properties: :type properties: :class:`object ` :param status_changed_on: Gets the date on which the last connectivity status change occurred. :type status_changed_on: datetime :param system_capabilities: :type system_capabilities: dict :param user_capabilities: :type user_capabilities: dict """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'access_point': {'key': 'accessPoint', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'os_description': {'key': 'osDescription', 'type': 'str'}, 'provisioning_state': {'key': 'provisioningState', 'type': 'str'}, 'status': {'key': 'status', 'type': 'object'}, 'version': {'key': 'version', 'type': 'str'}, 'assigned_agent_cloud_request': {'key': 'assignedAgentCloudRequest', 'type': 'TaskAgentCloudRequest'}, 'assigned_request': {'key': 'assignedRequest', 'type': 'TaskAgentJobRequest'}, 'authorization': {'key': 'authorization', 'type': 'TaskAgentAuthorization'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'last_completed_request': {'key': 'lastCompletedRequest', 'type': 'TaskAgentJobRequest'}, 'max_parallelism': {'key': 'maxParallelism', 'type': 'int'}, 'pending_update': {'key': 'pendingUpdate', 'type': 'TaskAgentUpdate'}, 'properties': {'key': 'properties', 'type': 'object'}, 'status_changed_on': {'key': 'statusChangedOn', 'type': 'iso-8601'}, 'system_capabilities': {'key': 'systemCapabilities', 'type': '{str}'}, 'user_capabilities': {'key': 'userCapabilities', 'type': '{str}'} } def __init__(self, _links=None, access_point=None, enabled=None, id=None, name=None, os_description=None, provisioning_state=None, status=None, version=None, assigned_agent_cloud_request=None, assigned_request=None, authorization=None, created_on=None, last_completed_request=None, max_parallelism=None, pending_update=None, properties=None, status_changed_on=None, system_capabilities=None, user_capabilities=None): super(TaskAgent, self).__init__(_links=_links, access_point=access_point, enabled=enabled, id=id, name=name, os_description=os_description, provisioning_state=provisioning_state, status=status, version=version) self.assigned_agent_cloud_request = assigned_agent_cloud_request self.assigned_request = assigned_request self.authorization = authorization self.created_on = created_on self.last_completed_request = last_completed_request self.max_parallelism = max_parallelism self.pending_update = pending_update self.properties = properties self.status_changed_on = status_changed_on self.system_capabilities = system_capabilities self.user_capabilities = user_capabilities class TaskAgentPool(TaskAgentPoolReference): """TaskAgentPool. :param id: :type id: int :param is_hosted: Gets or sets a value indicating whether or not this pool is managed by the service. :type is_hosted: bool :param name: :type name: str :param pool_type: Gets or sets the type of the pool :type pool_type: object :param scope: :type scope: str :param size: Gets the current size of the pool. :type size: int :param agent_cloud_id: Gets or sets an agentCloudId :type agent_cloud_id: int :param auto_provision: Gets or sets a value indicating whether or not a queue should be automatically provisioned for each project collection or not. :type auto_provision: bool :param auto_size: Gets or sets a value indicating whether or not the pool should autosize itself based on the Agent Cloud Provider settings :type auto_size: bool :param created_by: Gets the identity who created this pool. The creator of the pool is automatically added into the administrators group for the pool on creation. :type created_by: :class:`IdentityRef ` :param created_on: Gets the date/time of the pool creation. :type created_on: datetime :param owner: Gets the identity who owns or administrates this pool. :type owner: :class:`IdentityRef ` :param properties: :type properties: :class:`object ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'is_hosted': {'key': 'isHosted', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'pool_type': {'key': 'poolType', 'type': 'object'}, 'scope': {'key': 'scope', 'type': 'str'}, 'size': {'key': 'size', 'type': 'int'}, 'agent_cloud_id': {'key': 'agentCloudId', 'type': 'int'}, 'auto_provision': {'key': 'autoProvision', 'type': 'bool'}, 'auto_size': {'key': 'autoSize', 'type': 'bool'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'properties': {'key': 'properties', 'type': 'object'} } def __init__(self, id=None, is_hosted=None, name=None, pool_type=None, scope=None, size=None, agent_cloud_id=None, auto_provision=None, auto_size=None, created_by=None, created_on=None, owner=None, properties=None): super(TaskAgentPool, self).__init__(id=id, is_hosted=is_hosted, name=name, pool_type=pool_type, scope=scope, size=size) self.agent_cloud_id = agent_cloud_id self.auto_provision = auto_provision self.auto_size = auto_size self.created_by = created_by self.created_on = created_on self.owner = owner self.properties = properties class TaskInputDefinition(TaskInputDefinitionBase): """TaskInputDefinition. :param aliases: :type aliases: list of str :param default_value: :type default_value: str :param group_name: :type group_name: str :param help_mark_down: :type help_mark_down: str :param label: :type label: str :param name: :type name: str :param options: :type options: dict :param properties: :type properties: dict :param required: :type required: bool :param type: :type type: str :param validation: :type validation: :class:`TaskInputValidation ` :param visible_rule: :type visible_rule: str """ _attribute_map = { 'aliases': {'key': 'aliases', 'type': '[str]'}, 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'options': {'key': 'options', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'str'}, 'validation': {'key': 'validation', 'type': 'TaskInputValidation'}, 'visible_rule': {'key': 'visibleRule', 'type': 'str'}, } def __init__(self, aliases=None, default_value=None, group_name=None, help_mark_down=None, label=None, name=None, options=None, properties=None, required=None, type=None, validation=None, visible_rule=None): super(TaskInputDefinition, self).__init__(aliases=aliases, default_value=default_value, group_name=group_name, help_mark_down=help_mark_down, label=label, name=name, options=options, properties=properties, required=required, type=type, validation=validation, visible_rule=visible_rule) class TaskSourceDefinition(TaskSourceDefinitionBase): """TaskSourceDefinition. :param auth_key: :type auth_key: str :param endpoint: :type endpoint: str :param key_selector: :type key_selector: str :param selector: :type selector: str :param target: :type target: str """ _attribute_map = { 'auth_key': {'key': 'authKey', 'type': 'str'}, 'endpoint': {'key': 'endpoint', 'type': 'str'}, 'key_selector': {'key': 'keySelector', 'type': 'str'}, 'selector': {'key': 'selector', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'}, } def __init__(self, auth_key=None, endpoint=None, key_selector=None, selector=None, target=None): super(TaskSourceDefinition, self).__init__(auth_key=auth_key, endpoint=endpoint, key_selector=key_selector, selector=selector, target=target) __all__ = [ 'AadOauthTokenRequest', 'AadOauthTokenResult', 'AuthenticationSchemeReference', 'AuthorizationHeader', 'AzureManagementGroup', 'AzureManagementGroupQueryResult', 'AzureSubscription', 'AzureSubscriptionQueryResult', 'ClientCertificate', 'DataSource', 'DataSourceBindingBase', 'DataSourceDetails', 'DependencyBinding', 'DependencyData', 'DependsOn', 'DeploymentGroupCreateParameter', 'DeploymentGroupCreateParameterPoolProperty', 'DeploymentGroupMetrics', 'DeploymentGroupReference', 'DeploymentGroupUpdateParameter', 'DeploymentMachine', 'DeploymentMachineGroupReference', 'DeploymentPoolSummary', 'DeploymentTargetUpdateParameter', 'EndpointAuthorization', 'EndpointUrl', 'Environment', 'EnvironmentCreateParameter', 'EnvironmentReference', 'EnvironmentUpdateParameter', 'GraphSubjectBase', 'HelpLink', 'IdentityRef', 'InputDescriptor', 'InputValidation', 'InputValidationRequest', 'InputValue', 'InputValues', 'InputValuesError', 'KubernetesServiceGroupCreateParameters', 'MarketplacePurchasedLicense', 'MetricsColumnMetaData', 'MetricsColumnsHeader', 'MetricsRow', 'PackageMetadata', 'PackageVersion', 'ProjectReference', 'PublishTaskGroupMetadata', 'ReferenceLinks', 'ResourceLimit', 'ResourceUsage', 'ResultTransformationDetails', 'SecureFile', 'ServiceEndpoint', 'ServiceEndpointAuthenticationScheme', 'ServiceEndpointDetails', 'ServiceEndpointExecutionData', 'ServiceEndpointExecutionRecord', 'ServiceEndpointExecutionRecordsInput', 'ServiceEndpointRequest', 'ServiceEndpointRequestResult', 'ServiceEndpointType', 'ServiceGroup', 'ServiceGroupReference', 'TaskAgentAuthorization', 'TaskAgentCloud', 'TaskAgentCloudRequest', 'TaskAgentCloudType', 'TaskAgentDelaySource', 'TaskAgentJobRequest', 'TaskAgentMessage', 'TaskAgentPoolMaintenanceDefinition', 'TaskAgentPoolMaintenanceJob', 'TaskAgentPoolMaintenanceJobTargetAgent', 'TaskAgentPoolMaintenanceOptions', 'TaskAgentPoolMaintenanceRetentionPolicy', 'TaskAgentPoolMaintenanceSchedule', 'TaskAgentPoolReference', 'TaskAgentPublicKey', 'TaskAgentQueue', 'TaskAgentReference', 'TaskAgentSession', 'TaskAgentSessionKey', 'TaskAgentUpdate', 'TaskAgentUpdateReason', 'TaskDefinition', 'TaskDefinitionEndpoint', 'TaskDefinitionReference', 'TaskExecution', 'TaskGroup', 'TaskGroupCreateParameter', 'TaskGroupDefinition', 'TaskGroupRevision', 'TaskGroupStep', 'TaskGroupUpdateParameter', 'TaskHubLicenseDetails', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskOrchestrationOwner', 'TaskOutputVariable', 'TaskPackageMetadata', 'TaskReference', 'TaskSourceDefinitionBase', 'TaskVersion', 'ValidationItem', 'VariableGroup', 'VariableGroupParameters', 'VariableGroupProviderData', 'VariableValue', 'DataSourceBinding', 'DeploymentGroup', 'DeploymentMachineGroup', 'KubernetesServiceGroup', 'TaskAgent', 'TaskAgentPool', 'TaskInputDefinition', 'TaskSourceDefinition', ] task_agent_client.py000066400000000000000000000761651360605530400351650ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/task_agent# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class TaskAgentClient(Client): """TaskAgent :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TaskAgentClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'a85b8835-c1a1-4aac-ae97-1c3d0ba72dbd' def add_agent_cloud(self, agent_cloud): """AddAgentCloud. [Preview API] :param :class:` ` agent_cloud: :rtype: :class:` ` """ content = self._serialize.body(agent_cloud, 'TaskAgentCloud') response = self._send(http_method='POST', location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', version='5.0-preview.1', content=content) return self._deserialize('TaskAgentCloud', response) def delete_agent_cloud(self, agent_cloud_id): """DeleteAgentCloud. [Preview API] :param int agent_cloud_id: :rtype: :class:` ` """ route_values = {} if agent_cloud_id is not None: route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') response = self._send(http_method='DELETE', location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', version='5.0-preview.1', route_values=route_values) return self._deserialize('TaskAgentCloud', response) def get_agent_cloud(self, agent_cloud_id): """GetAgentCloud. [Preview API] :param int agent_cloud_id: :rtype: :class:` ` """ route_values = {} if agent_cloud_id is not None: route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') response = self._send(http_method='GET', location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', version='5.0-preview.1', route_values=route_values) return self._deserialize('TaskAgentCloud', response) def get_agent_clouds(self): """GetAgentClouds. [Preview API] :rtype: [TaskAgentCloud] """ response = self._send(http_method='GET', location_id='bfa72b3d-0fc6-43fb-932b-a7f6559f93b9', version='5.0-preview.1') return self._deserialize('[TaskAgentCloud]', self._unwrap_collection(response)) def get_agent_cloud_types(self): """GetAgentCloudTypes. [Preview API] Get agent cloud types. :rtype: [TaskAgentCloudType] """ response = self._send(http_method='GET', location_id='5932e193-f376-469d-9c3e-e5588ce12cb5', version='5.0-preview.1') return self._deserialize('[TaskAgentCloudType]', self._unwrap_collection(response)) def add_deployment_group(self, deployment_group, project): """AddDeploymentGroup. [Preview API] Create a deployment group. :param :class:` ` deployment_group: Deployment group to create. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(deployment_group, 'DeploymentGroupCreateParameter') response = self._send(http_method='POST', location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('DeploymentGroup', response) def delete_deployment_group(self, project, deployment_group_id): """DeleteDeploymentGroup. [Preview API] Delete a deployment group. :param str project: Project ID or project name :param int deployment_group_id: ID of the deployment group to be deleted. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if deployment_group_id is not None: route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') self._send(http_method='DELETE', location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', version='5.0-preview.1', route_values=route_values) def get_deployment_group(self, project, deployment_group_id, action_filter=None, expand=None): """GetDeploymentGroup. [Preview API] Get a deployment group by its ID. :param str project: Project ID or project name :param int deployment_group_id: ID of the deployment group. :param str action_filter: Get the deployment group only if this action can be performed on it. :param str expand: Include these additional details in the returned object. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if deployment_group_id is not None: route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') query_parameters = {} if action_filter is not None: query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('DeploymentGroup', response) def get_deployment_groups(self, project, name=None, action_filter=None, expand=None, continuation_token=None, top=None, ids=None): """GetDeploymentGroups. [Preview API] Get a list of deployment groups by name or IDs. :param str project: Project ID or project name :param str name: Name of the deployment group. :param str action_filter: Get only deployment groups on which this action can be performed. :param str expand: Include these additional details in the returned objects. :param str continuation_token: Get deployment groups with names greater than this continuationToken lexicographically. :param int top: Maximum number of deployment groups to return. Default is **1000**. :param [int] ids: Comma separated list of IDs of the deployment groups. :rtype: [DeploymentGroup] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if action_filter is not None: query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if ids is not None: ids = ",".join(map(str, ids)) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') response = self._send(http_method='GET', location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[DeploymentGroup]', self._unwrap_collection(response)) def update_deployment_group(self, deployment_group, project, deployment_group_id): """UpdateDeploymentGroup. [Preview API] Update a deployment group. :param :class:` ` deployment_group: Deployment group to update. :param str project: Project ID or project name :param int deployment_group_id: ID of the deployment group. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if deployment_group_id is not None: route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') content = self._serialize.body(deployment_group, 'DeploymentGroupUpdateParameter') response = self._send(http_method='PATCH', location_id='083c4d89-ab35-45af-aa11-7cf66895c53e', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('DeploymentGroup', response) def get_agent_cloud_requests(self, agent_cloud_id): """GetAgentCloudRequests. [Preview API] :param int agent_cloud_id: :rtype: [TaskAgentCloudRequest] """ route_values = {} if agent_cloud_id is not None: route_values['agentCloudId'] = self._serialize.url('agent_cloud_id', agent_cloud_id, 'int') response = self._send(http_method='GET', location_id='20189bd7-5134-49c2-b8e9-f9e856eea2b2', version='5.0-preview.1', route_values=route_values) return self._deserialize('[TaskAgentCloudRequest]', self._unwrap_collection(response)) def delete_deployment_target(self, project, deployment_group_id, target_id): """DeleteDeploymentTarget. [Preview API] Delete a deployment target in a deployment group. This deletes the agent from associated deployment pool too. :param str project: Project ID or project name :param int deployment_group_id: ID of the deployment group in which deployment target is deleted. :param int target_id: ID of the deployment target to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if deployment_group_id is not None: route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') if target_id is not None: route_values['targetId'] = self._serialize.url('target_id', target_id, 'int') self._send(http_method='DELETE', location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', version='5.0-preview.1', route_values=route_values) def get_deployment_target(self, project, deployment_group_id, target_id, expand=None): """GetDeploymentTarget. [Preview API] Get a deployment target by its ID in a deployment group :param str project: Project ID or project name :param int deployment_group_id: ID of the deployment group to which deployment target belongs. :param int target_id: ID of the deployment target to return. :param str expand: Include these additional details in the returned objects. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if deployment_group_id is not None: route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') if target_id is not None: route_values['targetId'] = self._serialize.url('target_id', target_id, 'int') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('DeploymentMachine', response) def get_deployment_targets(self, project, deployment_group_id, tags=None, name=None, partial_name_match=None, expand=None, agent_status=None, agent_job_result=None, continuation_token=None, top=None, enabled=None): """GetDeploymentTargets. [Preview API] Get a list of deployment targets in a deployment group. :param str project: Project ID or project name :param int deployment_group_id: ID of the deployment group. :param [str] tags: Get only the deployment targets that contain all these comma separted list of tags. :param str name: Name pattern of the deployment targets to return. :param bool partial_name_match: When set to true, treats **name** as pattern. Else treats it as absolute match. Default is **false**. :param str expand: Include these additional details in the returned objects. :param str agent_status: Get only deployment targets that have this status. :param str agent_job_result: Get only deployment targets that have this last job result. :param str continuation_token: Get deployment targets with names greater than this continuationToken lexicographically. :param int top: Maximum number of deployment targets to return. Default is **1000**. :param bool enabled: Get only deployment targets that are enabled or disabled. Default is 'null' which returns all the targets. :rtype: [DeploymentMachine] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if deployment_group_id is not None: route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') query_parameters = {} if tags is not None: tags = ",".join(tags) query_parameters['tags'] = self._serialize.query('tags', tags, 'str') if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if partial_name_match is not None: query_parameters['partialNameMatch'] = self._serialize.query('partial_name_match', partial_name_match, 'bool') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if agent_status is not None: query_parameters['agentStatus'] = self._serialize.query('agent_status', agent_status, 'str') if agent_job_result is not None: query_parameters['agentJobResult'] = self._serialize.query('agent_job_result', agent_job_result, 'str') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if enabled is not None: query_parameters['enabled'] = self._serialize.query('enabled', enabled, 'bool') response = self._send(http_method='GET', location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[DeploymentMachine]', self._unwrap_collection(response)) def update_deployment_targets(self, machines, project, deployment_group_id): """UpdateDeploymentTargets. [Preview API] Update tags of a list of deployment targets in a deployment group. :param [DeploymentTargetUpdateParameter] machines: Deployment targets with tags to udpdate. :param str project: Project ID or project name :param int deployment_group_id: ID of the deployment group in which deployment targets are updated. :rtype: [DeploymentMachine] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if deployment_group_id is not None: route_values['deploymentGroupId'] = self._serialize.url('deployment_group_id', deployment_group_id, 'int') content = self._serialize.body(machines, '[DeploymentTargetUpdateParameter]') response = self._send(http_method='PATCH', location_id='2f0aa599-c121-4256-a5fd-ba370e0ae7b6', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('[DeploymentMachine]', self._unwrap_collection(response)) def add_task_group(self, task_group, project): """AddTaskGroup. [Preview API] Create a task group. :param :class:` ` task_group: Task group object to create. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(task_group, 'TaskGroupCreateParameter') response = self._send(http_method='POST', location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('TaskGroup', response) def delete_task_group(self, project, task_group_id, comment=None): """DeleteTaskGroup. [Preview API] Delete a task group. :param str project: Project ID or project name :param str task_group_id: Id of the task group to be deleted. :param str comment: Comments to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if task_group_id is not None: route_values['taskGroupId'] = self._serialize.url('task_group_id', task_group_id, 'str') query_parameters = {} if comment is not None: query_parameters['comment'] = self._serialize.query('comment', comment, 'str') self._send(http_method='DELETE', location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) def get_task_groups(self, project, task_group_id=None, expanded=None, task_id_filter=None, deleted=None, top=None, continuation_token=None, query_order=None): """GetTaskGroups. [Preview API] List task groups. :param str project: Project ID or project name :param str task_group_id: Id of the task group. :param bool expanded: 'true' to recursively expand task groups. Default is 'false'. :param str task_id_filter: Guid of the taskId to filter. :param bool deleted: 'true'to include deleted task groups. Default is 'false'. :param int top: Number of task groups to get. :param datetime continuation_token: Gets the task groups after the continuation token provided. :param str query_order: Gets the results in the defined order. Default is 'CreatedOnDescending'. :rtype: [TaskGroup] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if task_group_id is not None: route_values['taskGroupId'] = self._serialize.url('task_group_id', task_group_id, 'str') query_parameters = {} if expanded is not None: query_parameters['expanded'] = self._serialize.query('expanded', expanded, 'bool') if task_id_filter is not None: query_parameters['taskIdFilter'] = self._serialize.query('task_id_filter', task_id_filter, 'str') if deleted is not None: query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'iso-8601') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') response = self._send(http_method='GET', location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TaskGroup]', self._unwrap_collection(response)) def update_task_group(self, task_group, project, task_group_id=None): """UpdateTaskGroup. [Preview API] Update a task group. :param :class:` ` task_group: Task group to update. :param str project: Project ID or project name :param str task_group_id: Id of the task group to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if task_group_id is not None: route_values['taskGroupId'] = self._serialize.url('task_group_id', task_group_id, 'str') content = self._serialize.body(task_group, 'TaskGroupUpdateParameter') response = self._send(http_method='PUT', location_id='6c08ffbf-dbf1-4f9a-94e5-a1cbd47005e7', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('TaskGroup', response) def add_variable_group(self, group, project): """AddVariableGroup. [Preview API] Add a variable group. :param :class:` ` group: Variable group to add. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(group, 'VariableGroupParameters') response = self._send(http_method='POST', location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('VariableGroup', response) def delete_variable_group(self, project, group_id): """DeleteVariableGroup. [Preview API] Delete a variable group :param str project: Project ID or project name :param int group_id: Id of the variable group. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') self._send(http_method='DELETE', location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', version='5.0-preview.1', route_values=route_values) def get_variable_group(self, project, group_id): """GetVariableGroup. [Preview API] Get a variable group. :param str project: Project ID or project name :param int group_id: Id of the variable group. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') response = self._send(http_method='GET', location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', version='5.0-preview.1', route_values=route_values) return self._deserialize('VariableGroup', response) def get_variable_groups(self, project, group_name=None, action_filter=None, top=None, continuation_token=None, query_order=None): """GetVariableGroups. [Preview API] Get variable groups. :param str project: Project ID or project name :param str group_name: Name of variable group. :param str action_filter: Action filter for the variable group. It specifies the action which can be performed on the variable groups. :param int top: Number of variable groups to get. :param int continuation_token: Gets the variable groups after the continuation token provided. :param str query_order: Gets the results in the defined order. Default is 'IdDescending'. :rtype: [VariableGroup] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if group_name is not None: query_parameters['groupName'] = self._serialize.query('group_name', group_name, 'str') if action_filter is not None: query_parameters['actionFilter'] = self._serialize.query('action_filter', action_filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'int') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') response = self._send(http_method='GET', location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[VariableGroup]', self._unwrap_collection(response)) def get_variable_groups_by_id(self, project, group_ids): """GetVariableGroupsById. [Preview API] Get variable groups by ids. :param str project: Project ID or project name :param [int] group_ids: Comma separated list of Ids of variable groups. :rtype: [VariableGroup] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if group_ids is not None: group_ids = ",".join(map(str, group_ids)) query_parameters['groupIds'] = self._serialize.query('group_ids', group_ids, 'str') response = self._send(http_method='GET', location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[VariableGroup]', self._unwrap_collection(response)) def update_variable_group(self, group, project, group_id): """UpdateVariableGroup. [Preview API] Update a variable group. :param :class:` ` group: Variable group to update. :param str project: Project ID or project name :param int group_id: Id of the variable group to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'int') content = self._serialize.body(group, 'VariableGroupParameters') response = self._send(http_method='PUT', location_id='f5b09dd5-9d54-45a1-8b5a-1c8287d634cc', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('VariableGroup', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/test/000077500000000000000000000000001360605530400300345ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/test/__init__.py000066400000000000000000000066061360605530400321550ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .test_client import TestClient __all__ = [ 'AggregatedDataForResultTrend', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', 'AggregatedRunsByOutcome', 'AggregatedRunsByState', 'BuildConfiguration', 'BuildCoverage', 'BuildReference', 'CloneOperationInformation', 'CloneOptions', 'CloneStatistics', 'CodeCoverageData', 'CodeCoverageStatistics', 'CodeCoverageSummary', 'CoverageStatistics', 'CustomTestField', 'CustomTestFieldDefinition', 'DtlEnvironmentDetails', 'FailingSince', 'FieldDetailsForTestResults', 'FunctionCoverage', 'GraphSubjectBase', 'IdentityRef', 'LastResultDetails', 'LinkedWorkItemsQuery', 'LinkedWorkItemsQueryResult', 'ModuleCoverage', 'NameValuePair', 'PlanUpdateModel', 'PointAssignment', 'PointsFilter', 'PointUpdateModel', 'PropertyBag', 'QueryModel', 'ReferenceLinks', 'ReleaseEnvironmentDefinitionReference', 'ReleaseReference', 'ResultRetentionSettings', 'ResultsFilter', 'RunCreateModel', 'RunFilter', 'RunStatistic', 'RunUpdateModel', 'ShallowReference', 'ShallowTestCaseResult', 'SharedStepModel', 'SuiteCreateModel', 'SuiteEntry', 'SuiteEntryUpdateModel', 'SuiteTestCase', 'SuiteTestCaseUpdateModel', 'SuiteUpdateModel', 'TeamContext', 'TeamProjectReference', 'TestActionResultModel', 'TestAttachment', 'TestAttachmentReference', 'TestAttachmentRequestModel', 'TestCaseResult', 'TestCaseResultAttachmentModel', 'TestCaseResultIdentifier', 'TestCaseResultUpdateModel', 'TestConfiguration', 'TestEnvironment', 'TestFailureDetails', 'TestFailuresAnalysis', 'TestHistoryQuery', 'TestIterationDetailsModel', 'TestMessageLogDetails', 'TestMethod', 'TestOperationReference', 'TestOutcomeSettings', 'TestPlan', 'TestPlanCloneRequest', 'TestPoint', 'TestPointsQuery', 'TestResolutionState', 'TestResultCreateModel', 'TestResultDocument', 'TestResultHistory', 'TestResultHistoryDetailsForGroup', 'TestResultHistoryForGroup', 'TestResultMetaData', 'TestResultModelBase', 'TestResultParameterModel', 'TestResultPayload', 'TestResultsContext', 'TestResultsDetails', 'TestResultsDetailsForGroup', 'TestResultsGroupsForBuild', 'TestResultsGroupsForRelease', 'TestResultsQuery', 'TestResultSummary', 'TestResultTrendFilter', 'TestRun', 'TestRunCoverage', 'TestRunStatistic', 'TestSession', 'TestSettings', 'TestSubResult', 'TestSuite', 'TestSuiteCloneRequest', 'TestSummaryForWorkItem', 'TestToWorkItemLinks', 'TestVariable', 'WorkItemReference', 'WorkItemToTestLinks', 'TestClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/test/models.py000066400000000000000000005642111360605530400317020ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AggregatedDataForResultTrend(Model): """AggregatedDataForResultTrend. :param duration: This is tests execution duration. :type duration: object :param results_by_outcome: :type results_by_outcome: dict :param run_summary_by_state: :type run_summary_by_state: dict :param test_results_context: :type test_results_context: :class:`TestResultsContext ` :param total_tests: :type total_tests: int """ _attribute_map = { 'duration': {'key': 'duration', 'type': 'object'}, 'results_by_outcome': {'key': 'resultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'run_summary_by_state': {'key': 'runSummaryByState', 'type': '{AggregatedRunsByState}'}, 'test_results_context': {'key': 'testResultsContext', 'type': 'TestResultsContext'}, 'total_tests': {'key': 'totalTests', 'type': 'int'} } def __init__(self, duration=None, results_by_outcome=None, run_summary_by_state=None, test_results_context=None, total_tests=None): super(AggregatedDataForResultTrend, self).__init__() self.duration = duration self.results_by_outcome = results_by_outcome self.run_summary_by_state = run_summary_by_state self.test_results_context = test_results_context self.total_tests = total_tests class AggregatedResultsAnalysis(Model): """AggregatedResultsAnalysis. :param duration: :type duration: object :param not_reported_results_by_outcome: :type not_reported_results_by_outcome: dict :param previous_context: :type previous_context: :class:`TestResultsContext ` :param results_by_outcome: :type results_by_outcome: dict :param results_difference: :type results_difference: :class:`AggregatedResultsDifference ` :param run_summary_by_outcome: :type run_summary_by_outcome: dict :param run_summary_by_state: :type run_summary_by_state: dict :param total_tests: :type total_tests: int """ _attribute_map = { 'duration': {'key': 'duration', 'type': 'object'}, 'not_reported_results_by_outcome': {'key': 'notReportedResultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'previous_context': {'key': 'previousContext', 'type': 'TestResultsContext'}, 'results_by_outcome': {'key': 'resultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'results_difference': {'key': 'resultsDifference', 'type': 'AggregatedResultsDifference'}, 'run_summary_by_outcome': {'key': 'runSummaryByOutcome', 'type': '{AggregatedRunsByOutcome}'}, 'run_summary_by_state': {'key': 'runSummaryByState', 'type': '{AggregatedRunsByState}'}, 'total_tests': {'key': 'totalTests', 'type': 'int'} } def __init__(self, duration=None, not_reported_results_by_outcome=None, previous_context=None, results_by_outcome=None, results_difference=None, run_summary_by_outcome=None, run_summary_by_state=None, total_tests=None): super(AggregatedResultsAnalysis, self).__init__() self.duration = duration self.not_reported_results_by_outcome = not_reported_results_by_outcome self.previous_context = previous_context self.results_by_outcome = results_by_outcome self.results_difference = results_difference self.run_summary_by_outcome = run_summary_by_outcome self.run_summary_by_state = run_summary_by_state self.total_tests = total_tests class AggregatedResultsByOutcome(Model): """AggregatedResultsByOutcome. :param count: :type count: int :param duration: :type duration: object :param group_by_field: :type group_by_field: str :param group_by_value: :type group_by_value: object :param outcome: :type outcome: object :param rerun_result_count: :type rerun_result_count: int """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'duration': {'key': 'duration', 'type': 'object'}, 'group_by_field': {'key': 'groupByField', 'type': 'str'}, 'group_by_value': {'key': 'groupByValue', 'type': 'object'}, 'outcome': {'key': 'outcome', 'type': 'object'}, 'rerun_result_count': {'key': 'rerunResultCount', 'type': 'int'} } def __init__(self, count=None, duration=None, group_by_field=None, group_by_value=None, outcome=None, rerun_result_count=None): super(AggregatedResultsByOutcome, self).__init__() self.count = count self.duration = duration self.group_by_field = group_by_field self.group_by_value = group_by_value self.outcome = outcome self.rerun_result_count = rerun_result_count class AggregatedResultsDifference(Model): """AggregatedResultsDifference. :param increase_in_duration: :type increase_in_duration: object :param increase_in_failures: :type increase_in_failures: int :param increase_in_other_tests: :type increase_in_other_tests: int :param increase_in_passed_tests: :type increase_in_passed_tests: int :param increase_in_total_tests: :type increase_in_total_tests: int """ _attribute_map = { 'increase_in_duration': {'key': 'increaseInDuration', 'type': 'object'}, 'increase_in_failures': {'key': 'increaseInFailures', 'type': 'int'}, 'increase_in_other_tests': {'key': 'increaseInOtherTests', 'type': 'int'}, 'increase_in_passed_tests': {'key': 'increaseInPassedTests', 'type': 'int'}, 'increase_in_total_tests': {'key': 'increaseInTotalTests', 'type': 'int'} } def __init__(self, increase_in_duration=None, increase_in_failures=None, increase_in_other_tests=None, increase_in_passed_tests=None, increase_in_total_tests=None): super(AggregatedResultsDifference, self).__init__() self.increase_in_duration = increase_in_duration self.increase_in_failures = increase_in_failures self.increase_in_other_tests = increase_in_other_tests self.increase_in_passed_tests = increase_in_passed_tests self.increase_in_total_tests = increase_in_total_tests class AggregatedRunsByOutcome(Model): """AggregatedRunsByOutcome. :param outcome: :type outcome: object :param runs_count: :type runs_count: int """ _attribute_map = { 'outcome': {'key': 'outcome', 'type': 'object'}, 'runs_count': {'key': 'runsCount', 'type': 'int'} } def __init__(self, outcome=None, runs_count=None): super(AggregatedRunsByOutcome, self).__init__() self.outcome = outcome self.runs_count = runs_count class AggregatedRunsByState(Model): """AggregatedRunsByState. :param results_by_outcome: :type results_by_outcome: dict :param runs_count: :type runs_count: int :param state: :type state: object """ _attribute_map = { 'results_by_outcome': {'key': 'resultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'runs_count': {'key': 'runsCount', 'type': 'int'}, 'state': {'key': 'state', 'type': 'object'} } def __init__(self, results_by_outcome=None, runs_count=None, state=None): super(AggregatedRunsByState, self).__init__() self.results_by_outcome = results_by_outcome self.runs_count = runs_count self.state = state class BuildConfiguration(Model): """BuildConfiguration. :param branch_name: :type branch_name: str :param build_definition_id: :type build_definition_id: int :param build_system: :type build_system: str :param creation_date: :type creation_date: datetime :param flavor: :type flavor: str :param id: :type id: int :param number: :type number: str :param platform: :type platform: str :param project: :type project: :class:`ShallowReference ` :param repository_guid: :type repository_guid: str :param repository_id: :type repository_id: int :param repository_type: :type repository_type: str :param source_version: :type source_version: str :param uri: :type uri: str """ _attribute_map = { 'branch_name': {'key': 'branchName', 'type': 'str'}, 'build_definition_id': {'key': 'buildDefinitionId', 'type': 'int'}, 'build_system': {'key': 'buildSystem', 'type': 'str'}, 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, 'flavor': {'key': 'flavor', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'number': {'key': 'number', 'type': 'str'}, 'platform': {'key': 'platform', 'type': 'str'}, 'project': {'key': 'project', 'type': 'ShallowReference'}, 'repository_guid': {'key': 'repositoryGuid', 'type': 'str'}, 'repository_id': {'key': 'repositoryId', 'type': 'int'}, 'repository_type': {'key': 'repositoryType', 'type': 'str'}, 'source_version': {'key': 'sourceVersion', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'} } def __init__(self, branch_name=None, build_definition_id=None, build_system=None, creation_date=None, flavor=None, id=None, number=None, platform=None, project=None, repository_guid=None, repository_id=None, repository_type=None, source_version=None, uri=None): super(BuildConfiguration, self).__init__() self.branch_name = branch_name self.build_definition_id = build_definition_id self.build_system = build_system self.creation_date = creation_date self.flavor = flavor self.id = id self.number = number self.platform = platform self.project = project self.repository_guid = repository_guid self.repository_id = repository_id self.repository_type = repository_type self.source_version = source_version self.uri = uri class BuildCoverage(Model): """BuildCoverage. :param code_coverage_file_url: Code Coverage File Url :type code_coverage_file_url: str :param configuration: Build Configuration :type configuration: :class:`BuildConfiguration ` :param last_error: Last Error :type last_error: str :param modules: List of Modules :type modules: list of :class:`ModuleCoverage ` :param state: State :type state: str """ _attribute_map = { 'code_coverage_file_url': {'key': 'codeCoverageFileUrl', 'type': 'str'}, 'configuration': {'key': 'configuration', 'type': 'BuildConfiguration'}, 'last_error': {'key': 'lastError', 'type': 'str'}, 'modules': {'key': 'modules', 'type': '[ModuleCoverage]'}, 'state': {'key': 'state', 'type': 'str'} } def __init__(self, code_coverage_file_url=None, configuration=None, last_error=None, modules=None, state=None): super(BuildCoverage, self).__init__() self.code_coverage_file_url = code_coverage_file_url self.configuration = configuration self.last_error = last_error self.modules = modules self.state = state class BuildReference(Model): """BuildReference. :param branch_name: Branch name. :type branch_name: str :param build_system: Build system. :type build_system: str :param definition_id: Build Definition ID. :type definition_id: int :param id: Build ID. :type id: int :param number: Build Number. :type number: str :param repository_id: Repository ID. :type repository_id: str :param uri: Build URI. :type uri: str """ _attribute_map = { 'branch_name': {'key': 'branchName', 'type': 'str'}, 'build_system': {'key': 'buildSystem', 'type': 'str'}, 'definition_id': {'key': 'definitionId', 'type': 'int'}, 'id': {'key': 'id', 'type': 'int'}, 'number': {'key': 'number', 'type': 'str'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'}, 'uri': {'key': 'uri', 'type': 'str'} } def __init__(self, branch_name=None, build_system=None, definition_id=None, id=None, number=None, repository_id=None, uri=None): super(BuildReference, self).__init__() self.branch_name = branch_name self.build_system = build_system self.definition_id = definition_id self.id = id self.number = number self.repository_id = repository_id self.uri = uri class CloneOperationInformation(Model): """CloneOperationInformation. :param clone_statistics: Clone Statistics :type clone_statistics: :class:`CloneStatistics ` :param completion_date: If the operation is complete, the DateTime of completion. If operation is not complete, this is DateTime.MaxValue :type completion_date: datetime :param creation_date: DateTime when the operation was started :type creation_date: datetime :param destination_object: Shallow reference of the destination :type destination_object: :class:`ShallowReference ` :param destination_plan: Shallow reference of the destination :type destination_plan: :class:`ShallowReference ` :param destination_project: Shallow reference of the destination :type destination_project: :class:`ShallowReference ` :param message: If the operation has Failed, Message contains the reason for failure. Null otherwise. :type message: str :param op_id: The ID of the operation :type op_id: int :param result_object_type: The type of the object generated as a result of the Clone operation :type result_object_type: object :param source_object: Shallow reference of the source :type source_object: :class:`ShallowReference ` :param source_plan: Shallow reference of the source :type source_plan: :class:`ShallowReference ` :param source_project: Shallow reference of the source :type source_project: :class:`ShallowReference ` :param state: Current state of the operation. When State reaches Suceeded or Failed, the operation is complete :type state: object :param url: Url for geting the clone information :type url: str """ _attribute_map = { 'clone_statistics': {'key': 'cloneStatistics', 'type': 'CloneStatistics'}, 'completion_date': {'key': 'completionDate', 'type': 'iso-8601'}, 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, 'destination_object': {'key': 'destinationObject', 'type': 'ShallowReference'}, 'destination_plan': {'key': 'destinationPlan', 'type': 'ShallowReference'}, 'destination_project': {'key': 'destinationProject', 'type': 'ShallowReference'}, 'message': {'key': 'message', 'type': 'str'}, 'op_id': {'key': 'opId', 'type': 'int'}, 'result_object_type': {'key': 'resultObjectType', 'type': 'object'}, 'source_object': {'key': 'sourceObject', 'type': 'ShallowReference'}, 'source_plan': {'key': 'sourcePlan', 'type': 'ShallowReference'}, 'source_project': {'key': 'sourceProject', 'type': 'ShallowReference'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, clone_statistics=None, completion_date=None, creation_date=None, destination_object=None, destination_plan=None, destination_project=None, message=None, op_id=None, result_object_type=None, source_object=None, source_plan=None, source_project=None, state=None, url=None): super(CloneOperationInformation, self).__init__() self.clone_statistics = clone_statistics self.completion_date = completion_date self.creation_date = creation_date self.destination_object = destination_object self.destination_plan = destination_plan self.destination_project = destination_project self.message = message self.op_id = op_id self.result_object_type = result_object_type self.source_object = source_object self.source_plan = source_plan self.source_project = source_project self.state = state self.url = url class CloneOptions(Model): """CloneOptions. :param clone_requirements: If set to true requirements will be cloned :type clone_requirements: bool :param copy_all_suites: copy all suites from a source plan :type copy_all_suites: bool :param copy_ancestor_hierarchy: copy ancestor hieracrchy :type copy_ancestor_hierarchy: bool :param destination_work_item_type: Name of the workitem type of the clone :type destination_work_item_type: str :param override_parameters: Key value pairs where the key value is overridden by the value. :type override_parameters: dict :param related_link_comment: Comment on the link that will link the new clone test case to the original Set null for no comment :type related_link_comment: str """ _attribute_map = { 'clone_requirements': {'key': 'cloneRequirements', 'type': 'bool'}, 'copy_all_suites': {'key': 'copyAllSuites', 'type': 'bool'}, 'copy_ancestor_hierarchy': {'key': 'copyAncestorHierarchy', 'type': 'bool'}, 'destination_work_item_type': {'key': 'destinationWorkItemType', 'type': 'str'}, 'override_parameters': {'key': 'overrideParameters', 'type': '{str}'}, 'related_link_comment': {'key': 'relatedLinkComment', 'type': 'str'} } def __init__(self, clone_requirements=None, copy_all_suites=None, copy_ancestor_hierarchy=None, destination_work_item_type=None, override_parameters=None, related_link_comment=None): super(CloneOptions, self).__init__() self.clone_requirements = clone_requirements self.copy_all_suites = copy_all_suites self.copy_ancestor_hierarchy = copy_ancestor_hierarchy self.destination_work_item_type = destination_work_item_type self.override_parameters = override_parameters self.related_link_comment = related_link_comment class CloneStatistics(Model): """CloneStatistics. :param cloned_requirements_count: Number of Requirments cloned so far. :type cloned_requirements_count: int :param cloned_shared_steps_count: Number of shared steps cloned so far. :type cloned_shared_steps_count: int :param cloned_test_cases_count: Number of test cases cloned so far :type cloned_test_cases_count: int :param total_requirements_count: Total number of requirements to be cloned :type total_requirements_count: int :param total_test_cases_count: Total number of test cases to be cloned :type total_test_cases_count: int """ _attribute_map = { 'cloned_requirements_count': {'key': 'clonedRequirementsCount', 'type': 'int'}, 'cloned_shared_steps_count': {'key': 'clonedSharedStepsCount', 'type': 'int'}, 'cloned_test_cases_count': {'key': 'clonedTestCasesCount', 'type': 'int'}, 'total_requirements_count': {'key': 'totalRequirementsCount', 'type': 'int'}, 'total_test_cases_count': {'key': 'totalTestCasesCount', 'type': 'int'} } def __init__(self, cloned_requirements_count=None, cloned_shared_steps_count=None, cloned_test_cases_count=None, total_requirements_count=None, total_test_cases_count=None): super(CloneStatistics, self).__init__() self.cloned_requirements_count = cloned_requirements_count self.cloned_shared_steps_count = cloned_shared_steps_count self.cloned_test_cases_count = cloned_test_cases_count self.total_requirements_count = total_requirements_count self.total_test_cases_count = total_test_cases_count class CodeCoverageData(Model): """CodeCoverageData. :param build_flavor: Flavor of build for which data is retrieved/published :type build_flavor: str :param build_platform: Platform of build for which data is retrieved/published :type build_platform: str :param coverage_stats: List of coverage data for the build :type coverage_stats: list of :class:`CodeCoverageStatistics ` """ _attribute_map = { 'build_flavor': {'key': 'buildFlavor', 'type': 'str'}, 'build_platform': {'key': 'buildPlatform', 'type': 'str'}, 'coverage_stats': {'key': 'coverageStats', 'type': '[CodeCoverageStatistics]'} } def __init__(self, build_flavor=None, build_platform=None, coverage_stats=None): super(CodeCoverageData, self).__init__() self.build_flavor = build_flavor self.build_platform = build_platform self.coverage_stats = coverage_stats class CodeCoverageStatistics(Model): """CodeCoverageStatistics. :param covered: Covered units :type covered: int :param delta: Delta of coverage :type delta: float :param is_delta_available: Is delta valid :type is_delta_available: bool :param label: Label of coverage data ("Blocks", "Statements", "Modules", etc.) :type label: str :param position: Position of label :type position: int :param total: Total units :type total: int """ _attribute_map = { 'covered': {'key': 'covered', 'type': 'int'}, 'delta': {'key': 'delta', 'type': 'float'}, 'is_delta_available': {'key': 'isDeltaAvailable', 'type': 'bool'}, 'label': {'key': 'label', 'type': 'str'}, 'position': {'key': 'position', 'type': 'int'}, 'total': {'key': 'total', 'type': 'int'} } def __init__(self, covered=None, delta=None, is_delta_available=None, label=None, position=None, total=None): super(CodeCoverageStatistics, self).__init__() self.covered = covered self.delta = delta self.is_delta_available = is_delta_available self.label = label self.position = position self.total = total class CodeCoverageSummary(Model): """CodeCoverageSummary. :param build: Uri of build for which data is retrieved/published :type build: :class:`ShallowReference ` :param coverage_data: List of coverage data and details for the build :type coverage_data: list of :class:`CodeCoverageData ` :param delta_build: Uri of build against which difference in coverage is computed :type delta_build: :class:`ShallowReference ` """ _attribute_map = { 'build': {'key': 'build', 'type': 'ShallowReference'}, 'coverage_data': {'key': 'coverageData', 'type': '[CodeCoverageData]'}, 'delta_build': {'key': 'deltaBuild', 'type': 'ShallowReference'} } def __init__(self, build=None, coverage_data=None, delta_build=None): super(CodeCoverageSummary, self).__init__() self.build = build self.coverage_data = coverage_data self.delta_build = delta_build class CoverageStatistics(Model): """CoverageStatistics. :param blocks_covered: :type blocks_covered: int :param blocks_not_covered: :type blocks_not_covered: int :param lines_covered: :type lines_covered: int :param lines_not_covered: :type lines_not_covered: int :param lines_partially_covered: :type lines_partially_covered: int """ _attribute_map = { 'blocks_covered': {'key': 'blocksCovered', 'type': 'int'}, 'blocks_not_covered': {'key': 'blocksNotCovered', 'type': 'int'}, 'lines_covered': {'key': 'linesCovered', 'type': 'int'}, 'lines_not_covered': {'key': 'linesNotCovered', 'type': 'int'}, 'lines_partially_covered': {'key': 'linesPartiallyCovered', 'type': 'int'} } def __init__(self, blocks_covered=None, blocks_not_covered=None, lines_covered=None, lines_not_covered=None, lines_partially_covered=None): super(CoverageStatistics, self).__init__() self.blocks_covered = blocks_covered self.blocks_not_covered = blocks_not_covered self.lines_covered = lines_covered self.lines_not_covered = lines_not_covered self.lines_partially_covered = lines_partially_covered class CustomTestField(Model): """CustomTestField. :param field_name: Field Name. :type field_name: str :param value: Field value. :type value: object """ _attribute_map = { 'field_name': {'key': 'fieldName', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, field_name=None, value=None): super(CustomTestField, self).__init__() self.field_name = field_name self.value = value class CustomTestFieldDefinition(Model): """CustomTestFieldDefinition. :param field_id: :type field_id: int :param field_name: :type field_name: str :param field_type: :type field_type: object :param scope: :type scope: object """ _attribute_map = { 'field_id': {'key': 'fieldId', 'type': 'int'}, 'field_name': {'key': 'fieldName', 'type': 'str'}, 'field_type': {'key': 'fieldType', 'type': 'object'}, 'scope': {'key': 'scope', 'type': 'object'} } def __init__(self, field_id=None, field_name=None, field_type=None, scope=None): super(CustomTestFieldDefinition, self).__init__() self.field_id = field_id self.field_name = field_name self.field_type = field_type self.scope = scope class DtlEnvironmentDetails(Model): """DtlEnvironmentDetails. :param csm_content: :type csm_content: str :param csm_parameters: :type csm_parameters: str :param subscription_name: :type subscription_name: str """ _attribute_map = { 'csm_content': {'key': 'csmContent', 'type': 'str'}, 'csm_parameters': {'key': 'csmParameters', 'type': 'str'}, 'subscription_name': {'key': 'subscriptionName', 'type': 'str'} } def __init__(self, csm_content=None, csm_parameters=None, subscription_name=None): super(DtlEnvironmentDetails, self).__init__() self.csm_content = csm_content self.csm_parameters = csm_parameters self.subscription_name = subscription_name class FailingSince(Model): """FailingSince. :param build: Build reference since failing. :type build: :class:`BuildReference ` :param date: Time since failing. :type date: datetime :param release: Release reference since failing. :type release: :class:`ReleaseReference ` """ _attribute_map = { 'build': {'key': 'build', 'type': 'BuildReference'}, 'date': {'key': 'date', 'type': 'iso-8601'}, 'release': {'key': 'release', 'type': 'ReleaseReference'} } def __init__(self, build=None, date=None, release=None): super(FailingSince, self).__init__() self.build = build self.date = date self.release = release class FieldDetailsForTestResults(Model): """FieldDetailsForTestResults. :param field_name: Group by field name :type field_name: str :param groups_for_field: Group by field values :type groups_for_field: list of object """ _attribute_map = { 'field_name': {'key': 'fieldName', 'type': 'str'}, 'groups_for_field': {'key': 'groupsForField', 'type': '[object]'} } def __init__(self, field_name=None, groups_for_field=None): super(FieldDetailsForTestResults, self).__init__() self.field_name = field_name self.groups_for_field = groups_for_field class FunctionCoverage(Model): """FunctionCoverage. :param class_: :type class_: str :param name: :type name: str :param namespace: :type namespace: str :param source_file: :type source_file: str :param statistics: :type statistics: :class:`CoverageStatistics ` """ _attribute_map = { 'class_': {'key': 'class', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'namespace': {'key': 'namespace', 'type': 'str'}, 'source_file': {'key': 'sourceFile', 'type': 'str'}, 'statistics': {'key': 'statistics', 'type': 'CoverageStatistics'} } def __init__(self, class_=None, name=None, namespace=None, source_file=None, statistics=None): super(FunctionCoverage, self).__init__() self.class_ = class_ self.name = name self.namespace = namespace self.source_file = source_file self.statistics = statistics class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class LastResultDetails(Model): """LastResultDetails. :param date_completed: :type date_completed: datetime :param duration: :type duration: long :param run_by: :type run_by: :class:`IdentityRef ` """ _attribute_map = { 'date_completed': {'key': 'dateCompleted', 'type': 'iso-8601'}, 'duration': {'key': 'duration', 'type': 'long'}, 'run_by': {'key': 'runBy', 'type': 'IdentityRef'} } def __init__(self, date_completed=None, duration=None, run_by=None): super(LastResultDetails, self).__init__() self.date_completed = date_completed self.duration = duration self.run_by = run_by class LinkedWorkItemsQuery(Model): """LinkedWorkItemsQuery. :param automated_test_names: :type automated_test_names: list of str :param plan_id: :type plan_id: int :param point_ids: :type point_ids: list of int :param suite_ids: :type suite_ids: list of int :param test_case_ids: :type test_case_ids: list of int :param work_item_category: :type work_item_category: str """ _attribute_map = { 'automated_test_names': {'key': 'automatedTestNames', 'type': '[str]'}, 'plan_id': {'key': 'planId', 'type': 'int'}, 'point_ids': {'key': 'pointIds', 'type': '[int]'}, 'suite_ids': {'key': 'suiteIds', 'type': '[int]'}, 'test_case_ids': {'key': 'testCaseIds', 'type': '[int]'}, 'work_item_category': {'key': 'workItemCategory', 'type': 'str'} } def __init__(self, automated_test_names=None, plan_id=None, point_ids=None, suite_ids=None, test_case_ids=None, work_item_category=None): super(LinkedWorkItemsQuery, self).__init__() self.automated_test_names = automated_test_names self.plan_id = plan_id self.point_ids = point_ids self.suite_ids = suite_ids self.test_case_ids = test_case_ids self.work_item_category = work_item_category class LinkedWorkItemsQueryResult(Model): """LinkedWorkItemsQueryResult. :param automated_test_name: :type automated_test_name: str :param plan_id: :type plan_id: int :param point_id: :type point_id: int :param suite_id: :type suite_id: int :param test_case_id: :type test_case_id: int :param work_items: :type work_items: list of :class:`WorkItemReference ` """ _attribute_map = { 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, 'plan_id': {'key': 'planId', 'type': 'int'}, 'point_id': {'key': 'pointId', 'type': 'int'}, 'suite_id': {'key': 'suiteId', 'type': 'int'}, 'test_case_id': {'key': 'testCaseId', 'type': 'int'}, 'work_items': {'key': 'workItems', 'type': '[WorkItemReference]'} } def __init__(self, automated_test_name=None, plan_id=None, point_id=None, suite_id=None, test_case_id=None, work_items=None): super(LinkedWorkItemsQueryResult, self).__init__() self.automated_test_name = automated_test_name self.plan_id = plan_id self.point_id = point_id self.suite_id = suite_id self.test_case_id = test_case_id self.work_items = work_items class ModuleCoverage(Model): """ModuleCoverage. :param block_count: :type block_count: int :param block_data: :type block_data: str :param file_url: Code Coverage File Url :type file_url: str :param functions: :type functions: list of :class:`FunctionCoverage ` :param name: :type name: str :param signature: :type signature: str :param signature_age: :type signature_age: int :param statistics: :type statistics: :class:`CoverageStatistics ` """ _attribute_map = { 'block_count': {'key': 'blockCount', 'type': 'int'}, 'block_data': {'key': 'blockData', 'type': 'str'}, 'file_url': {'key': 'fileUrl', 'type': 'str'}, 'functions': {'key': 'functions', 'type': '[FunctionCoverage]'}, 'name': {'key': 'name', 'type': 'str'}, 'signature': {'key': 'signature', 'type': 'str'}, 'signature_age': {'key': 'signatureAge', 'type': 'int'}, 'statistics': {'key': 'statistics', 'type': 'CoverageStatistics'} } def __init__(self, block_count=None, block_data=None, file_url=None, functions=None, name=None, signature=None, signature_age=None, statistics=None): super(ModuleCoverage, self).__init__() self.block_count = block_count self.block_data = block_data self.file_url = file_url self.functions = functions self.name = name self.signature = signature self.signature_age = signature_age self.statistics = statistics class NameValuePair(Model): """NameValuePair. :param name: Name :type name: str :param value: Value :type value: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, name=None, value=None): super(NameValuePair, self).__init__() self.name = name self.value = value class PlanUpdateModel(Model): """PlanUpdateModel. :param area: Area path to which the test plan belongs. This should be set to area path of the team that works on this test plan. :type area: :class:`ShallowReference ` :param automated_test_environment: :type automated_test_environment: :class:`TestEnvironment ` :param automated_test_settings: :type automated_test_settings: :class:`TestSettings ` :param build: Build ID of the build whose quality is tested by the tests in this test plan. For automated testing, this build ID is used to find the test binaries that contain automated test methods. :type build: :class:`ShallowReference ` :param build_definition: The Build Definition that generates a build associated with this test plan. :type build_definition: :class:`ShallowReference ` :param configuration_ids: IDs of configurations to be applied when new test suites and test cases are added to the test plan. :type configuration_ids: list of int :param description: Description of the test plan. :type description: str :param end_date: End date for the test plan. :type end_date: str :param iteration: Iteration path assigned to the test plan. This indicates when the target iteration by which the testing in this plan is supposed to be complete and the product is ready to be released. :type iteration: str :param manual_test_environment: :type manual_test_environment: :class:`TestEnvironment ` :param manual_test_settings: :type manual_test_settings: :class:`TestSettings ` :param name: Name of the test plan. :type name: str :param owner: Owner of the test plan. :type owner: :class:`IdentityRef ` :param release_environment_definition: Release Environment to be used to deploy the build and run automated tests from this test plan. :type release_environment_definition: :class:`ReleaseEnvironmentDefinitionReference ` :param start_date: Start date for the test plan. :type start_date: str :param state: State of the test plan. :type state: str :param status: :type status: str :param test_outcome_settings: Test Outcome settings :type test_outcome_settings: :class:`TestOutcomeSettings ` """ _attribute_map = { 'area': {'key': 'area', 'type': 'ShallowReference'}, 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, 'build': {'key': 'build', 'type': 'ShallowReference'}, 'build_definition': {'key': 'buildDefinition', 'type': 'ShallowReference'}, 'configuration_ids': {'key': 'configurationIds', 'type': '[int]'}, 'description': {'key': 'description', 'type': 'str'}, 'end_date': {'key': 'endDate', 'type': 'str'}, 'iteration': {'key': 'iteration', 'type': 'str'}, 'manual_test_environment': {'key': 'manualTestEnvironment', 'type': 'TestEnvironment'}, 'manual_test_settings': {'key': 'manualTestSettings', 'type': 'TestSettings'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'release_environment_definition': {'key': 'releaseEnvironmentDefinition', 'type': 'ReleaseEnvironmentDefinitionReference'}, 'start_date': {'key': 'startDate', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'}, 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'} } def __init__(self, area=None, automated_test_environment=None, automated_test_settings=None, build=None, build_definition=None, configuration_ids=None, description=None, end_date=None, iteration=None, manual_test_environment=None, manual_test_settings=None, name=None, owner=None, release_environment_definition=None, start_date=None, state=None, status=None, test_outcome_settings=None): super(PlanUpdateModel, self).__init__() self.area = area self.automated_test_environment = automated_test_environment self.automated_test_settings = automated_test_settings self.build = build self.build_definition = build_definition self.configuration_ids = configuration_ids self.description = description self.end_date = end_date self.iteration = iteration self.manual_test_environment = manual_test_environment self.manual_test_settings = manual_test_settings self.name = name self.owner = owner self.release_environment_definition = release_environment_definition self.start_date = start_date self.state = state self.status = status self.test_outcome_settings = test_outcome_settings class PointAssignment(Model): """PointAssignment. :param configuration: Configuration that was assigned to the test case. :type configuration: :class:`ShallowReference ` :param tester: Tester that was assigned to the test case :type tester: :class:`IdentityRef ` """ _attribute_map = { 'configuration': {'key': 'configuration', 'type': 'ShallowReference'}, 'tester': {'key': 'tester', 'type': 'IdentityRef'} } def __init__(self, configuration=None, tester=None): super(PointAssignment, self).__init__() self.configuration = configuration self.tester = tester class PointsFilter(Model): """PointsFilter. :param configuration_names: List of Configurations for filtering. :type configuration_names: list of str :param testcase_ids: List of test case id for filtering. :type testcase_ids: list of int :param testers: List of tester for filtering. :type testers: list of :class:`IdentityRef ` """ _attribute_map = { 'configuration_names': {'key': 'configurationNames', 'type': '[str]'}, 'testcase_ids': {'key': 'testcaseIds', 'type': '[int]'}, 'testers': {'key': 'testers', 'type': '[IdentityRef]'} } def __init__(self, configuration_names=None, testcase_ids=None, testers=None): super(PointsFilter, self).__init__() self.configuration_names = configuration_names self.testcase_ids = testcase_ids self.testers = testers class PointUpdateModel(Model): """PointUpdateModel. :param outcome: Outcome to update. :type outcome: str :param reset_to_active: Reset test point to active. :type reset_to_active: bool :param tester: Tester to update. Type IdentityRef. :type tester: :class:`IdentityRef ` """ _attribute_map = { 'outcome': {'key': 'outcome', 'type': 'str'}, 'reset_to_active': {'key': 'resetToActive', 'type': 'bool'}, 'tester': {'key': 'tester', 'type': 'IdentityRef'} } def __init__(self, outcome=None, reset_to_active=None, tester=None): super(PointUpdateModel, self).__init__() self.outcome = outcome self.reset_to_active = reset_to_active self.tester = tester class PropertyBag(Model): """PropertyBag. :param bag: Generic store for test session data :type bag: dict """ _attribute_map = { 'bag': {'key': 'bag', 'type': '{str}'} } def __init__(self, bag=None): super(PropertyBag, self).__init__() self.bag = bag class QueryModel(Model): """QueryModel. :param query: :type query: str """ _attribute_map = { 'query': {'key': 'query', 'type': 'str'} } def __init__(self, query=None): super(QueryModel, self).__init__() self.query = query class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class ReleaseEnvironmentDefinitionReference(Model): """ReleaseEnvironmentDefinitionReference. :param definition_id: ID of the release definition that contains the release environment definition. :type definition_id: int :param environment_definition_id: ID of the release environment definition. :type environment_definition_id: int """ _attribute_map = { 'definition_id': {'key': 'definitionId', 'type': 'int'}, 'environment_definition_id': {'key': 'environmentDefinitionId', 'type': 'int'} } def __init__(self, definition_id=None, environment_definition_id=None): super(ReleaseEnvironmentDefinitionReference, self).__init__() self.definition_id = definition_id self.environment_definition_id = environment_definition_id class ReleaseReference(Model): """ReleaseReference. :param attempt: :type attempt: int :param creation_date: :type creation_date: datetime :param definition_id: Release definition ID. :type definition_id: int :param environment_creation_date: :type environment_creation_date: datetime :param environment_definition_id: Release environment definition ID. :type environment_definition_id: int :param environment_definition_name: Release environment definition name. :type environment_definition_name: str :param environment_id: Release environment ID. :type environment_id: int :param environment_name: Release environment name. :type environment_name: str :param id: Release ID. :type id: int :param name: Release name. :type name: str """ _attribute_map = { 'attempt': {'key': 'attempt', 'type': 'int'}, 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, 'definition_id': {'key': 'definitionId', 'type': 'int'}, 'environment_creation_date': {'key': 'environmentCreationDate', 'type': 'iso-8601'}, 'environment_definition_id': {'key': 'environmentDefinitionId', 'type': 'int'}, 'environment_definition_name': {'key': 'environmentDefinitionName', 'type': 'str'}, 'environment_id': {'key': 'environmentId', 'type': 'int'}, 'environment_name': {'key': 'environmentName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, attempt=None, creation_date=None, definition_id=None, environment_creation_date=None, environment_definition_id=None, environment_definition_name=None, environment_id=None, environment_name=None, id=None, name=None): super(ReleaseReference, self).__init__() self.attempt = attempt self.creation_date = creation_date self.definition_id = definition_id self.environment_creation_date = environment_creation_date self.environment_definition_id = environment_definition_id self.environment_definition_name = environment_definition_name self.environment_id = environment_id self.environment_name = environment_name self.id = id self.name = name class ResultRetentionSettings(Model): """ResultRetentionSettings. :param automated_results_retention_duration: Automated test result retention duration in days :type automated_results_retention_duration: int :param last_updated_by: Last Updated by identity :type last_updated_by: :class:`IdentityRef ` :param last_updated_date: Last updated date :type last_updated_date: datetime :param manual_results_retention_duration: Manual test result retention duration in days :type manual_results_retention_duration: int """ _attribute_map = { 'automated_results_retention_duration': {'key': 'automatedResultsRetentionDuration', 'type': 'int'}, 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'IdentityRef'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'manual_results_retention_duration': {'key': 'manualResultsRetentionDuration', 'type': 'int'} } def __init__(self, automated_results_retention_duration=None, last_updated_by=None, last_updated_date=None, manual_results_retention_duration=None): super(ResultRetentionSettings, self).__init__() self.automated_results_retention_duration = automated_results_retention_duration self.last_updated_by = last_updated_by self.last_updated_date = last_updated_date self.manual_results_retention_duration = manual_results_retention_duration class ResultsFilter(Model): """ResultsFilter. :param automated_test_name: :type automated_test_name: str :param branch: :type branch: str :param executed_in: :type executed_in: object :param group_by: :type group_by: str :param max_complete_date: :type max_complete_date: datetime :param results_count: :type results_count: int :param test_case_id: :type test_case_id: int :param test_case_reference_ids: :type test_case_reference_ids: list of int :param test_plan_id: :type test_plan_id: int :param test_point_ids: :type test_point_ids: list of int :param test_results_context: :type test_results_context: :class:`TestResultsContext ` :param trend_days: :type trend_days: int """ _attribute_map = { 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, 'branch': {'key': 'branch', 'type': 'str'}, 'executed_in': {'key': 'executedIn', 'type': 'object'}, 'group_by': {'key': 'groupBy', 'type': 'str'}, 'max_complete_date': {'key': 'maxCompleteDate', 'type': 'iso-8601'}, 'results_count': {'key': 'resultsCount', 'type': 'int'}, 'test_case_id': {'key': 'testCaseId', 'type': 'int'}, 'test_case_reference_ids': {'key': 'testCaseReferenceIds', 'type': '[int]'}, 'test_plan_id': {'key': 'testPlanId', 'type': 'int'}, 'test_point_ids': {'key': 'testPointIds', 'type': '[int]'}, 'test_results_context': {'key': 'testResultsContext', 'type': 'TestResultsContext'}, 'trend_days': {'key': 'trendDays', 'type': 'int'} } def __init__(self, automated_test_name=None, branch=None, executed_in=None, group_by=None, max_complete_date=None, results_count=None, test_case_id=None, test_case_reference_ids=None, test_plan_id=None, test_point_ids=None, test_results_context=None, trend_days=None): super(ResultsFilter, self).__init__() self.automated_test_name = automated_test_name self.branch = branch self.executed_in = executed_in self.group_by = group_by self.max_complete_date = max_complete_date self.results_count = results_count self.test_case_id = test_case_id self.test_case_reference_ids = test_case_reference_ids self.test_plan_id = test_plan_id self.test_point_ids = test_point_ids self.test_results_context = test_results_context self.trend_days = trend_days class RunCreateModel(Model): """RunCreateModel. :param automated: true if test run is automated, false otherwise. By default it will be false. :type automated: bool :param build: An abstracted reference to the build that it belongs. :type build: :class:`ShallowReference ` :param build_drop_location: Drop location of the build used for test run. :type build_drop_location: str :param build_flavor: Flavor of the build used for test run. (E.g: Release, Debug) :type build_flavor: str :param build_platform: Platform of the build used for test run. (E.g.: x86, amd64) :type build_platform: str :param build_reference: :type build_reference: :class:`BuildConfiguration ` :param comment: Comments entered by those analyzing the run. :type comment: str :param complete_date: Completed date time of the run. :type complete_date: str :param configuration_ids: IDs of the test configurations associated with the run. :type configuration_ids: list of int :param controller: Name of the test controller used for automated run. :type controller: str :param custom_test_fields: :type custom_test_fields: list of :class:`CustomTestField ` :param dtl_aut_environment: An abstracted reference to DtlAutEnvironment. :type dtl_aut_environment: :class:`ShallowReference ` :param dtl_test_environment: An abstracted reference to DtlTestEnvironment. :type dtl_test_environment: :class:`ShallowReference ` :param due_date: Due date and time for test run. :type due_date: str :param environment_details: :type environment_details: :class:`DtlEnvironmentDetails ` :param error_message: Error message associated with the run. :type error_message: str :param filter: :type filter: :class:`RunFilter ` :param iteration: The iteration in which to create the run. Root iteration of the team project will be default :type iteration: str :param name: Name of the test run. :type name: str :param owner: Display name of the owner of the run. :type owner: :class:`IdentityRef ` :param plan: An abstracted reference to the plan that it belongs. :type plan: :class:`ShallowReference ` :param point_ids: IDs of the test points to use in the run. :type point_ids: list of int :param release_environment_uri: URI of release environment associated with the run. :type release_environment_uri: str :param release_reference: :type release_reference: :class:`ReleaseReference ` :param release_uri: URI of release associated with the run. :type release_uri: str :param run_timeout: :type run_timeout: object :param source_workflow: :type source_workflow: str :param start_date: Start date time of the run. :type start_date: str :param state: The state of the run. Valid states - NotStarted, InProgress, Waiting :type state: str :param test_configurations_mapping: :type test_configurations_mapping: str :param test_environment_id: ID of the test environment associated with the run. :type test_environment_id: str :param test_settings: An abstracted reference to the test settings resource. :type test_settings: :class:`ShallowReference ` :param type: :type type: str """ _attribute_map = { 'automated': {'key': 'automated', 'type': 'bool'}, 'build': {'key': 'build', 'type': 'ShallowReference'}, 'build_drop_location': {'key': 'buildDropLocation', 'type': 'str'}, 'build_flavor': {'key': 'buildFlavor', 'type': 'str'}, 'build_platform': {'key': 'buildPlatform', 'type': 'str'}, 'build_reference': {'key': 'buildReference', 'type': 'BuildConfiguration'}, 'comment': {'key': 'comment', 'type': 'str'}, 'complete_date': {'key': 'completeDate', 'type': 'str'}, 'configuration_ids': {'key': 'configurationIds', 'type': '[int]'}, 'controller': {'key': 'controller', 'type': 'str'}, 'custom_test_fields': {'key': 'customTestFields', 'type': '[CustomTestField]'}, 'dtl_aut_environment': {'key': 'dtlAutEnvironment', 'type': 'ShallowReference'}, 'dtl_test_environment': {'key': 'dtlTestEnvironment', 'type': 'ShallowReference'}, 'due_date': {'key': 'dueDate', 'type': 'str'}, 'environment_details': {'key': 'environmentDetails', 'type': 'DtlEnvironmentDetails'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'filter': {'key': 'filter', 'type': 'RunFilter'}, 'iteration': {'key': 'iteration', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'plan': {'key': 'plan', 'type': 'ShallowReference'}, 'point_ids': {'key': 'pointIds', 'type': '[int]'}, 'release_environment_uri': {'key': 'releaseEnvironmentUri', 'type': 'str'}, 'release_reference': {'key': 'releaseReference', 'type': 'ReleaseReference'}, 'release_uri': {'key': 'releaseUri', 'type': 'str'}, 'run_timeout': {'key': 'runTimeout', 'type': 'object'}, 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, 'start_date': {'key': 'startDate', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'test_configurations_mapping': {'key': 'testConfigurationsMapping', 'type': 'str'}, 'test_environment_id': {'key': 'testEnvironmentId', 'type': 'str'}, 'test_settings': {'key': 'testSettings', 'type': 'ShallowReference'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, automated=None, build=None, build_drop_location=None, build_flavor=None, build_platform=None, build_reference=None, comment=None, complete_date=None, configuration_ids=None, controller=None, custom_test_fields=None, dtl_aut_environment=None, dtl_test_environment=None, due_date=None, environment_details=None, error_message=None, filter=None, iteration=None, name=None, owner=None, plan=None, point_ids=None, release_environment_uri=None, release_reference=None, release_uri=None, run_timeout=None, source_workflow=None, start_date=None, state=None, test_configurations_mapping=None, test_environment_id=None, test_settings=None, type=None): super(RunCreateModel, self).__init__() self.automated = automated self.build = build self.build_drop_location = build_drop_location self.build_flavor = build_flavor self.build_platform = build_platform self.build_reference = build_reference self.comment = comment self.complete_date = complete_date self.configuration_ids = configuration_ids self.controller = controller self.custom_test_fields = custom_test_fields self.dtl_aut_environment = dtl_aut_environment self.dtl_test_environment = dtl_test_environment self.due_date = due_date self.environment_details = environment_details self.error_message = error_message self.filter = filter self.iteration = iteration self.name = name self.owner = owner self.plan = plan self.point_ids = point_ids self.release_environment_uri = release_environment_uri self.release_reference = release_reference self.release_uri = release_uri self.run_timeout = run_timeout self.source_workflow = source_workflow self.start_date = start_date self.state = state self.test_configurations_mapping = test_configurations_mapping self.test_environment_id = test_environment_id self.test_settings = test_settings self.type = type class RunFilter(Model): """RunFilter. :param source_filter: filter for the test case sources (test containers) :type source_filter: str :param test_case_filter: filter for the test cases :type test_case_filter: str """ _attribute_map = { 'source_filter': {'key': 'sourceFilter', 'type': 'str'}, 'test_case_filter': {'key': 'testCaseFilter', 'type': 'str'} } def __init__(self, source_filter=None, test_case_filter=None): super(RunFilter, self).__init__() self.source_filter = source_filter self.test_case_filter = test_case_filter class RunStatistic(Model): """RunStatistic. :param count: :type count: int :param outcome: Test run outcome :type outcome: str :param resolution_state: :type resolution_state: :class:`TestResolutionState ` :param state: State of the test run :type state: str """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'resolution_state': {'key': 'resolutionState', 'type': 'TestResolutionState'}, 'state': {'key': 'state', 'type': 'str'} } def __init__(self, count=None, outcome=None, resolution_state=None, state=None): super(RunStatistic, self).__init__() self.count = count self.outcome = outcome self.resolution_state = resolution_state self.state = state class RunUpdateModel(Model): """RunUpdateModel. :param build: An abstracted reference to the build that it belongs. :type build: :class:`ShallowReference ` :param build_drop_location: :type build_drop_location: str :param build_flavor: :type build_flavor: str :param build_platform: :type build_platform: str :param comment: Comments entered by those analyzing the run. :type comment: str :param completed_date: Completed date time of the run. :type completed_date: str :param controller: Name of the test controller used for automated run. :type controller: str :param delete_in_progress_results: :type delete_in_progress_results: bool :param dtl_aut_environment: An abstracted reference to DtlAutEnvironment. :type dtl_aut_environment: :class:`ShallowReference ` :param dtl_environment: An abstracted reference to DtlEnvironment. :type dtl_environment: :class:`ShallowReference ` :param dtl_environment_details: :type dtl_environment_details: :class:`DtlEnvironmentDetails ` :param due_date: Due date and time for test run. :type due_date: str :param error_message: Error message associated with the run. :type error_message: str :param iteration: The iteration in which to create the run. :type iteration: str :param log_entries: Log entries associated with the run. Use a comma-separated list of multiple log entry objects. { logEntry }, { logEntry }, ... :type log_entries: list of :class:`TestMessageLogDetails ` :param name: Name of the test run. :type name: str :param release_environment_uri: :type release_environment_uri: str :param release_uri: :type release_uri: str :param source_workflow: :type source_workflow: str :param started_date: Start date time of the run. :type started_date: str :param state: The state of the test run Below are the valid values - NotStarted, InProgress, Completed, Aborted, Waiting :type state: str :param substate: :type substate: object :param test_environment_id: :type test_environment_id: str :param test_settings: An abstracted reference to test setting resource. :type test_settings: :class:`ShallowReference ` """ _attribute_map = { 'build': {'key': 'build', 'type': 'ShallowReference'}, 'build_drop_location': {'key': 'buildDropLocation', 'type': 'str'}, 'build_flavor': {'key': 'buildFlavor', 'type': 'str'}, 'build_platform': {'key': 'buildPlatform', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'str'}, 'controller': {'key': 'controller', 'type': 'str'}, 'delete_in_progress_results': {'key': 'deleteInProgressResults', 'type': 'bool'}, 'dtl_aut_environment': {'key': 'dtlAutEnvironment', 'type': 'ShallowReference'}, 'dtl_environment': {'key': 'dtlEnvironment', 'type': 'ShallowReference'}, 'dtl_environment_details': {'key': 'dtlEnvironmentDetails', 'type': 'DtlEnvironmentDetails'}, 'due_date': {'key': 'dueDate', 'type': 'str'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'iteration': {'key': 'iteration', 'type': 'str'}, 'log_entries': {'key': 'logEntries', 'type': '[TestMessageLogDetails]'}, 'name': {'key': 'name', 'type': 'str'}, 'release_environment_uri': {'key': 'releaseEnvironmentUri', 'type': 'str'}, 'release_uri': {'key': 'releaseUri', 'type': 'str'}, 'source_workflow': {'key': 'sourceWorkflow', 'type': 'str'}, 'started_date': {'key': 'startedDate', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'substate': {'key': 'substate', 'type': 'object'}, 'test_environment_id': {'key': 'testEnvironmentId', 'type': 'str'}, 'test_settings': {'key': 'testSettings', 'type': 'ShallowReference'} } def __init__(self, build=None, build_drop_location=None, build_flavor=None, build_platform=None, comment=None, completed_date=None, controller=None, delete_in_progress_results=None, dtl_aut_environment=None, dtl_environment=None, dtl_environment_details=None, due_date=None, error_message=None, iteration=None, log_entries=None, name=None, release_environment_uri=None, release_uri=None, source_workflow=None, started_date=None, state=None, substate=None, test_environment_id=None, test_settings=None): super(RunUpdateModel, self).__init__() self.build = build self.build_drop_location = build_drop_location self.build_flavor = build_flavor self.build_platform = build_platform self.comment = comment self.completed_date = completed_date self.controller = controller self.delete_in_progress_results = delete_in_progress_results self.dtl_aut_environment = dtl_aut_environment self.dtl_environment = dtl_environment self.dtl_environment_details = dtl_environment_details self.due_date = due_date self.error_message = error_message self.iteration = iteration self.log_entries = log_entries self.name = name self.release_environment_uri = release_environment_uri self.release_uri = release_uri self.source_workflow = source_workflow self.started_date = started_date self.state = state self.substate = substate self.test_environment_id = test_environment_id self.test_settings = test_settings class ShallowReference(Model): """ShallowReference. :param id: ID of the resource :type id: str :param name: Name of the linked resource (definition name, controller name, etc.) :type name: str :param url: Full http link to the resource :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, name=None, url=None): super(ShallowReference, self).__init__() self.id = id self.name = name self.url = url class ShallowTestCaseResult(Model): """ShallowTestCaseResult. :param automated_test_storage: :type automated_test_storage: str :param duration_in_ms: :type duration_in_ms: float :param id: :type id: int :param is_re_run: :type is_re_run: bool :param outcome: :type outcome: str :param owner: :type owner: str :param priority: :type priority: int :param ref_id: :type ref_id: int :param run_id: :type run_id: int :param test_case_title: :type test_case_title: str """ _attribute_map = { 'automated_test_storage': {'key': 'automatedTestStorage', 'type': 'str'}, 'duration_in_ms': {'key': 'durationInMs', 'type': 'float'}, 'id': {'key': 'id', 'type': 'int'}, 'is_re_run': {'key': 'isReRun', 'type': 'bool'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'str'}, 'priority': {'key': 'priority', 'type': 'int'}, 'ref_id': {'key': 'refId', 'type': 'int'}, 'run_id': {'key': 'runId', 'type': 'int'}, 'test_case_title': {'key': 'testCaseTitle', 'type': 'str'} } def __init__(self, automated_test_storage=None, duration_in_ms=None, id=None, is_re_run=None, outcome=None, owner=None, priority=None, ref_id=None, run_id=None, test_case_title=None): super(ShallowTestCaseResult, self).__init__() self.automated_test_storage = automated_test_storage self.duration_in_ms = duration_in_ms self.id = id self.is_re_run = is_re_run self.outcome = outcome self.owner = owner self.priority = priority self.ref_id = ref_id self.run_id = run_id self.test_case_title = test_case_title class SharedStepModel(Model): """SharedStepModel. :param id: WorkItem shared step ID. :type id: int :param revision: Shared step workitem revision. :type revision: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'revision': {'key': 'revision', 'type': 'int'} } def __init__(self, id=None, revision=None): super(SharedStepModel, self).__init__() self.id = id self.revision = revision class SuiteCreateModel(Model): """SuiteCreateModel. :param name: Name of test suite. :type name: str :param query_string: For query based suites, query string that defines the suite. :type query_string: str :param requirement_ids: For requirements test suites, the IDs of the requirements. :type requirement_ids: list of int :param suite_type: Type of test suite to create. It can have value from DynamicTestSuite, StaticTestSuite and RequirementTestSuite. :type suite_type: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'query_string': {'key': 'queryString', 'type': 'str'}, 'requirement_ids': {'key': 'requirementIds', 'type': '[int]'}, 'suite_type': {'key': 'suiteType', 'type': 'str'} } def __init__(self, name=None, query_string=None, requirement_ids=None, suite_type=None): super(SuiteCreateModel, self).__init__() self.name = name self.query_string = query_string self.requirement_ids = requirement_ids self.suite_type = suite_type class SuiteEntry(Model): """SuiteEntry. :param child_suite_id: Id of child suite in the test suite. :type child_suite_id: int :param sequence_number: Sequence number for the test case or child test suite in the test suite. :type sequence_number: int :param suite_id: Id for the test suite. :type suite_id: int :param test_case_id: Id of a test case in the test suite. :type test_case_id: int """ _attribute_map = { 'child_suite_id': {'key': 'childSuiteId', 'type': 'int'}, 'sequence_number': {'key': 'sequenceNumber', 'type': 'int'}, 'suite_id': {'key': 'suiteId', 'type': 'int'}, 'test_case_id': {'key': 'testCaseId', 'type': 'int'} } def __init__(self, child_suite_id=None, sequence_number=None, suite_id=None, test_case_id=None): super(SuiteEntry, self).__init__() self.child_suite_id = child_suite_id self.sequence_number = sequence_number self.suite_id = suite_id self.test_case_id = test_case_id class SuiteEntryUpdateModel(Model): """SuiteEntryUpdateModel. :param child_suite_id: Id of the child suite in the test suite. :type child_suite_id: int :param sequence_number: Updated sequence number for the test case or child test suite in the test suite. :type sequence_number: int :param test_case_id: Id of the test case in the test suite. :type test_case_id: int """ _attribute_map = { 'child_suite_id': {'key': 'childSuiteId', 'type': 'int'}, 'sequence_number': {'key': 'sequenceNumber', 'type': 'int'}, 'test_case_id': {'key': 'testCaseId', 'type': 'int'} } def __init__(self, child_suite_id=None, sequence_number=None, test_case_id=None): super(SuiteEntryUpdateModel, self).__init__() self.child_suite_id = child_suite_id self.sequence_number = sequence_number self.test_case_id = test_case_id class SuiteTestCase(Model): """SuiteTestCase. :param point_assignments: Point Assignment for test suite's test case. :type point_assignments: list of :class:`PointAssignment ` :param test_case: Test case workItem reference. :type test_case: :class:`WorkItemReference ` """ _attribute_map = { 'point_assignments': {'key': 'pointAssignments', 'type': '[PointAssignment]'}, 'test_case': {'key': 'testCase', 'type': 'WorkItemReference'} } def __init__(self, point_assignments=None, test_case=None): super(SuiteTestCase, self).__init__() self.point_assignments = point_assignments self.test_case = test_case class SuiteTestCaseUpdateModel(Model): """SuiteTestCaseUpdateModel. :param configurations: Shallow reference of configurations for the test cases in the suite. :type configurations: list of :class:`ShallowReference ` """ _attribute_map = { 'configurations': {'key': 'configurations', 'type': '[ShallowReference]'} } def __init__(self, configurations=None): super(SuiteTestCaseUpdateModel, self).__init__() self.configurations = configurations class SuiteUpdateModel(Model): """SuiteUpdateModel. :param default_configurations: Shallow reference of default configurations for the suite. :type default_configurations: list of :class:`ShallowReference ` :param default_testers: Shallow reference of test suite. :type default_testers: list of :class:`ShallowReference ` :param inherit_default_configurations: Specifies if the default configurations have to be inherited from the parent test suite in which the test suite is created. :type inherit_default_configurations: bool :param name: Test suite name :type name: str :param parent: Shallow reference of the parent. :type parent: :class:`ShallowReference ` :param query_string: For query based suites, the new query string. :type query_string: str """ _attribute_map = { 'default_configurations': {'key': 'defaultConfigurations', 'type': '[ShallowReference]'}, 'default_testers': {'key': 'defaultTesters', 'type': '[ShallowReference]'}, 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'parent': {'key': 'parent', 'type': 'ShallowReference'}, 'query_string': {'key': 'queryString', 'type': 'str'} } def __init__(self, default_configurations=None, default_testers=None, inherit_default_configurations=None, name=None, parent=None, query_string=None): super(SuiteUpdateModel, self).__init__() self.default_configurations = default_configurations self.default_testers = default_testers self.inherit_default_configurations = inherit_default_configurations self.name = name self.parent = parent self.query_string = query_string class TeamContext(Model): """TeamContext. :param project: The team project Id or name. Ignored if ProjectId is set. :type project: str :param project_id: The Team Project ID. Required if Project is not set. :type project_id: str :param team: The Team Id or name. Ignored if TeamId is set. :type team: str :param team_id: The Team Id :type team_id: str """ _attribute_map = { 'project': {'key': 'project', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'team': {'key': 'team', 'type': 'str'}, 'team_id': {'key': 'teamId', 'type': 'str'} } def __init__(self, project=None, project_id=None, team=None, team_id=None): super(TeamContext, self).__init__() self.project = project self.project_id = project_id self.team = team self.team_id = team_id class TeamProjectReference(Model): """TeamProjectReference. :param abbreviation: Project abbreviation. :type abbreviation: str :param default_team_image_url: Url to default team identity image. :type default_team_image_url: str :param description: The project's description (if any). :type description: str :param id: Project identifier. :type id: str :param name: Project name. :type name: str :param revision: Project revision. :type revision: long :param state: Project state. :type state: object :param url: Url to the full version of the object. :type url: str :param visibility: Project visibility. :type visibility: object """ _attribute_map = { 'abbreviation': {'key': 'abbreviation', 'type': 'str'}, 'default_team_image_url': {'key': 'defaultTeamImageUrl', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'long'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'visibility': {'key': 'visibility', 'type': 'object'} } def __init__(self, abbreviation=None, default_team_image_url=None, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): super(TeamProjectReference, self).__init__() self.abbreviation = abbreviation self.default_team_image_url = default_team_image_url self.description = description self.id = id self.name = name self.revision = revision self.state = state self.url = url self.visibility = visibility class TestAttachment(Model): """TestAttachment. :param attachment_type: Attachment type. :type attachment_type: object :param comment: Comment associated with attachment. :type comment: str :param created_date: Attachment created date. :type created_date: datetime :param file_name: Attachment file name :type file_name: str :param id: ID of the attachment. :type id: int :param size: Attachment size. :type size: long :param url: Attachment Url. :type url: str """ _attribute_map = { 'attachment_type': {'key': 'attachmentType', 'type': 'object'}, 'comment': {'key': 'comment', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'file_name': {'key': 'fileName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'size': {'key': 'size', 'type': 'long'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, attachment_type=None, comment=None, created_date=None, file_name=None, id=None, size=None, url=None): super(TestAttachment, self).__init__() self.attachment_type = attachment_type self.comment = comment self.created_date = created_date self.file_name = file_name self.id = id self.size = size self.url = url class TestAttachmentReference(Model): """TestAttachmentReference. :param id: ID of the attachment. :type id: int :param url: Url to download the attachment. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(TestAttachmentReference, self).__init__() self.id = id self.url = url class TestAttachmentRequestModel(Model): """TestAttachmentRequestModel. :param attachment_type: Attachment type By Default it will be GeneralAttachment. It can be one of the following type. { GeneralAttachment, AfnStrip, BugFilingData, CodeCoverage, IntermediateCollectorData, RunConfig, TestImpactDetails, TmiTestRunDeploymentFiles, TmiTestRunReverseDeploymentFiles, TmiTestResultDetail, TmiTestRunSummary } :type attachment_type: str :param comment: Comment associated with attachment :type comment: str :param file_name: Attachment filename :type file_name: str :param stream: Base64 encoded file stream :type stream: str """ _attribute_map = { 'attachment_type': {'key': 'attachmentType', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'file_name': {'key': 'fileName', 'type': 'str'}, 'stream': {'key': 'stream', 'type': 'str'} } def __init__(self, attachment_type=None, comment=None, file_name=None, stream=None): super(TestAttachmentRequestModel, self).__init__() self.attachment_type = attachment_type self.comment = comment self.file_name = file_name self.stream = stream class TestCaseResult(Model): """TestCaseResult. :param afn_strip_id: Test attachment ID of action recording. :type afn_strip_id: int :param area: Reference to area path of test. :type area: :class:`ShallowReference ` :param associated_bugs: Reference to bugs linked to test result. :type associated_bugs: list of :class:`ShallowReference ` :param automated_test_id: ID representing test method in a dll. :type automated_test_id: str :param automated_test_name: Fully qualified name of test executed. :type automated_test_name: str :param automated_test_storage: Container to which test belongs. :type automated_test_storage: str :param automated_test_type: Type of automated test. :type automated_test_type: str :param automated_test_type_id: :type automated_test_type_id: str :param build: Shallow reference to build associated with test result. :type build: :class:`ShallowReference ` :param build_reference: Reference to build associated with test result. :type build_reference: :class:`BuildReference ` :param comment: Comment in a test result. :type comment: str :param completed_date: Time when test execution completed. :type completed_date: datetime :param computer_name: Machine name where test executed. :type computer_name: str :param configuration: Test configuration of a test result. :type configuration: :class:`ShallowReference ` :param created_date: Timestamp when test result created. :type created_date: datetime :param custom_fields: Additional properties of test result. :type custom_fields: list of :class:`CustomTestField ` :param duration_in_ms: Duration of test execution in milliseconds. :type duration_in_ms: float :param error_message: Error message in test execution. :type error_message: str :param failing_since: Information when test results started failing. :type failing_since: :class:`FailingSince ` :param failure_type: Failure type of test result. :type failure_type: str :param id: ID of a test result. :type id: int :param iteration_details: Test result details of test iterations. :type iteration_details: list of :class:`TestIterationDetailsModel ` :param last_updated_by: Reference to identity last updated test result. :type last_updated_by: :class:`IdentityRef ` :param last_updated_date: Last updated datetime of test result. :type last_updated_date: datetime :param outcome: Test outcome of test result. :type outcome: str :param owner: Reference to test owner. :type owner: :class:`IdentityRef ` :param priority: Priority of test executed. :type priority: int :param project: Reference to team project. :type project: :class:`ShallowReference ` :param release: Shallow reference to release associated with test result. :type release: :class:`ShallowReference ` :param release_reference: Reference to release associated with test result. :type release_reference: :class:`ReleaseReference ` :param reset_count: :type reset_count: int :param resolution_state: Resolution state of test result. :type resolution_state: str :param resolution_state_id: ID of resolution state. :type resolution_state_id: int :param result_group_type: Hierarchy type of the result, default value of None means its leaf node. :type result_group_type: object :param revision: Revision number of test result. :type revision: int :param run_by: Reference to identity executed the test. :type run_by: :class:`IdentityRef ` :param stack_trace: Stacktrace. :type stack_trace: str :param started_date: Time when test execution started. :type started_date: datetime :param state: State of test result. :type state: str :param sub_results: List of sub results inside a test result, if ResultGroupType is not None, it holds corresponding type sub results. :type sub_results: list of :class:`TestSubResult ` :param test_case: Reference to the test executed. :type test_case: :class:`ShallowReference ` :param test_case_reference_id: Reference ID of test used by test result. :type test_case_reference_id: int :param test_case_revision: Name of test. :type test_case_revision: int :param test_case_title: Name of test. :type test_case_title: str :param test_plan: Reference to test plan test case workitem is part of. :type test_plan: :class:`ShallowReference ` :param test_point: Reference to the test point executed. :type test_point: :class:`ShallowReference ` :param test_run: Reference to test run. :type test_run: :class:`ShallowReference ` :param test_suite: Reference to test suite test case workitem is part of. :type test_suite: :class:`ShallowReference ` :param url: Url of test result. :type url: str """ _attribute_map = { 'afn_strip_id': {'key': 'afnStripId', 'type': 'int'}, 'area': {'key': 'area', 'type': 'ShallowReference'}, 'associated_bugs': {'key': 'associatedBugs', 'type': '[ShallowReference]'}, 'automated_test_id': {'key': 'automatedTestId', 'type': 'str'}, 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, 'automated_test_storage': {'key': 'automatedTestStorage', 'type': 'str'}, 'automated_test_type': {'key': 'automatedTestType', 'type': 'str'}, 'automated_test_type_id': {'key': 'automatedTestTypeId', 'type': 'str'}, 'build': {'key': 'build', 'type': 'ShallowReference'}, 'build_reference': {'key': 'buildReference', 'type': 'BuildReference'}, 'comment': {'key': 'comment', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, 'computer_name': {'key': 'computerName', 'type': 'str'}, 'configuration': {'key': 'configuration', 'type': 'ShallowReference'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'custom_fields': {'key': 'customFields', 'type': '[CustomTestField]'}, 'duration_in_ms': {'key': 'durationInMs', 'type': 'float'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'failing_since': {'key': 'failingSince', 'type': 'FailingSince'}, 'failure_type': {'key': 'failureType', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'iteration_details': {'key': 'iterationDetails', 'type': '[TestIterationDetailsModel]'}, 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'IdentityRef'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'priority': {'key': 'priority', 'type': 'int'}, 'project': {'key': 'project', 'type': 'ShallowReference'}, 'release': {'key': 'release', 'type': 'ShallowReference'}, 'release_reference': {'key': 'releaseReference', 'type': 'ReleaseReference'}, 'reset_count': {'key': 'resetCount', 'type': 'int'}, 'resolution_state': {'key': 'resolutionState', 'type': 'str'}, 'resolution_state_id': {'key': 'resolutionStateId', 'type': 'int'}, 'result_group_type': {'key': 'resultGroupType', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'run_by': {'key': 'runBy', 'type': 'IdentityRef'}, 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, 'started_date': {'key': 'startedDate', 'type': 'iso-8601'}, 'state': {'key': 'state', 'type': 'str'}, 'sub_results': {'key': 'subResults', 'type': '[TestSubResult]'}, 'test_case': {'key': 'testCase', 'type': 'ShallowReference'}, 'test_case_reference_id': {'key': 'testCaseReferenceId', 'type': 'int'}, 'test_case_revision': {'key': 'testCaseRevision', 'type': 'int'}, 'test_case_title': {'key': 'testCaseTitle', 'type': 'str'}, 'test_plan': {'key': 'testPlan', 'type': 'ShallowReference'}, 'test_point': {'key': 'testPoint', 'type': 'ShallowReference'}, 'test_run': {'key': 'testRun', 'type': 'ShallowReference'}, 'test_suite': {'key': 'testSuite', 'type': 'ShallowReference'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, afn_strip_id=None, area=None, associated_bugs=None, automated_test_id=None, automated_test_name=None, automated_test_storage=None, automated_test_type=None, automated_test_type_id=None, build=None, build_reference=None, comment=None, completed_date=None, computer_name=None, configuration=None, created_date=None, custom_fields=None, duration_in_ms=None, error_message=None, failing_since=None, failure_type=None, id=None, iteration_details=None, last_updated_by=None, last_updated_date=None, outcome=None, owner=None, priority=None, project=None, release=None, release_reference=None, reset_count=None, resolution_state=None, resolution_state_id=None, result_group_type=None, revision=None, run_by=None, stack_trace=None, started_date=None, state=None, sub_results=None, test_case=None, test_case_reference_id=None, test_case_revision=None, test_case_title=None, test_plan=None, test_point=None, test_run=None, test_suite=None, url=None): super(TestCaseResult, self).__init__() self.afn_strip_id = afn_strip_id self.area = area self.associated_bugs = associated_bugs self.automated_test_id = automated_test_id self.automated_test_name = automated_test_name self.automated_test_storage = automated_test_storage self.automated_test_type = automated_test_type self.automated_test_type_id = automated_test_type_id self.build = build self.build_reference = build_reference self.comment = comment self.completed_date = completed_date self.computer_name = computer_name self.configuration = configuration self.created_date = created_date self.custom_fields = custom_fields self.duration_in_ms = duration_in_ms self.error_message = error_message self.failing_since = failing_since self.failure_type = failure_type self.id = id self.iteration_details = iteration_details self.last_updated_by = last_updated_by self.last_updated_date = last_updated_date self.outcome = outcome self.owner = owner self.priority = priority self.project = project self.release = release self.release_reference = release_reference self.reset_count = reset_count self.resolution_state = resolution_state self.resolution_state_id = resolution_state_id self.result_group_type = result_group_type self.revision = revision self.run_by = run_by self.stack_trace = stack_trace self.started_date = started_date self.state = state self.sub_results = sub_results self.test_case = test_case self.test_case_reference_id = test_case_reference_id self.test_case_revision = test_case_revision self.test_case_title = test_case_title self.test_plan = test_plan self.test_point = test_point self.test_run = test_run self.test_suite = test_suite self.url = url class TestCaseResultAttachmentModel(Model): """TestCaseResultAttachmentModel. :param action_path: Path identifier test step in test case workitem. :type action_path: str :param id: Attachment ID. :type id: int :param iteration_id: Iteration ID. :type iteration_id: int :param name: Name of attachment. :type name: str :param size: Attachment size. :type size: long :param url: Url to attachment. :type url: str """ _attribute_map = { 'action_path': {'key': 'actionPath', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'iteration_id': {'key': 'iterationId', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'size': {'key': 'size', 'type': 'long'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, action_path=None, id=None, iteration_id=None, name=None, size=None, url=None): super(TestCaseResultAttachmentModel, self).__init__() self.action_path = action_path self.id = id self.iteration_id = iteration_id self.name = name self.size = size self.url = url class TestCaseResultIdentifier(Model): """TestCaseResultIdentifier. :param test_result_id: Test result ID. :type test_result_id: int :param test_run_id: Test run ID. :type test_run_id: int """ _attribute_map = { 'test_result_id': {'key': 'testResultId', 'type': 'int'}, 'test_run_id': {'key': 'testRunId', 'type': 'int'} } def __init__(self, test_result_id=None, test_run_id=None): super(TestCaseResultIdentifier, self).__init__() self.test_result_id = test_result_id self.test_run_id = test_run_id class TestCaseResultUpdateModel(Model): """TestCaseResultUpdateModel. :param associated_work_items: :type associated_work_items: list of int :param automated_test_type_id: :type automated_test_type_id: str :param comment: :type comment: str :param completed_date: :type completed_date: str :param computer_name: :type computer_name: str :param custom_fields: :type custom_fields: list of :class:`CustomTestField ` :param duration_in_ms: :type duration_in_ms: str :param error_message: :type error_message: str :param failure_type: :type failure_type: str :param outcome: :type outcome: str :param owner: :type owner: :class:`IdentityRef ` :param resolution_state: :type resolution_state: str :param run_by: :type run_by: :class:`IdentityRef ` :param stack_trace: :type stack_trace: str :param started_date: :type started_date: str :param state: :type state: str :param test_case_priority: :type test_case_priority: str :param test_result: :type test_result: :class:`ShallowReference ` """ _attribute_map = { 'associated_work_items': {'key': 'associatedWorkItems', 'type': '[int]'}, 'automated_test_type_id': {'key': 'automatedTestTypeId', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'str'}, 'computer_name': {'key': 'computerName', 'type': 'str'}, 'custom_fields': {'key': 'customFields', 'type': '[CustomTestField]'}, 'duration_in_ms': {'key': 'durationInMs', 'type': 'str'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'failure_type': {'key': 'failureType', 'type': 'str'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'resolution_state': {'key': 'resolutionState', 'type': 'str'}, 'run_by': {'key': 'runBy', 'type': 'IdentityRef'}, 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, 'started_date': {'key': 'startedDate', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'test_case_priority': {'key': 'testCasePriority', 'type': 'str'}, 'test_result': {'key': 'testResult', 'type': 'ShallowReference'} } def __init__(self, associated_work_items=None, automated_test_type_id=None, comment=None, completed_date=None, computer_name=None, custom_fields=None, duration_in_ms=None, error_message=None, failure_type=None, outcome=None, owner=None, resolution_state=None, run_by=None, stack_trace=None, started_date=None, state=None, test_case_priority=None, test_result=None): super(TestCaseResultUpdateModel, self).__init__() self.associated_work_items = associated_work_items self.automated_test_type_id = automated_test_type_id self.comment = comment self.completed_date = completed_date self.computer_name = computer_name self.custom_fields = custom_fields self.duration_in_ms = duration_in_ms self.error_message = error_message self.failure_type = failure_type self.outcome = outcome self.owner = owner self.resolution_state = resolution_state self.run_by = run_by self.stack_trace = stack_trace self.started_date = started_date self.state = state self.test_case_priority = test_case_priority self.test_result = test_result class TestConfiguration(Model): """TestConfiguration. :param area: Area of the configuration :type area: :class:`ShallowReference ` :param description: Description of the configuration :type description: str :param id: Id of the configuration :type id: int :param is_default: Is the configuration a default for the test plans :type is_default: bool :param last_updated_by: Last Updated By Reference :type last_updated_by: :class:`IdentityRef ` :param last_updated_date: Last Updated Data :type last_updated_date: datetime :param name: Name of the configuration :type name: str :param project: Project to which the configuration belongs :type project: :class:`ShallowReference ` :param revision: Revision of the the configuration :type revision: int :param state: State of the configuration :type state: object :param url: Url of Configuration Resource :type url: str :param values: Dictionary of Test Variable, Selected Value :type values: list of :class:`NameValuePair ` """ _attribute_map = { 'area': {'key': 'area', 'type': 'ShallowReference'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'IdentityRef'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'project': {'key': 'project', 'type': 'ShallowReference'}, 'revision': {'key': 'revision', 'type': 'int'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'values': {'key': 'values', 'type': '[NameValuePair]'} } def __init__(self, area=None, description=None, id=None, is_default=None, last_updated_by=None, last_updated_date=None, name=None, project=None, revision=None, state=None, url=None, values=None): super(TestConfiguration, self).__init__() self.area = area self.description = description self.id = id self.is_default = is_default self.last_updated_by = last_updated_by self.last_updated_date = last_updated_date self.name = name self.project = project self.revision = revision self.state = state self.url = url self.values = values class TestEnvironment(Model): """TestEnvironment. :param environment_id: :type environment_id: str :param environment_name: :type environment_name: str """ _attribute_map = { 'environment_id': {'key': 'environmentId', 'type': 'str'}, 'environment_name': {'key': 'environmentName', 'type': 'str'} } def __init__(self, environment_id=None, environment_name=None): super(TestEnvironment, self).__init__() self.environment_id = environment_id self.environment_name = environment_name class TestFailureDetails(Model): """TestFailureDetails. :param count: :type count: int :param test_results: :type test_results: list of :class:`TestCaseResultIdentifier ` """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'test_results': {'key': 'testResults', 'type': '[TestCaseResultIdentifier]'} } def __init__(self, count=None, test_results=None): super(TestFailureDetails, self).__init__() self.count = count self.test_results = test_results class TestFailuresAnalysis(Model): """TestFailuresAnalysis. :param existing_failures: :type existing_failures: :class:`TestFailureDetails ` :param fixed_tests: :type fixed_tests: :class:`TestFailureDetails ` :param new_failures: :type new_failures: :class:`TestFailureDetails ` :param previous_context: :type previous_context: :class:`TestResultsContext ` """ _attribute_map = { 'existing_failures': {'key': 'existingFailures', 'type': 'TestFailureDetails'}, 'fixed_tests': {'key': 'fixedTests', 'type': 'TestFailureDetails'}, 'new_failures': {'key': 'newFailures', 'type': 'TestFailureDetails'}, 'previous_context': {'key': 'previousContext', 'type': 'TestResultsContext'} } def __init__(self, existing_failures=None, fixed_tests=None, new_failures=None, previous_context=None): super(TestFailuresAnalysis, self).__init__() self.existing_failures = existing_failures self.fixed_tests = fixed_tests self.new_failures = new_failures self.previous_context = previous_context class TestHistoryQuery(Model): """TestHistoryQuery. :param automated_test_name: Automated test name of the TestCase. :type automated_test_name: str :param branch: Results to be get for a particular branches. :type branch: str :param build_definition_id: Get the results history only for this BuildDefinationId. This to get used in query GroupBy should be Branch. If this is provided, Branch will have no use. :type build_definition_id: int :param continuation_token: It will be filled by server. If not null means there are some results still to be get, and we need to call this REST API with this ContinuousToken. It is not supposed to be created (or altered, if received from server in last batch) by user. :type continuation_token: str :param group_by: Group the result on the basis of TestResultGroupBy. This can be Branch, Environment or null(if results are fetched by BuildDefinitionId) :type group_by: object :param max_complete_date: History to get between time interval MaxCompleteDate and (MaxCompleteDate - TrendDays). Default is current date time. :type max_complete_date: datetime :param release_env_definition_id: Get the results history only for this ReleaseEnvDefinitionId. This to get used in query GroupBy should be Environment. :type release_env_definition_id: int :param results_for_group: List of TestResultHistoryForGroup which are grouped by GroupBy :type results_for_group: list of :class:`TestResultHistoryForGroup ` :param trend_days: Number of days for which history to collect. Maximum supported value is 7 days. Default is 7 days. :type trend_days: int """ _attribute_map = { 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, 'branch': {'key': 'branch', 'type': 'str'}, 'build_definition_id': {'key': 'buildDefinitionId', 'type': 'int'}, 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, 'group_by': {'key': 'groupBy', 'type': 'object'}, 'max_complete_date': {'key': 'maxCompleteDate', 'type': 'iso-8601'}, 'release_env_definition_id': {'key': 'releaseEnvDefinitionId', 'type': 'int'}, 'results_for_group': {'key': 'resultsForGroup', 'type': '[TestResultHistoryForGroup]'}, 'trend_days': {'key': 'trendDays', 'type': 'int'} } def __init__(self, automated_test_name=None, branch=None, build_definition_id=None, continuation_token=None, group_by=None, max_complete_date=None, release_env_definition_id=None, results_for_group=None, trend_days=None): super(TestHistoryQuery, self).__init__() self.automated_test_name = automated_test_name self.branch = branch self.build_definition_id = build_definition_id self.continuation_token = continuation_token self.group_by = group_by self.max_complete_date = max_complete_date self.release_env_definition_id = release_env_definition_id self.results_for_group = results_for_group self.trend_days = trend_days class TestIterationDetailsModel(Model): """TestIterationDetailsModel. :param action_results: Test step results in an iteration. :type action_results: list of :class:`TestActionResultModel ` :param attachments: Refence to attachments in test iteration result. :type attachments: list of :class:`TestCaseResultAttachmentModel ` :param comment: Comment in test iteration result. :type comment: str :param completed_date: Time when execution completed. :type completed_date: datetime :param duration_in_ms: Duration of execution. :type duration_in_ms: float :param error_message: Error message in test iteration result execution. :type error_message: str :param id: ID of test iteration result. :type id: int :param outcome: Test outcome if test iteration result. :type outcome: str :param parameters: Test parameters in an iteration. :type parameters: list of :class:`TestResultParameterModel ` :param started_date: Time when execution started. :type started_date: datetime :param url: Url to test iteration result. :type url: str """ _attribute_map = { 'action_results': {'key': 'actionResults', 'type': '[TestActionResultModel]'}, 'attachments': {'key': 'attachments', 'type': '[TestCaseResultAttachmentModel]'}, 'comment': {'key': 'comment', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, 'duration_in_ms': {'key': 'durationInMs', 'type': 'float'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': '[TestResultParameterModel]'}, 'started_date': {'key': 'startedDate', 'type': 'iso-8601'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, action_results=None, attachments=None, comment=None, completed_date=None, duration_in_ms=None, error_message=None, id=None, outcome=None, parameters=None, started_date=None, url=None): super(TestIterationDetailsModel, self).__init__() self.action_results = action_results self.attachments = attachments self.comment = comment self.completed_date = completed_date self.duration_in_ms = duration_in_ms self.error_message = error_message self.id = id self.outcome = outcome self.parameters = parameters self.started_date = started_date self.url = url class TestMessageLogDetails(Model): """TestMessageLogDetails. :param date_created: Date when the resource is created :type date_created: datetime :param entry_id: Id of the resource :type entry_id: int :param message: Message of the resource :type message: str """ _attribute_map = { 'date_created': {'key': 'dateCreated', 'type': 'iso-8601'}, 'entry_id': {'key': 'entryId', 'type': 'int'}, 'message': {'key': 'message', 'type': 'str'} } def __init__(self, date_created=None, entry_id=None, message=None): super(TestMessageLogDetails, self).__init__() self.date_created = date_created self.entry_id = entry_id self.message = message class TestMethod(Model): """TestMethod. :param container: :type container: str :param name: :type name: str """ _attribute_map = { 'container': {'key': 'container', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, container=None, name=None): super(TestMethod, self).__init__() self.container = container self.name = name class TestOperationReference(Model): """TestOperationReference. :param id: :type id: str :param status: :type status: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'status': {'key': 'status', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, status=None, url=None): super(TestOperationReference, self).__init__() self.id = id self.status = status self.url = url class TestOutcomeSettings(Model): """TestOutcomeSettings. :param sync_outcome_across_suites: Value to configure how test outcomes for the same tests across suites are shown :type sync_outcome_across_suites: bool """ _attribute_map = { 'sync_outcome_across_suites': {'key': 'syncOutcomeAcrossSuites', 'type': 'bool'} } def __init__(self, sync_outcome_across_suites=None): super(TestOutcomeSettings, self).__init__() self.sync_outcome_across_suites = sync_outcome_across_suites class TestPlan(Model): """TestPlan. :param area: Area of the test plan. :type area: :class:`ShallowReference ` :param automated_test_environment: :type automated_test_environment: :class:`TestEnvironment ` :param automated_test_settings: :type automated_test_settings: :class:`TestSettings ` :param build: Build to be tested. :type build: :class:`ShallowReference ` :param build_definition: The Build Definition that generates a build associated with this test plan. :type build_definition: :class:`ShallowReference ` :param client_url: :type client_url: str :param description: Description of the test plan. :type description: str :param end_date: End date for the test plan. :type end_date: datetime :param id: ID of the test plan. :type id: int :param iteration: Iteration path of the test plan. :type iteration: str :param manual_test_environment: :type manual_test_environment: :class:`TestEnvironment ` :param manual_test_settings: :type manual_test_settings: :class:`TestSettings ` :param name: Name of the test plan. :type name: str :param owner: Owner of the test plan. :type owner: :class:`IdentityRef ` :param previous_build: :type previous_build: :class:`ShallowReference ` :param project: Project which contains the test plan. :type project: :class:`ShallowReference ` :param release_environment_definition: Release Environment to be used to deploy the build and run automated tests from this test plan. :type release_environment_definition: :class:`ReleaseEnvironmentDefinitionReference ` :param revision: Revision of the test plan. :type revision: int :param root_suite: Root test suite of the test plan. :type root_suite: :class:`ShallowReference ` :param start_date: Start date for the test plan. :type start_date: datetime :param state: State of the test plan. :type state: str :param test_outcome_settings: Value to configure how same tests across test suites under a test plan need to behave :type test_outcome_settings: :class:`TestOutcomeSettings ` :param updated_by: :type updated_by: :class:`IdentityRef ` :param updated_date: :type updated_date: datetime :param url: URL of the test plan resource. :type url: str """ _attribute_map = { 'area': {'key': 'area', 'type': 'ShallowReference'}, 'automated_test_environment': {'key': 'automatedTestEnvironment', 'type': 'TestEnvironment'}, 'automated_test_settings': {'key': 'automatedTestSettings', 'type': 'TestSettings'}, 'build': {'key': 'build', 'type': 'ShallowReference'}, 'build_definition': {'key': 'buildDefinition', 'type': 'ShallowReference'}, 'client_url': {'key': 'clientUrl', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'iteration': {'key': 'iteration', 'type': 'str'}, 'manual_test_environment': {'key': 'manualTestEnvironment', 'type': 'TestEnvironment'}, 'manual_test_settings': {'key': 'manualTestSettings', 'type': 'TestSettings'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'previous_build': {'key': 'previousBuild', 'type': 'ShallowReference'}, 'project': {'key': 'project', 'type': 'ShallowReference'}, 'release_environment_definition': {'key': 'releaseEnvironmentDefinition', 'type': 'ReleaseEnvironmentDefinitionReference'}, 'revision': {'key': 'revision', 'type': 'int'}, 'root_suite': {'key': 'rootSuite', 'type': 'ShallowReference'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'state': {'key': 'state', 'type': 'str'}, 'test_outcome_settings': {'key': 'testOutcomeSettings', 'type': 'TestOutcomeSettings'}, 'updated_by': {'key': 'updatedBy', 'type': 'IdentityRef'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, area=None, automated_test_environment=None, automated_test_settings=None, build=None, build_definition=None, client_url=None, description=None, end_date=None, id=None, iteration=None, manual_test_environment=None, manual_test_settings=None, name=None, owner=None, previous_build=None, project=None, release_environment_definition=None, revision=None, root_suite=None, start_date=None, state=None, test_outcome_settings=None, updated_by=None, updated_date=None, url=None): super(TestPlan, self).__init__() self.area = area self.automated_test_environment = automated_test_environment self.automated_test_settings = automated_test_settings self.build = build self.build_definition = build_definition self.client_url = client_url self.description = description self.end_date = end_date self.id = id self.iteration = iteration self.manual_test_environment = manual_test_environment self.manual_test_settings = manual_test_settings self.name = name self.owner = owner self.previous_build = previous_build self.project = project self.release_environment_definition = release_environment_definition self.revision = revision self.root_suite = root_suite self.start_date = start_date self.state = state self.test_outcome_settings = test_outcome_settings self.updated_by = updated_by self.updated_date = updated_date self.url = url class TestPlanCloneRequest(Model): """TestPlanCloneRequest. :param destination_test_plan: :type destination_test_plan: :class:`TestPlan ` :param options: :type options: :class:`CloneOptions ` :param suite_ids: :type suite_ids: list of int """ _attribute_map = { 'destination_test_plan': {'key': 'destinationTestPlan', 'type': 'TestPlan'}, 'options': {'key': 'options', 'type': 'CloneOptions'}, 'suite_ids': {'key': 'suiteIds', 'type': '[int]'} } def __init__(self, destination_test_plan=None, options=None, suite_ids=None): super(TestPlanCloneRequest, self).__init__() self.destination_test_plan = destination_test_plan self.options = options self.suite_ids = suite_ids class TestPoint(Model): """TestPoint. :param assigned_to: AssignedTo. Type IdentityRef. :type assigned_to: :class:`IdentityRef ` :param automated: Automated. :type automated: bool :param comment: Comment associated with test point. :type comment: str :param configuration: Configuration. Type ShallowReference. :type configuration: :class:`ShallowReference ` :param failure_type: Failure type of test point. :type failure_type: str :param id: ID of the test point. :type id: int :param last_reset_to_active: Last date when test point was reset to Active. :type last_reset_to_active: datetime :param last_resolution_state_id: Last resolution state id of test point. :type last_resolution_state_id: int :param last_result: Last result of test point. Type ShallowReference. :type last_result: :class:`ShallowReference ` :param last_result_details: Last result details of test point. Type LastResultDetails. :type last_result_details: :class:`LastResultDetails ` :param last_result_state: Last result state of test point. :type last_result_state: str :param last_run_build_number: LastRun build number of test point. :type last_run_build_number: str :param last_test_run: Last testRun of test point. Type ShallowReference. :type last_test_run: :class:`ShallowReference ` :param last_updated_by: Test point last updated by. Type IdentityRef. :type last_updated_by: :class:`IdentityRef ` :param last_updated_date: Last updated date of test point. :type last_updated_date: datetime :param outcome: Outcome of test point. :type outcome: str :param revision: Revision number. :type revision: int :param state: State of test point. :type state: str :param suite: Suite of test point. Type ShallowReference. :type suite: :class:`ShallowReference ` :param test_case: TestCase associated to test point. Type WorkItemReference. :type test_case: :class:`WorkItemReference ` :param test_plan: TestPlan of test point. Type ShallowReference. :type test_plan: :class:`ShallowReference ` :param url: Test point Url. :type url: str :param work_item_properties: Work item properties of test point. :type work_item_properties: list of object """ _attribute_map = { 'assigned_to': {'key': 'assignedTo', 'type': 'IdentityRef'}, 'automated': {'key': 'automated', 'type': 'bool'}, 'comment': {'key': 'comment', 'type': 'str'}, 'configuration': {'key': 'configuration', 'type': 'ShallowReference'}, 'failure_type': {'key': 'failureType', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'last_reset_to_active': {'key': 'lastResetToActive', 'type': 'iso-8601'}, 'last_resolution_state_id': {'key': 'lastResolutionStateId', 'type': 'int'}, 'last_result': {'key': 'lastResult', 'type': 'ShallowReference'}, 'last_result_details': {'key': 'lastResultDetails', 'type': 'LastResultDetails'}, 'last_result_state': {'key': 'lastResultState', 'type': 'str'}, 'last_run_build_number': {'key': 'lastRunBuildNumber', 'type': 'str'}, 'last_test_run': {'key': 'lastTestRun', 'type': 'ShallowReference'}, 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'IdentityRef'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'}, 'state': {'key': 'state', 'type': 'str'}, 'suite': {'key': 'suite', 'type': 'ShallowReference'}, 'test_case': {'key': 'testCase', 'type': 'WorkItemReference'}, 'test_plan': {'key': 'testPlan', 'type': 'ShallowReference'}, 'url': {'key': 'url', 'type': 'str'}, 'work_item_properties': {'key': 'workItemProperties', 'type': '[object]'} } def __init__(self, assigned_to=None, automated=None, comment=None, configuration=None, failure_type=None, id=None, last_reset_to_active=None, last_resolution_state_id=None, last_result=None, last_result_details=None, last_result_state=None, last_run_build_number=None, last_test_run=None, last_updated_by=None, last_updated_date=None, outcome=None, revision=None, state=None, suite=None, test_case=None, test_plan=None, url=None, work_item_properties=None): super(TestPoint, self).__init__() self.assigned_to = assigned_to self.automated = automated self.comment = comment self.configuration = configuration self.failure_type = failure_type self.id = id self.last_reset_to_active = last_reset_to_active self.last_resolution_state_id = last_resolution_state_id self.last_result = last_result self.last_result_details = last_result_details self.last_result_state = last_result_state self.last_run_build_number = last_run_build_number self.last_test_run = last_test_run self.last_updated_by = last_updated_by self.last_updated_date = last_updated_date self.outcome = outcome self.revision = revision self.state = state self.suite = suite self.test_case = test_case self.test_plan = test_plan self.url = url self.work_item_properties = work_item_properties class TestPointsQuery(Model): """TestPointsQuery. :param order_by: Order by results. :type order_by: str :param points: List of test points :type points: list of :class:`TestPoint ` :param points_filter: Filter :type points_filter: :class:`PointsFilter ` :param wit_fields: List of workitem fields to get. :type wit_fields: list of str """ _attribute_map = { 'order_by': {'key': 'orderBy', 'type': 'str'}, 'points': {'key': 'points', 'type': '[TestPoint]'}, 'points_filter': {'key': 'pointsFilter', 'type': 'PointsFilter'}, 'wit_fields': {'key': 'witFields', 'type': '[str]'} } def __init__(self, order_by=None, points=None, points_filter=None, wit_fields=None): super(TestPointsQuery, self).__init__() self.order_by = order_by self.points = points self.points_filter = points_filter self.wit_fields = wit_fields class TestResolutionState(Model): """TestResolutionState. :param id: :type id: int :param name: :type name: str :param project: :type project: :class:`ShallowReference ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'project': {'key': 'project', 'type': 'ShallowReference'} } def __init__(self, id=None, name=None, project=None): super(TestResolutionState, self).__init__() self.id = id self.name = name self.project = project class TestResultCreateModel(Model): """TestResultCreateModel. :param area: :type area: :class:`ShallowReference ` :param associated_work_items: :type associated_work_items: list of int :param automated_test_id: :type automated_test_id: str :param automated_test_name: :type automated_test_name: str :param automated_test_storage: :type automated_test_storage: str :param automated_test_type: :type automated_test_type: str :param automated_test_type_id: :type automated_test_type_id: str :param comment: :type comment: str :param completed_date: :type completed_date: str :param computer_name: :type computer_name: str :param configuration: :type configuration: :class:`ShallowReference ` :param custom_fields: :type custom_fields: list of :class:`CustomTestField ` :param duration_in_ms: :type duration_in_ms: str :param error_message: :type error_message: str :param failure_type: :type failure_type: str :param outcome: :type outcome: str :param owner: :type owner: :class:`IdentityRef ` :param resolution_state: :type resolution_state: str :param run_by: :type run_by: :class:`IdentityRef ` :param stack_trace: :type stack_trace: str :param started_date: :type started_date: str :param state: :type state: str :param test_case: :type test_case: :class:`ShallowReference ` :param test_case_priority: :type test_case_priority: str :param test_case_title: :type test_case_title: str :param test_point: :type test_point: :class:`ShallowReference ` """ _attribute_map = { 'area': {'key': 'area', 'type': 'ShallowReference'}, 'associated_work_items': {'key': 'associatedWorkItems', 'type': '[int]'}, 'automated_test_id': {'key': 'automatedTestId', 'type': 'str'}, 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, 'automated_test_storage': {'key': 'automatedTestStorage', 'type': 'str'}, 'automated_test_type': {'key': 'automatedTestType', 'type': 'str'}, 'automated_test_type_id': {'key': 'automatedTestTypeId', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'str'}, 'computer_name': {'key': 'computerName', 'type': 'str'}, 'configuration': {'key': 'configuration', 'type': 'ShallowReference'}, 'custom_fields': {'key': 'customFields', 'type': '[CustomTestField]'}, 'duration_in_ms': {'key': 'durationInMs', 'type': 'str'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'failure_type': {'key': 'failureType', 'type': 'str'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'resolution_state': {'key': 'resolutionState', 'type': 'str'}, 'run_by': {'key': 'runBy', 'type': 'IdentityRef'}, 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, 'started_date': {'key': 'startedDate', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'test_case': {'key': 'testCase', 'type': 'ShallowReference'}, 'test_case_priority': {'key': 'testCasePriority', 'type': 'str'}, 'test_case_title': {'key': 'testCaseTitle', 'type': 'str'}, 'test_point': {'key': 'testPoint', 'type': 'ShallowReference'} } def __init__(self, area=None, associated_work_items=None, automated_test_id=None, automated_test_name=None, automated_test_storage=None, automated_test_type=None, automated_test_type_id=None, comment=None, completed_date=None, computer_name=None, configuration=None, custom_fields=None, duration_in_ms=None, error_message=None, failure_type=None, outcome=None, owner=None, resolution_state=None, run_by=None, stack_trace=None, started_date=None, state=None, test_case=None, test_case_priority=None, test_case_title=None, test_point=None): super(TestResultCreateModel, self).__init__() self.area = area self.associated_work_items = associated_work_items self.automated_test_id = automated_test_id self.automated_test_name = automated_test_name self.automated_test_storage = automated_test_storage self.automated_test_type = automated_test_type self.automated_test_type_id = automated_test_type_id self.comment = comment self.completed_date = completed_date self.computer_name = computer_name self.configuration = configuration self.custom_fields = custom_fields self.duration_in_ms = duration_in_ms self.error_message = error_message self.failure_type = failure_type self.outcome = outcome self.owner = owner self.resolution_state = resolution_state self.run_by = run_by self.stack_trace = stack_trace self.started_date = started_date self.state = state self.test_case = test_case self.test_case_priority = test_case_priority self.test_case_title = test_case_title self.test_point = test_point class TestResultDocument(Model): """TestResultDocument. :param operation_reference: :type operation_reference: :class:`TestOperationReference ` :param payload: :type payload: :class:`TestResultPayload ` """ _attribute_map = { 'operation_reference': {'key': 'operationReference', 'type': 'TestOperationReference'}, 'payload': {'key': 'payload', 'type': 'TestResultPayload'} } def __init__(self, operation_reference=None, payload=None): super(TestResultDocument, self).__init__() self.operation_reference = operation_reference self.payload = payload class TestResultHistory(Model): """TestResultHistory. :param group_by_field: :type group_by_field: str :param results_for_group: :type results_for_group: list of :class:`TestResultHistoryDetailsForGroup ` """ _attribute_map = { 'group_by_field': {'key': 'groupByField', 'type': 'str'}, 'results_for_group': {'key': 'resultsForGroup', 'type': '[TestResultHistoryDetailsForGroup]'} } def __init__(self, group_by_field=None, results_for_group=None): super(TestResultHistory, self).__init__() self.group_by_field = group_by_field self.results_for_group = results_for_group class TestResultHistoryDetailsForGroup(Model): """TestResultHistoryDetailsForGroup. :param group_by_value: :type group_by_value: object :param latest_result: :type latest_result: :class:`TestCaseResult ` """ _attribute_map = { 'group_by_value': {'key': 'groupByValue', 'type': 'object'}, 'latest_result': {'key': 'latestResult', 'type': 'TestCaseResult'} } def __init__(self, group_by_value=None, latest_result=None): super(TestResultHistoryDetailsForGroup, self).__init__() self.group_by_value = group_by_value self.latest_result = latest_result class TestResultHistoryForGroup(Model): """TestResultHistoryForGroup. :param display_name: Display name of the group. :type display_name: str :param group_by_value: Name or Id of the group identifier by which results are grouped together. :type group_by_value: str :param results: List of results for GroupByValue :type results: list of :class:`TestCaseResult ` """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'group_by_value': {'key': 'groupByValue', 'type': 'str'}, 'results': {'key': 'results', 'type': '[TestCaseResult]'} } def __init__(self, display_name=None, group_by_value=None, results=None): super(TestResultHistoryForGroup, self).__init__() self.display_name = display_name self.group_by_value = group_by_value self.results = results class TestResultMetaData(Model): """TestResultMetaData. :param automated_test_name: AutomatedTestName of test result. :type automated_test_name: str :param automated_test_storage: AutomatedTestStorage of test result. :type automated_test_storage: str :param owner: Owner of test result. :type owner: str :param priority: Priority of test result. :type priority: int :param test_case_reference_id: ID of TestCaseReference. :type test_case_reference_id: int :param test_case_title: TestCaseTitle of test result. :type test_case_title: str """ _attribute_map = { 'automated_test_name': {'key': 'automatedTestName', 'type': 'str'}, 'automated_test_storage': {'key': 'automatedTestStorage', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'str'}, 'priority': {'key': 'priority', 'type': 'int'}, 'test_case_reference_id': {'key': 'testCaseReferenceId', 'type': 'int'}, 'test_case_title': {'key': 'testCaseTitle', 'type': 'str'} } def __init__(self, automated_test_name=None, automated_test_storage=None, owner=None, priority=None, test_case_reference_id=None, test_case_title=None): super(TestResultMetaData, self).__init__() self.automated_test_name = automated_test_name self.automated_test_storage = automated_test_storage self.owner = owner self.priority = priority self.test_case_reference_id = test_case_reference_id self.test_case_title = test_case_title class TestResultModelBase(Model): """TestResultModelBase. :param comment: Comment in result. :type comment: str :param completed_date: Time when execution completed. :type completed_date: datetime :param duration_in_ms: Duration of execution. :type duration_in_ms: float :param error_message: Error message in result. :type error_message: str :param outcome: Test outcome of result. :type outcome: str :param started_date: Time when execution started. :type started_date: datetime """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, 'duration_in_ms': {'key': 'durationInMs', 'type': 'float'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'started_date': {'key': 'startedDate', 'type': 'iso-8601'} } def __init__(self, comment=None, completed_date=None, duration_in_ms=None, error_message=None, outcome=None, started_date=None): super(TestResultModelBase, self).__init__() self.comment = comment self.completed_date = completed_date self.duration_in_ms = duration_in_ms self.error_message = error_message self.outcome = outcome self.started_date = started_date class TestResultParameterModel(Model): """TestResultParameterModel. :param action_path: Test step path where parameter is referenced. :type action_path: str :param iteration_id: Iteration ID. :type iteration_id: int :param parameter_name: Name of parameter. :type parameter_name: str :param step_identifier: This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: "1" Second step: "2;1" :type step_identifier: str :param url: Url of test parameter. :type url: str :param value: Value of parameter. :type value: str """ _attribute_map = { 'action_path': {'key': 'actionPath', 'type': 'str'}, 'iteration_id': {'key': 'iterationId', 'type': 'int'}, 'parameter_name': {'key': 'parameterName', 'type': 'str'}, 'step_identifier': {'key': 'stepIdentifier', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, action_path=None, iteration_id=None, parameter_name=None, step_identifier=None, url=None, value=None): super(TestResultParameterModel, self).__init__() self.action_path = action_path self.iteration_id = iteration_id self.parameter_name = parameter_name self.step_identifier = step_identifier self.url = url self.value = value class TestResultPayload(Model): """TestResultPayload. :param comment: :type comment: str :param name: :type name: str :param stream: :type stream: str """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'stream': {'key': 'stream', 'type': 'str'} } def __init__(self, comment=None, name=None, stream=None): super(TestResultPayload, self).__init__() self.comment = comment self.name = name self.stream = stream class TestResultsContext(Model): """TestResultsContext. :param build: :type build: :class:`BuildReference ` :param context_type: :type context_type: object :param release: :type release: :class:`ReleaseReference ` """ _attribute_map = { 'build': {'key': 'build', 'type': 'BuildReference'}, 'context_type': {'key': 'contextType', 'type': 'object'}, 'release': {'key': 'release', 'type': 'ReleaseReference'} } def __init__(self, build=None, context_type=None, release=None): super(TestResultsContext, self).__init__() self.build = build self.context_type = context_type self.release = release class TestResultsDetails(Model): """TestResultsDetails. :param group_by_field: :type group_by_field: str :param results_for_group: :type results_for_group: list of :class:`TestResultsDetailsForGroup ` """ _attribute_map = { 'group_by_field': {'key': 'groupByField', 'type': 'str'}, 'results_for_group': {'key': 'resultsForGroup', 'type': '[TestResultsDetailsForGroup]'} } def __init__(self, group_by_field=None, results_for_group=None): super(TestResultsDetails, self).__init__() self.group_by_field = group_by_field self.results_for_group = results_for_group class TestResultsDetailsForGroup(Model): """TestResultsDetailsForGroup. :param group_by_value: :type group_by_value: object :param results: :type results: list of :class:`TestCaseResult ` :param results_count_by_outcome: :type results_count_by_outcome: dict """ _attribute_map = { 'group_by_value': {'key': 'groupByValue', 'type': 'object'}, 'results': {'key': 'results', 'type': '[TestCaseResult]'}, 'results_count_by_outcome': {'key': 'resultsCountByOutcome', 'type': '{AggregatedResultsByOutcome}'} } def __init__(self, group_by_value=None, results=None, results_count_by_outcome=None): super(TestResultsDetailsForGroup, self).__init__() self.group_by_value = group_by_value self.results = results self.results_count_by_outcome = results_count_by_outcome class TestResultsGroupsForBuild(Model): """TestResultsGroupsForBuild. :param build_id: BuildId for which groupby result is fetched. :type build_id: int :param fields: The group by results :type fields: list of :class:`FieldDetailsForTestResults ` """ _attribute_map = { 'build_id': {'key': 'buildId', 'type': 'int'}, 'fields': {'key': 'fields', 'type': '[FieldDetailsForTestResults]'} } def __init__(self, build_id=None, fields=None): super(TestResultsGroupsForBuild, self).__init__() self.build_id = build_id self.fields = fields class TestResultsGroupsForRelease(Model): """TestResultsGroupsForRelease. :param fields: The group by results :type fields: list of :class:`FieldDetailsForTestResults ` :param release_env_id: Release Environment Id for which groupby result is fetched. :type release_env_id: int :param release_id: ReleaseId for which groupby result is fetched. :type release_id: int """ _attribute_map = { 'fields': {'key': 'fields', 'type': '[FieldDetailsForTestResults]'}, 'release_env_id': {'key': 'releaseEnvId', 'type': 'int'}, 'release_id': {'key': 'releaseId', 'type': 'int'} } def __init__(self, fields=None, release_env_id=None, release_id=None): super(TestResultsGroupsForRelease, self).__init__() self.fields = fields self.release_env_id = release_env_id self.release_id = release_id class TestResultsQuery(Model): """TestResultsQuery. :param fields: :type fields: list of str :param results: :type results: list of :class:`TestCaseResult ` :param results_filter: :type results_filter: :class:`ResultsFilter ` """ _attribute_map = { 'fields': {'key': 'fields', 'type': '[str]'}, 'results': {'key': 'results', 'type': '[TestCaseResult]'}, 'results_filter': {'key': 'resultsFilter', 'type': 'ResultsFilter'} } def __init__(self, fields=None, results=None, results_filter=None): super(TestResultsQuery, self).__init__() self.fields = fields self.results = results self.results_filter = results_filter class TestResultSummary(Model): """TestResultSummary. :param aggregated_results_analysis: :type aggregated_results_analysis: :class:`AggregatedResultsAnalysis ` :param team_project: :type team_project: :class:`TeamProjectReference ` :param test_failures: :type test_failures: :class:`TestFailuresAnalysis ` :param test_results_context: :type test_results_context: :class:`TestResultsContext ` """ _attribute_map = { 'aggregated_results_analysis': {'key': 'aggregatedResultsAnalysis', 'type': 'AggregatedResultsAnalysis'}, 'team_project': {'key': 'teamProject', 'type': 'TeamProjectReference'}, 'test_failures': {'key': 'testFailures', 'type': 'TestFailuresAnalysis'}, 'test_results_context': {'key': 'testResultsContext', 'type': 'TestResultsContext'} } def __init__(self, aggregated_results_analysis=None, team_project=None, test_failures=None, test_results_context=None): super(TestResultSummary, self).__init__() self.aggregated_results_analysis = aggregated_results_analysis self.team_project = team_project self.test_failures = test_failures self.test_results_context = test_results_context class TestResultTrendFilter(Model): """TestResultTrendFilter. :param branch_names: :type branch_names: list of str :param build_count: :type build_count: int :param definition_ids: :type definition_ids: list of int :param env_definition_ids: :type env_definition_ids: list of int :param max_complete_date: :type max_complete_date: datetime :param publish_context: :type publish_context: str :param test_run_titles: :type test_run_titles: list of str :param trend_days: :type trend_days: int """ _attribute_map = { 'branch_names': {'key': 'branchNames', 'type': '[str]'}, 'build_count': {'key': 'buildCount', 'type': 'int'}, 'definition_ids': {'key': 'definitionIds', 'type': '[int]'}, 'env_definition_ids': {'key': 'envDefinitionIds', 'type': '[int]'}, 'max_complete_date': {'key': 'maxCompleteDate', 'type': 'iso-8601'}, 'publish_context': {'key': 'publishContext', 'type': 'str'}, 'test_run_titles': {'key': 'testRunTitles', 'type': '[str]'}, 'trend_days': {'key': 'trendDays', 'type': 'int'} } def __init__(self, branch_names=None, build_count=None, definition_ids=None, env_definition_ids=None, max_complete_date=None, publish_context=None, test_run_titles=None, trend_days=None): super(TestResultTrendFilter, self).__init__() self.branch_names = branch_names self.build_count = build_count self.definition_ids = definition_ids self.env_definition_ids = env_definition_ids self.max_complete_date = max_complete_date self.publish_context = publish_context self.test_run_titles = test_run_titles self.trend_days = trend_days class TestRun(Model): """TestRun. :param build: Build associated with this test run. :type build: :class:`ShallowReference ` :param build_configuration: Build configuration details associated with this test run. :type build_configuration: :class:`BuildConfiguration ` :param comment: Comments entered by those analyzing the run. :type comment: str :param completed_date: Completed date time of the run. :type completed_date: datetime :param controller: :type controller: str :param created_date: :type created_date: datetime :param custom_fields: :type custom_fields: list of :class:`CustomTestField ` :param drop_location: :type drop_location: str :param dtl_aut_environment: :type dtl_aut_environment: :class:`ShallowReference ` :param dtl_environment: :type dtl_environment: :class:`ShallowReference ` :param dtl_environment_creation_details: :type dtl_environment_creation_details: :class:`DtlEnvironmentDetails ` :param due_date: Due date and time for test run. :type due_date: datetime :param error_message: Error message associated with the run. :type error_message: str :param filter: :type filter: :class:`RunFilter ` :param id: ID of the test run. :type id: int :param incomplete_tests: :type incomplete_tests: int :param is_automated: true if test run is automated, false otherwise. :type is_automated: bool :param iteration: The iteration to which the run belongs. :type iteration: str :param last_updated_by: Team foundation ID of the last updated the test run. :type last_updated_by: :class:`IdentityRef ` :param last_updated_date: Last updated date and time :type last_updated_date: datetime :param name: Name of the test run. :type name: str :param not_applicable_tests: :type not_applicable_tests: int :param owner: Team Foundation ID of the owner of the runs. :type owner: :class:`IdentityRef ` :param passed_tests: Number of passed tests in the run :type passed_tests: int :param phase: :type phase: str :param plan: Test plan associated with this test run. :type plan: :class:`ShallowReference ` :param post_process_state: :type post_process_state: str :param project: Project associated with this run. :type project: :class:`ShallowReference ` :param release: :type release: :class:`ReleaseReference ` :param release_environment_uri: :type release_environment_uri: str :param release_uri: :type release_uri: str :param revision: :type revision: int :param run_statistics: :type run_statistics: list of :class:`RunStatistic ` :param started_date: Start date time of the run. :type started_date: datetime :param state: The state of the run. { NotStarted, InProgress, Waiting } :type state: str :param substate: :type substate: object :param test_environment: Test environment associated with the run. :type test_environment: :class:`TestEnvironment ` :param test_message_log_id: :type test_message_log_id: int :param test_settings: :type test_settings: :class:`ShallowReference ` :param total_tests: Total tests in the run :type total_tests: int :param unanalyzed_tests: :type unanalyzed_tests: int :param url: Url of the test run :type url: str :param web_access_url: :type web_access_url: str """ _attribute_map = { 'build': {'key': 'build', 'type': 'ShallowReference'}, 'build_configuration': {'key': 'buildConfiguration', 'type': 'BuildConfiguration'}, 'comment': {'key': 'comment', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, 'controller': {'key': 'controller', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'custom_fields': {'key': 'customFields', 'type': '[CustomTestField]'}, 'drop_location': {'key': 'dropLocation', 'type': 'str'}, 'dtl_aut_environment': {'key': 'dtlAutEnvironment', 'type': 'ShallowReference'}, 'dtl_environment': {'key': 'dtlEnvironment', 'type': 'ShallowReference'}, 'dtl_environment_creation_details': {'key': 'dtlEnvironmentCreationDetails', 'type': 'DtlEnvironmentDetails'}, 'due_date': {'key': 'dueDate', 'type': 'iso-8601'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'filter': {'key': 'filter', 'type': 'RunFilter'}, 'id': {'key': 'id', 'type': 'int'}, 'incomplete_tests': {'key': 'incompleteTests', 'type': 'int'}, 'is_automated': {'key': 'isAutomated', 'type': 'bool'}, 'iteration': {'key': 'iteration', 'type': 'str'}, 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'IdentityRef'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'not_applicable_tests': {'key': 'notApplicableTests', 'type': 'int'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'passed_tests': {'key': 'passedTests', 'type': 'int'}, 'phase': {'key': 'phase', 'type': 'str'}, 'plan': {'key': 'plan', 'type': 'ShallowReference'}, 'post_process_state': {'key': 'postProcessState', 'type': 'str'}, 'project': {'key': 'project', 'type': 'ShallowReference'}, 'release': {'key': 'release', 'type': 'ReleaseReference'}, 'release_environment_uri': {'key': 'releaseEnvironmentUri', 'type': 'str'}, 'release_uri': {'key': 'releaseUri', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'}, 'run_statistics': {'key': 'runStatistics', 'type': '[RunStatistic]'}, 'started_date': {'key': 'startedDate', 'type': 'iso-8601'}, 'state': {'key': 'state', 'type': 'str'}, 'substate': {'key': 'substate', 'type': 'object'}, 'test_environment': {'key': 'testEnvironment', 'type': 'TestEnvironment'}, 'test_message_log_id': {'key': 'testMessageLogId', 'type': 'int'}, 'test_settings': {'key': 'testSettings', 'type': 'ShallowReference'}, 'total_tests': {'key': 'totalTests', 'type': 'int'}, 'unanalyzed_tests': {'key': 'unanalyzedTests', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'}, 'web_access_url': {'key': 'webAccessUrl', 'type': 'str'} } def __init__(self, build=None, build_configuration=None, comment=None, completed_date=None, controller=None, created_date=None, custom_fields=None, drop_location=None, dtl_aut_environment=None, dtl_environment=None, dtl_environment_creation_details=None, due_date=None, error_message=None, filter=None, id=None, incomplete_tests=None, is_automated=None, iteration=None, last_updated_by=None, last_updated_date=None, name=None, not_applicable_tests=None, owner=None, passed_tests=None, phase=None, plan=None, post_process_state=None, project=None, release=None, release_environment_uri=None, release_uri=None, revision=None, run_statistics=None, started_date=None, state=None, substate=None, test_environment=None, test_message_log_id=None, test_settings=None, total_tests=None, unanalyzed_tests=None, url=None, web_access_url=None): super(TestRun, self).__init__() self.build = build self.build_configuration = build_configuration self.comment = comment self.completed_date = completed_date self.controller = controller self.created_date = created_date self.custom_fields = custom_fields self.drop_location = drop_location self.dtl_aut_environment = dtl_aut_environment self.dtl_environment = dtl_environment self.dtl_environment_creation_details = dtl_environment_creation_details self.due_date = due_date self.error_message = error_message self.filter = filter self.id = id self.incomplete_tests = incomplete_tests self.is_automated = is_automated self.iteration = iteration self.last_updated_by = last_updated_by self.last_updated_date = last_updated_date self.name = name self.not_applicable_tests = not_applicable_tests self.owner = owner self.passed_tests = passed_tests self.phase = phase self.plan = plan self.post_process_state = post_process_state self.project = project self.release = release self.release_environment_uri = release_environment_uri self.release_uri = release_uri self.revision = revision self.run_statistics = run_statistics self.started_date = started_date self.state = state self.substate = substate self.test_environment = test_environment self.test_message_log_id = test_message_log_id self.test_settings = test_settings self.total_tests = total_tests self.unanalyzed_tests = unanalyzed_tests self.url = url self.web_access_url = web_access_url class TestRunCoverage(Model): """TestRunCoverage. :param last_error: Last Error :type last_error: str :param modules: List of Modules Coverage :type modules: list of :class:`ModuleCoverage ` :param state: State :type state: str :param test_run: Reference of test Run. :type test_run: :class:`ShallowReference ` """ _attribute_map = { 'last_error': {'key': 'lastError', 'type': 'str'}, 'modules': {'key': 'modules', 'type': '[ModuleCoverage]'}, 'state': {'key': 'state', 'type': 'str'}, 'test_run': {'key': 'testRun', 'type': 'ShallowReference'} } def __init__(self, last_error=None, modules=None, state=None, test_run=None): super(TestRunCoverage, self).__init__() self.last_error = last_error self.modules = modules self.state = state self.test_run = test_run class TestRunStatistic(Model): """TestRunStatistic. :param run: :type run: :class:`ShallowReference ` :param run_statistics: :type run_statistics: list of :class:`RunStatistic ` """ _attribute_map = { 'run': {'key': 'run', 'type': 'ShallowReference'}, 'run_statistics': {'key': 'runStatistics', 'type': '[RunStatistic]'} } def __init__(self, run=None, run_statistics=None): super(TestRunStatistic, self).__init__() self.run = run self.run_statistics = run_statistics class TestSession(Model): """TestSession. :param area: Area path of the test session :type area: :class:`ShallowReference ` :param comment: Comments in the test session :type comment: str :param end_date: Duration of the session :type end_date: datetime :param id: Id of the test session :type id: int :param last_updated_by: Last Updated By Reference :type last_updated_by: :class:`IdentityRef ` :param last_updated_date: Last updated date :type last_updated_date: datetime :param owner: Owner of the test session :type owner: :class:`IdentityRef ` :param project: Project to which the test session belongs :type project: :class:`ShallowReference ` :param property_bag: Generic store for test session data :type property_bag: :class:`PropertyBag ` :param revision: Revision of the test session :type revision: int :param source: Source of the test session :type source: object :param start_date: Start date :type start_date: datetime :param state: State of the test session :type state: object :param title: Title of the test session :type title: str :param url: Url of Test Session Resource :type url: str """ _attribute_map = { 'area': {'key': 'area', 'type': 'ShallowReference'}, 'comment': {'key': 'comment', 'type': 'str'}, 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'IdentityRef'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'project': {'key': 'project', 'type': 'ShallowReference'}, 'property_bag': {'key': 'propertyBag', 'type': 'PropertyBag'}, 'revision': {'key': 'revision', 'type': 'int'}, 'source': {'key': 'source', 'type': 'object'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'state': {'key': 'state', 'type': 'object'}, 'title': {'key': 'title', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, area=None, comment=None, end_date=None, id=None, last_updated_by=None, last_updated_date=None, owner=None, project=None, property_bag=None, revision=None, source=None, start_date=None, state=None, title=None, url=None): super(TestSession, self).__init__() self.area = area self.comment = comment self.end_date = end_date self.id = id self.last_updated_by = last_updated_by self.last_updated_date = last_updated_date self.owner = owner self.project = project self.property_bag = property_bag self.revision = revision self.source = source self.start_date = start_date self.state = state self.title = title self.url = url class TestSettings(Model): """TestSettings. :param area_path: Area path required to create test settings :type area_path: str :param description: Description of the test settings. Used in create test settings. :type description: str :param is_public: Indicates if the tests settings is public or private.Used in create test settings. :type is_public: bool :param machine_roles: Xml string of machine roles. Used in create test settings. :type machine_roles: str :param test_settings_content: Test settings content. :type test_settings_content: str :param test_settings_id: Test settings id. :type test_settings_id: int :param test_settings_name: Test settings name. :type test_settings_name: str """ _attribute_map = { 'area_path': {'key': 'areaPath', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'is_public': {'key': 'isPublic', 'type': 'bool'}, 'machine_roles': {'key': 'machineRoles', 'type': 'str'}, 'test_settings_content': {'key': 'testSettingsContent', 'type': 'str'}, 'test_settings_id': {'key': 'testSettingsId', 'type': 'int'}, 'test_settings_name': {'key': 'testSettingsName', 'type': 'str'} } def __init__(self, area_path=None, description=None, is_public=None, machine_roles=None, test_settings_content=None, test_settings_id=None, test_settings_name=None): super(TestSettings, self).__init__() self.area_path = area_path self.description = description self.is_public = is_public self.machine_roles = machine_roles self.test_settings_content = test_settings_content self.test_settings_id = test_settings_id self.test_settings_name = test_settings_name class TestSubResult(Model): """TestSubResult. :param comment: Comment in sub result. :type comment: str :param completed_date: Time when test execution completed. :type completed_date: datetime :param computer_name: Machine where test executed. :type computer_name: str :param configuration: Reference to test configuration. :type configuration: :class:`ShallowReference ` :param custom_fields: Additional properties of sub result. :type custom_fields: list of :class:`CustomTestField ` :param display_name: Name of sub result. :type display_name: str :param duration_in_ms: Duration of test execution. :type duration_in_ms: long :param error_message: Error message in sub result. :type error_message: str :param id: ID of sub result. :type id: int :param last_updated_date: Time when result last updated. :type last_updated_date: datetime :param outcome: Outcome of sub result. :type outcome: str :param parent_id: Immediate parent ID of sub result. :type parent_id: int :param result_group_type: Hierarchy type of the result, default value of None means its leaf node. :type result_group_type: object :param sequence_id: Index number of sub result. :type sequence_id: int :param stack_trace: Stacktrace. :type stack_trace: str :param started_date: Time when test execution started. :type started_date: datetime :param sub_results: List of sub results inside a sub result, if ResultGroupType is not None, it holds corresponding type sub results. :type sub_results: list of :class:`TestSubResult ` :param test_result: Reference to test result. :type test_result: :class:`TestCaseResultIdentifier ` :param url: Url of sub result. :type url: str """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, 'computer_name': {'key': 'computerName', 'type': 'str'}, 'configuration': {'key': 'configuration', 'type': 'ShallowReference'}, 'custom_fields': {'key': 'customFields', 'type': '[CustomTestField]'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'duration_in_ms': {'key': 'durationInMs', 'type': 'long'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'parent_id': {'key': 'parentId', 'type': 'int'}, 'result_group_type': {'key': 'resultGroupType', 'type': 'object'}, 'sequence_id': {'key': 'sequenceId', 'type': 'int'}, 'stack_trace': {'key': 'stackTrace', 'type': 'str'}, 'started_date': {'key': 'startedDate', 'type': 'iso-8601'}, 'sub_results': {'key': 'subResults', 'type': '[TestSubResult]'}, 'test_result': {'key': 'testResult', 'type': 'TestCaseResultIdentifier'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, comment=None, completed_date=None, computer_name=None, configuration=None, custom_fields=None, display_name=None, duration_in_ms=None, error_message=None, id=None, last_updated_date=None, outcome=None, parent_id=None, result_group_type=None, sequence_id=None, stack_trace=None, started_date=None, sub_results=None, test_result=None, url=None): super(TestSubResult, self).__init__() self.comment = comment self.completed_date = completed_date self.computer_name = computer_name self.configuration = configuration self.custom_fields = custom_fields self.display_name = display_name self.duration_in_ms = duration_in_ms self.error_message = error_message self.id = id self.last_updated_date = last_updated_date self.outcome = outcome self.parent_id = parent_id self.result_group_type = result_group_type self.sequence_id = sequence_id self.stack_trace = stack_trace self.started_date = started_date self.sub_results = sub_results self.test_result = test_result self.url = url class TestSuite(Model): """TestSuite. :param area_uri: Area uri of the test suite. :type area_uri: str :param children: Child test suites of current test suite. :type children: list of :class:`TestSuite ` :param default_configurations: Test suite default configuration. :type default_configurations: list of :class:`ShallowReference ` :param default_testers: Test suite default testers. :type default_testers: list of :class:`ShallowReference ` :param id: Id of test suite. :type id: int :param inherit_default_configurations: Default configuration was inherited or not. :type inherit_default_configurations: bool :param last_error: Last error for test suite. :type last_error: str :param last_populated_date: Last populated date. :type last_populated_date: datetime :param last_updated_by: IdentityRef of user who has updated test suite recently. :type last_updated_by: :class:`IdentityRef ` :param last_updated_date: Last update date. :type last_updated_date: datetime :param name: Name of test suite. :type name: str :param parent: Test suite parent shallow reference. :type parent: :class:`ShallowReference ` :param plan: Test plan to which the test suite belongs. :type plan: :class:`ShallowReference ` :param project: Test suite project shallow reference. :type project: :class:`ShallowReference ` :param query_string: Test suite query string, for dynamic suites. :type query_string: str :param requirement_id: Test suite requirement id. :type requirement_id: int :param revision: Test suite revision. :type revision: int :param state: State of test suite. :type state: str :param suites: List of shallow reference of suites. :type suites: list of :class:`ShallowReference ` :param suite_type: Test suite type. :type suite_type: str :param test_case_count: Test cases count. :type test_case_count: int :param test_cases_url: Test case url. :type test_cases_url: str :param text: Used in tree view. If test suite is root suite then, it is name of plan otherwise title of the suite. :type text: str :param url: Url of test suite. :type url: str """ _attribute_map = { 'area_uri': {'key': 'areaUri', 'type': 'str'}, 'children': {'key': 'children', 'type': '[TestSuite]'}, 'default_configurations': {'key': 'defaultConfigurations', 'type': '[ShallowReference]'}, 'default_testers': {'key': 'defaultTesters', 'type': '[ShallowReference]'}, 'id': {'key': 'id', 'type': 'int'}, 'inherit_default_configurations': {'key': 'inheritDefaultConfigurations', 'type': 'bool'}, 'last_error': {'key': 'lastError', 'type': 'str'}, 'last_populated_date': {'key': 'lastPopulatedDate', 'type': 'iso-8601'}, 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'IdentityRef'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'parent': {'key': 'parent', 'type': 'ShallowReference'}, 'plan': {'key': 'plan', 'type': 'ShallowReference'}, 'project': {'key': 'project', 'type': 'ShallowReference'}, 'query_string': {'key': 'queryString', 'type': 'str'}, 'requirement_id': {'key': 'requirementId', 'type': 'int'}, 'revision': {'key': 'revision', 'type': 'int'}, 'state': {'key': 'state', 'type': 'str'}, 'suites': {'key': 'suites', 'type': '[ShallowReference]'}, 'suite_type': {'key': 'suiteType', 'type': 'str'}, 'test_case_count': {'key': 'testCaseCount', 'type': 'int'}, 'test_cases_url': {'key': 'testCasesUrl', 'type': 'str'}, 'text': {'key': 'text', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, area_uri=None, children=None, default_configurations=None, default_testers=None, id=None, inherit_default_configurations=None, last_error=None, last_populated_date=None, last_updated_by=None, last_updated_date=None, name=None, parent=None, plan=None, project=None, query_string=None, requirement_id=None, revision=None, state=None, suites=None, suite_type=None, test_case_count=None, test_cases_url=None, text=None, url=None): super(TestSuite, self).__init__() self.area_uri = area_uri self.children = children self.default_configurations = default_configurations self.default_testers = default_testers self.id = id self.inherit_default_configurations = inherit_default_configurations self.last_error = last_error self.last_populated_date = last_populated_date self.last_updated_by = last_updated_by self.last_updated_date = last_updated_date self.name = name self.parent = parent self.plan = plan self.project = project self.query_string = query_string self.requirement_id = requirement_id self.revision = revision self.state = state self.suites = suites self.suite_type = suite_type self.test_case_count = test_case_count self.test_cases_url = test_cases_url self.text = text self.url = url class TestSuiteCloneRequest(Model): """TestSuiteCloneRequest. :param clone_options: Clone options for cloning the test suite. :type clone_options: :class:`CloneOptions ` :param destination_suite_id: Suite id under which, we have to clone the suite. :type destination_suite_id: int :param destination_suite_project_name: Destination suite project name. :type destination_suite_project_name: str """ _attribute_map = { 'clone_options': {'key': 'cloneOptions', 'type': 'CloneOptions'}, 'destination_suite_id': {'key': 'destinationSuiteId', 'type': 'int'}, 'destination_suite_project_name': {'key': 'destinationSuiteProjectName', 'type': 'str'} } def __init__(self, clone_options=None, destination_suite_id=None, destination_suite_project_name=None): super(TestSuiteCloneRequest, self).__init__() self.clone_options = clone_options self.destination_suite_id = destination_suite_id self.destination_suite_project_name = destination_suite_project_name class TestSummaryForWorkItem(Model): """TestSummaryForWorkItem. :param summary: :type summary: :class:`AggregatedDataForResultTrend ` :param work_item: :type work_item: :class:`WorkItemReference ` """ _attribute_map = { 'summary': {'key': 'summary', 'type': 'AggregatedDataForResultTrend'}, 'work_item': {'key': 'workItem', 'type': 'WorkItemReference'} } def __init__(self, summary=None, work_item=None): super(TestSummaryForWorkItem, self).__init__() self.summary = summary self.work_item = work_item class TestToWorkItemLinks(Model): """TestToWorkItemLinks. :param test: :type test: :class:`TestMethod ` :param work_items: :type work_items: list of :class:`WorkItemReference ` """ _attribute_map = { 'test': {'key': 'test', 'type': 'TestMethod'}, 'work_items': {'key': 'workItems', 'type': '[WorkItemReference]'} } def __init__(self, test=None, work_items=None): super(TestToWorkItemLinks, self).__init__() self.test = test self.work_items = work_items class TestVariable(Model): """TestVariable. :param description: Description of the test variable :type description: str :param id: Id of the test variable :type id: int :param name: Name of the test variable :type name: str :param project: Project to which the test variable belongs :type project: :class:`ShallowReference ` :param revision: Revision :type revision: int :param url: Url of the test variable :type url: str :param values: List of allowed values :type values: list of str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'project': {'key': 'project', 'type': 'ShallowReference'}, 'revision': {'key': 'revision', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'}, 'values': {'key': 'values', 'type': '[str]'} } def __init__(self, description=None, id=None, name=None, project=None, revision=None, url=None, values=None): super(TestVariable, self).__init__() self.description = description self.id = id self.name = name self.project = project self.revision = revision self.url = url self.values = values class WorkItemReference(Model): """WorkItemReference. :param id: :type id: str :param name: :type name: str :param type: :type type: str :param url: :type url: str :param web_url: :type web_url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'web_url': {'key': 'webUrl', 'type': 'str'} } def __init__(self, id=None, name=None, type=None, url=None, web_url=None): super(WorkItemReference, self).__init__() self.id = id self.name = name self.type = type self.url = url self.web_url = web_url class WorkItemToTestLinks(Model): """WorkItemToTestLinks. :param executed_in: :type executed_in: object :param tests: :type tests: list of :class:`TestMethod ` :param work_item: :type work_item: :class:`WorkItemReference ` """ _attribute_map = { 'executed_in': {'key': 'executedIn', 'type': 'object'}, 'tests': {'key': 'tests', 'type': '[TestMethod]'}, 'work_item': {'key': 'workItem', 'type': 'WorkItemReference'} } def __init__(self, executed_in=None, tests=None, work_item=None): super(WorkItemToTestLinks, self).__init__() self.executed_in = executed_in self.tests = tests self.work_item = work_item class TestActionResultModel(TestResultModelBase): """TestActionResultModel. :param comment: Comment in result. :type comment: str :param completed_date: Time when execution completed. :type completed_date: datetime :param duration_in_ms: Duration of execution. :type duration_in_ms: float :param error_message: Error message in result. :type error_message: str :param outcome: Test outcome of result. :type outcome: str :param started_date: Time when execution started. :type started_date: datetime :param action_path: Path identifier test step in test case workitem. :type action_path: str :param iteration_id: Iteration ID of test action result. :type iteration_id: int :param shared_step_model: Reference to shared step workitem. :type shared_step_model: :class:`SharedStepModel ` :param step_identifier: This is step Id of test case. For shared step, it is step Id of shared step in test case workitem; step Id in shared step. Example: TestCase workitem has two steps: 1) Normal step with Id = 1 2) Shared Step with Id = 2. Inside shared step: a) Normal Step with Id = 1 Value for StepIdentifier for First step: "1" Second step: "2;1" :type step_identifier: str :param url: Url of test action result. :type url: str """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'completed_date': {'key': 'completedDate', 'type': 'iso-8601'}, 'duration_in_ms': {'key': 'durationInMs', 'type': 'float'}, 'error_message': {'key': 'errorMessage', 'type': 'str'}, 'outcome': {'key': 'outcome', 'type': 'str'}, 'started_date': {'key': 'startedDate', 'type': 'iso-8601'}, 'action_path': {'key': 'actionPath', 'type': 'str'}, 'iteration_id': {'key': 'iterationId', 'type': 'int'}, 'shared_step_model': {'key': 'sharedStepModel', 'type': 'SharedStepModel'}, 'step_identifier': {'key': 'stepIdentifier', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, comment=None, completed_date=None, duration_in_ms=None, error_message=None, outcome=None, started_date=None, action_path=None, iteration_id=None, shared_step_model=None, step_identifier=None, url=None): super(TestActionResultModel, self).__init__(comment=comment, completed_date=completed_date, duration_in_ms=duration_in_ms, error_message=error_message, outcome=outcome, started_date=started_date) self.action_path = action_path self.iteration_id = iteration_id self.shared_step_model = shared_step_model self.step_identifier = step_identifier self.url = url __all__ = [ 'AggregatedDataForResultTrend', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', 'AggregatedRunsByOutcome', 'AggregatedRunsByState', 'BuildConfiguration', 'BuildCoverage', 'BuildReference', 'CloneOperationInformation', 'CloneOptions', 'CloneStatistics', 'CodeCoverageData', 'CodeCoverageStatistics', 'CodeCoverageSummary', 'CoverageStatistics', 'CustomTestField', 'CustomTestFieldDefinition', 'DtlEnvironmentDetails', 'FailingSince', 'FieldDetailsForTestResults', 'FunctionCoverage', 'GraphSubjectBase', 'IdentityRef', 'LastResultDetails', 'LinkedWorkItemsQuery', 'LinkedWorkItemsQueryResult', 'ModuleCoverage', 'NameValuePair', 'PlanUpdateModel', 'PointAssignment', 'PointsFilter', 'PointUpdateModel', 'PropertyBag', 'QueryModel', 'ReferenceLinks', 'ReleaseEnvironmentDefinitionReference', 'ReleaseReference', 'ResultRetentionSettings', 'ResultsFilter', 'RunCreateModel', 'RunFilter', 'RunStatistic', 'RunUpdateModel', 'ShallowReference', 'ShallowTestCaseResult', 'SharedStepModel', 'SuiteCreateModel', 'SuiteEntry', 'SuiteEntryUpdateModel', 'SuiteTestCase', 'SuiteTestCaseUpdateModel', 'SuiteUpdateModel', 'TeamContext', 'TeamProjectReference', 'TestAttachment', 'TestAttachmentReference', 'TestAttachmentRequestModel', 'TestCaseResult', 'TestCaseResultAttachmentModel', 'TestCaseResultIdentifier', 'TestCaseResultUpdateModel', 'TestConfiguration', 'TestEnvironment', 'TestFailureDetails', 'TestFailuresAnalysis', 'TestHistoryQuery', 'TestIterationDetailsModel', 'TestMessageLogDetails', 'TestMethod', 'TestOperationReference', 'TestOutcomeSettings', 'TestPlan', 'TestPlanCloneRequest', 'TestPoint', 'TestPointsQuery', 'TestResolutionState', 'TestResultCreateModel', 'TestResultDocument', 'TestResultHistory', 'TestResultHistoryDetailsForGroup', 'TestResultHistoryForGroup', 'TestResultMetaData', 'TestResultModelBase', 'TestResultParameterModel', 'TestResultPayload', 'TestResultsContext', 'TestResultsDetails', 'TestResultsDetailsForGroup', 'TestResultsGroupsForBuild', 'TestResultsGroupsForRelease', 'TestResultsQuery', 'TestResultSummary', 'TestResultTrendFilter', 'TestRun', 'TestRunCoverage', 'TestRunStatistic', 'TestSession', 'TestSettings', 'TestSubResult', 'TestSuite', 'TestSuiteCloneRequest', 'TestSummaryForWorkItem', 'TestToWorkItemLinks', 'TestVariable', 'WorkItemReference', 'WorkItemToTestLinks', 'TestActionResultModel', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/test/test_client.py000066400000000000000000003114141360605530400327270ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class TestClient(Client): """Test :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TestClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'c2aa639c-3ccc-4740-b3b6-ce2a1e1d984e' def get_action_results(self, project, run_id, test_case_result_id, iteration_id, action_path=None): """GetActionResults. Gets the action results for an iteration in a test result. :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result that contains the iterations. :param int iteration_id: ID of the iteration that contains the actions. :param str action_path: Path of a specific action, used to get just that action. :rtype: [TestActionResultModel] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') if action_path is not None: route_values['actionPath'] = self._serialize.url('action_path', action_path, 'str') response = self._send(http_method='GET', location_id='eaf40c31-ff84-4062-aafd-d5664be11a37', version='5.0', route_values=route_values) return self._deserialize('[TestActionResultModel]', self._unwrap_collection(response)) def create_test_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id): """CreateTestResultAttachment. [Preview API] Attach a file to a test result. :param :class:` ` attachment_request_model: Attachment details TestAttachmentRequestModel :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result against which attachment has to be uploaded. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') response = self._send(http_method='POST', location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('TestAttachmentReference', response) def create_test_sub_result_attachment(self, attachment_request_model, project, run_id, test_case_result_id, test_sub_result_id): """CreateTestSubResultAttachment. [Preview API] Attach a file to a test result :param :class:` ` attachment_request_model: Attachment Request Model. :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test results that contains sub result. :param int test_sub_result_id: ID of the test sub results against which attachment has to be uploaded. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') query_parameters = {} if test_sub_result_id is not None: query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') response = self._send(http_method='POST', location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('TestAttachmentReference', response) def get_test_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, **kwargs): """GetTestResultAttachmentContent. [Preview API] Download a test result attachment by its ID. :param str project: Project ID or project name :param int run_id: ID of the test run that contains the testCaseResultId. :param int test_case_result_id: ID of the test result whose attachment has to be downloaded. :param int attachment_id: ID of the test result attachment to be downloaded. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if attachment_id is not None: route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') response = self._send(http_method='GET', location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_test_result_attachments(self, project, run_id, test_case_result_id): """GetTestResultAttachments. [Preview API] Get list of test result attachments reference. :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result. :rtype: [TestAttachment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') response = self._send(http_method='GET', location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', version='5.0-preview.1', route_values=route_values) return self._deserialize('[TestAttachment]', self._unwrap_collection(response)) def get_test_result_attachment_zip(self, project, run_id, test_case_result_id, attachment_id, **kwargs): """GetTestResultAttachmentZip. [Preview API] Download a test result attachment by its ID. :param str project: Project ID or project name :param int run_id: ID of the test run that contains the testCaseResultId. :param int test_case_result_id: ID of the test result whose attachment has to be downloaded. :param int attachment_id: ID of the test result attachment to be downloaded. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if attachment_id is not None: route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') response = self._send(http_method='GET', location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', version='5.0-preview.1', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_test_sub_result_attachment_content(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs): """GetTestSubResultAttachmentContent. [Preview API] Download a test sub result attachment :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test results that contains sub result. :param int attachment_id: ID of the test result attachment to be downloaded :param int test_sub_result_id: ID of the test sub result whose attachment has to be downloaded :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if attachment_id is not None: route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') query_parameters = {} if test_sub_result_id is not None: query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') response = self._send(http_method='GET', location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_test_sub_result_attachments(self, project, run_id, test_case_result_id, test_sub_result_id): """GetTestSubResultAttachments. [Preview API] Get list of test sub result attachments :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test results that contains sub result. :param int test_sub_result_id: ID of the test sub result whose attachment has to be downloaded :rtype: [TestAttachment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') query_parameters = {} if test_sub_result_id is not None: query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') response = self._send(http_method='GET', location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestAttachment]', self._unwrap_collection(response)) def get_test_sub_result_attachment_zip(self, project, run_id, test_case_result_id, attachment_id, test_sub_result_id, **kwargs): """GetTestSubResultAttachmentZip. [Preview API] Download a test sub result attachment :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test results that contains sub result. :param int attachment_id: ID of the test result attachment to be downloaded :param int test_sub_result_id: ID of the test sub result whose attachment has to be downloaded :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if attachment_id is not None: route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') query_parameters = {} if test_sub_result_id is not None: query_parameters['testSubResultId'] = self._serialize.query('test_sub_result_id', test_sub_result_id, 'int') response = self._send(http_method='GET', location_id='2bffebe9-2f0f-4639-9af8-56129e9fed2d', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def create_test_run_attachment(self, attachment_request_model, project, run_id): """CreateTestRunAttachment. [Preview API] Attach a file to a test run. :param :class:` ` attachment_request_model: Attachment details TestAttachmentRequestModel :param str project: Project ID or project name :param int run_id: ID of the test run against which attachment has to be uploaded. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') content = self._serialize.body(attachment_request_model, 'TestAttachmentRequestModel') response = self._send(http_method='POST', location_id='4f004af4-a507-489c-9b13-cb62060beb11', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('TestAttachmentReference', response) def get_test_run_attachment_content(self, project, run_id, attachment_id, **kwargs): """GetTestRunAttachmentContent. [Preview API] Download a test run attachment by its ID. :param str project: Project ID or project name :param int run_id: ID of the test run whose attachment has to be downloaded. :param int attachment_id: ID of the test run attachment to be downloaded. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if attachment_id is not None: route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') response = self._send(http_method='GET', location_id='4f004af4-a507-489c-9b13-cb62060beb11', version='5.0-preview.1', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_test_run_attachments(self, project, run_id): """GetTestRunAttachments. [Preview API] Get list of test run attachments reference. :param str project: Project ID or project name :param int run_id: ID of the test run. :rtype: [TestAttachment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') response = self._send(http_method='GET', location_id='4f004af4-a507-489c-9b13-cb62060beb11', version='5.0-preview.1', route_values=route_values) return self._deserialize('[TestAttachment]', self._unwrap_collection(response)) def get_test_run_attachment_zip(self, project, run_id, attachment_id, **kwargs): """GetTestRunAttachmentZip. [Preview API] Download a test run attachment by its ID. :param str project: Project ID or project name :param int run_id: ID of the test run whose attachment has to be downloaded. :param int attachment_id: ID of the test run attachment to be downloaded. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if attachment_id is not None: route_values['attachmentId'] = self._serialize.url('attachment_id', attachment_id, 'int') response = self._send(http_method='GET', location_id='4f004af4-a507-489c-9b13-cb62060beb11', version='5.0-preview.1', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_clone_information(self, project, clone_operation_id, include_details=None): """GetCloneInformation. [Preview API] Get clone information. :param str project: Project ID or project name :param int clone_operation_id: Operation ID returned when we queue a clone operation :param bool include_details: If false returns only status of the clone operation information, if true returns complete clone information :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if clone_operation_id is not None: route_values['cloneOperationId'] = self._serialize.url('clone_operation_id', clone_operation_id, 'int') query_parameters = {} if include_details is not None: query_parameters['$includeDetails'] = self._serialize.query('include_details', include_details, 'bool') response = self._send(http_method='GET', location_id='5b9d6320-abed-47a5-a151-cd6dc3798be6', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('CloneOperationInformation', response) def clone_test_plan(self, clone_request_body, project, plan_id): """CloneTestPlan. [Preview API] Clone test plan :param :class:` ` clone_request_body: Plan Clone Request Body detail TestPlanCloneRequest :param str project: Project ID or project name :param int plan_id: ID of the test plan to be cloned. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') content = self._serialize.body(clone_request_body, 'TestPlanCloneRequest') response = self._send(http_method='POST', location_id='edc3ef4b-8460-4e86-86fa-8e4f5e9be831', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('CloneOperationInformation', response) def clone_test_suite(self, clone_request_body, project, plan_id, source_suite_id): """CloneTestSuite. [Preview API] Clone test suite :param :class:` ` clone_request_body: Suite Clone Request Body detail TestSuiteCloneRequest :param str project: Project ID or project name :param int plan_id: ID of the test plan in which suite to be cloned is present :param int source_suite_id: ID of the test suite to be cloned :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if source_suite_id is not None: route_values['sourceSuiteId'] = self._serialize.url('source_suite_id', source_suite_id, 'int') content = self._serialize.body(clone_request_body, 'TestSuiteCloneRequest') response = self._send(http_method='POST', location_id='751e4ab5-5bf6-4fb5-9d5d-19ef347662dd', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('CloneOperationInformation', response) def get_build_code_coverage(self, project, build_id, flags): """GetBuildCodeCoverage. [Preview API] Get code coverage data for a build. :param str project: Project ID or project name :param int build_id: ID of the build for which code coverage data needs to be fetched. :param int flags: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData. :rtype: [BuildCoverage] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if build_id is not None: query_parameters['buildId'] = self._serialize.query('build_id', build_id, 'int') if flags is not None: query_parameters['flags'] = self._serialize.query('flags', flags, 'int') response = self._send(http_method='GET', location_id='77560e8a-4e8c-4d59-894e-a5f264c24444', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[BuildCoverage]', self._unwrap_collection(response)) def get_test_run_code_coverage(self, project, run_id, flags): """GetTestRunCodeCoverage. [Preview API] Get code coverage data for a test run :param str project: Project ID or project name :param int run_id: ID of the test run for which code coverage data needs to be fetched. :param int flags: Value of flags determine the level of code coverage details to be fetched. Flags are additive. Expected Values are 1 for Modules, 2 for Functions, 4 for BlockData. :rtype: [TestRunCoverage] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') query_parameters = {} if flags is not None: query_parameters['flags'] = self._serialize.query('flags', flags, 'int') response = self._send(http_method='GET', location_id='9629116f-3b89-4ed8-b358-d4694efda160', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestRunCoverage]', self._unwrap_collection(response)) def create_test_configuration(self, test_configuration, project): """CreateTestConfiguration. [Preview API] Create a test configuration :param :class:` ` test_configuration: Test configuration :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(test_configuration, 'TestConfiguration') response = self._send(http_method='POST', location_id='d667591b-b9fd-4263-997a-9a084cca848f', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('TestConfiguration', response) def delete_test_configuration(self, project, test_configuration_id): """DeleteTestConfiguration. [Preview API] Delete a test configuration :param str project: Project ID or project name :param int test_configuration_id: ID of the test configuration to get. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if test_configuration_id is not None: route_values['testConfigurationId'] = self._serialize.url('test_configuration_id', test_configuration_id, 'int') self._send(http_method='DELETE', location_id='d667591b-b9fd-4263-997a-9a084cca848f', version='5.0-preview.2', route_values=route_values) def get_test_configuration_by_id(self, project, test_configuration_id): """GetTestConfigurationById. [Preview API] Get a test configuration :param str project: Project ID or project name :param int test_configuration_id: ID of the test configuration to get. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if test_configuration_id is not None: route_values['testConfigurationId'] = self._serialize.url('test_configuration_id', test_configuration_id, 'int') response = self._send(http_method='GET', location_id='d667591b-b9fd-4263-997a-9a084cca848f', version='5.0-preview.2', route_values=route_values) return self._deserialize('TestConfiguration', response) def get_test_configurations(self, project, skip=None, top=None, continuation_token=None, include_all_properties=None): """GetTestConfigurations. [Preview API] Get a list of test configurations :param str project: Project ID or project name :param int skip: Number of test configurations to skip. :param int top: Number of test configurations to return. :param str continuation_token: If the list of configurations returned is not complete, a continuation token to query next batch of configurations is included in the response header as "x-ms-continuationtoken". Omit this parameter to get the first batch of test configurations. :param bool include_all_properties: If true, it returns all properties of the test configurations. Otherwise, it returns the skinny version. :rtype: [TestConfiguration] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if include_all_properties is not None: query_parameters['includeAllProperties'] = self._serialize.query('include_all_properties', include_all_properties, 'bool') response = self._send(http_method='GET', location_id='d667591b-b9fd-4263-997a-9a084cca848f', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestConfiguration]', self._unwrap_collection(response)) def update_test_configuration(self, test_configuration, project, test_configuration_id): """UpdateTestConfiguration. [Preview API] Update a test configuration :param :class:` ` test_configuration: Test configuration :param str project: Project ID or project name :param int test_configuration_id: ID of the test configuration to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if test_configuration_id is not None: route_values['testConfigurationId'] = self._serialize.url('test_configuration_id', test_configuration_id, 'int') content = self._serialize.body(test_configuration, 'TestConfiguration') response = self._send(http_method='PATCH', location_id='d667591b-b9fd-4263-997a-9a084cca848f', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('TestConfiguration', response) def get_test_iteration(self, project, run_id, test_case_result_id, iteration_id, include_action_results=None): """GetTestIteration. Get iteration for a result :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result that contains the iterations. :param int iteration_id: Id of the test results Iteration. :param bool include_action_results: Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') query_parameters = {} if include_action_results is not None: query_parameters['includeActionResults'] = self._serialize.query('include_action_results', include_action_results, 'bool') response = self._send(http_method='GET', location_id='73eb9074-3446-4c44-8296-2f811950ff8d', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestIterationDetailsModel', response) def get_test_iterations(self, project, run_id, test_case_result_id, include_action_results=None): """GetTestIterations. Get iterations for a result :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result that contains the iterations. :param bool include_action_results: Include result details for each action performed in the test iteration. ActionResults refer to outcome (pass/fail) of test steps that are executed as part of a running a manual test. Including the ActionResults flag gets the outcome of test steps in the actionResults section and test parameters in the parameters section for each test iteration. :rtype: [TestIterationDetailsModel] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') query_parameters = {} if include_action_results is not None: query_parameters['includeActionResults'] = self._serialize.query('include_action_results', include_action_results, 'bool') response = self._send(http_method='GET', location_id='73eb9074-3446-4c44-8296-2f811950ff8d', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestIterationDetailsModel]', self._unwrap_collection(response)) def get_result_parameters(self, project, run_id, test_case_result_id, iteration_id, param_name=None): """GetResultParameters. Get a list of parameterized results :param str project: Project ID or project name :param int run_id: ID of the test run that contains the result. :param int test_case_result_id: ID of the test result that contains the iterations. :param int iteration_id: ID of the iteration that contains the parameterized results. :param str param_name: Name of the parameter. :rtype: [TestResultParameterModel] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'int') query_parameters = {} if param_name is not None: query_parameters['paramName'] = self._serialize.query('param_name', param_name, 'str') response = self._send(http_method='GET', location_id='7c69810d-3354-4af3-844a-180bd25db08a', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestResultParameterModel]', self._unwrap_collection(response)) def create_test_plan(self, test_plan, project): """CreateTestPlan. Create a test plan. :param :class:` ` test_plan: A test plan object. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(test_plan, 'PlanUpdateModel') response = self._send(http_method='POST', location_id='51712106-7278-4208-8563-1c96f40cf5e4', version='5.0', route_values=route_values, content=content) return self._deserialize('TestPlan', response) def delete_test_plan(self, project, plan_id): """DeleteTestPlan. Delete a test plan. :param str project: Project ID or project name :param int plan_id: ID of the test plan to be deleted. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') self._send(http_method='DELETE', location_id='51712106-7278-4208-8563-1c96f40cf5e4', version='5.0', route_values=route_values) def get_plan_by_id(self, project, plan_id): """GetPlanById. Get test plan by ID. :param str project: Project ID or project name :param int plan_id: ID of the test plan to return. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') response = self._send(http_method='GET', location_id='51712106-7278-4208-8563-1c96f40cf5e4', version='5.0', route_values=route_values) return self._deserialize('TestPlan', response) def get_plans(self, project, owner=None, skip=None, top=None, include_plan_details=None, filter_active_plans=None): """GetPlans. Get a list of test plans. :param str project: Project ID or project name :param str owner: Filter for test plan by owner ID or name. :param int skip: Number of test plans to skip. :param int top: Number of test plans to return. :param bool include_plan_details: Get all properties of the test plan. :param bool filter_active_plans: Get just the active plans. :rtype: [TestPlan] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if owner is not None: query_parameters['owner'] = self._serialize.query('owner', owner, 'str') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if include_plan_details is not None: query_parameters['includePlanDetails'] = self._serialize.query('include_plan_details', include_plan_details, 'bool') if filter_active_plans is not None: query_parameters['filterActivePlans'] = self._serialize.query('filter_active_plans', filter_active_plans, 'bool') response = self._send(http_method='GET', location_id='51712106-7278-4208-8563-1c96f40cf5e4', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestPlan]', self._unwrap_collection(response)) def update_test_plan(self, plan_update_model, project, plan_id): """UpdateTestPlan. Update a test plan. :param :class:` ` plan_update_model: :param str project: Project ID or project name :param int plan_id: ID of the test plan to be updated. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') content = self._serialize.body(plan_update_model, 'PlanUpdateModel') response = self._send(http_method='PATCH', location_id='51712106-7278-4208-8563-1c96f40cf5e4', version='5.0', route_values=route_values, content=content) return self._deserialize('TestPlan', response) def get_point(self, project, plan_id, suite_id, point_ids, wit_fields=None): """GetPoint. Get a test point. :param str project: Project ID or project name :param int plan_id: ID of the test plan. :param int suite_id: ID of the suite that contains the point. :param int point_ids: ID of the test point to get. :param str wit_fields: Comma-separated list of work item field names. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if point_ids is not None: route_values['pointIds'] = self._serialize.url('point_ids', point_ids, 'int') query_parameters = {} if wit_fields is not None: query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') response = self._send(http_method='GET', location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestPoint', response) def get_points(self, project, plan_id, suite_id, wit_fields=None, configuration_id=None, test_case_id=None, test_point_ids=None, include_point_details=None, skip=None, top=None): """GetPoints. Get a list of test points. :param str project: Project ID or project name :param int plan_id: ID of the test plan. :param int suite_id: ID of the suite that contains the points. :param str wit_fields: Comma-separated list of work item field names. :param str configuration_id: Get test points for specific configuration. :param str test_case_id: Get test points for a specific test case, valid when configurationId is not set. :param str test_point_ids: Get test points for comma-separated list of test point IDs, valid only when configurationId and testCaseId are not set. :param bool include_point_details: Include all properties for the test point. :param int skip: Number of test points to skip.. :param int top: Number of test points to return. :rtype: [TestPoint] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') query_parameters = {} if wit_fields is not None: query_parameters['witFields'] = self._serialize.query('wit_fields', wit_fields, 'str') if configuration_id is not None: query_parameters['configurationId'] = self._serialize.query('configuration_id', configuration_id, 'str') if test_case_id is not None: query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'str') if test_point_ids is not None: query_parameters['testPointIds'] = self._serialize.query('test_point_ids', test_point_ids, 'str') if include_point_details is not None: query_parameters['includePointDetails'] = self._serialize.query('include_point_details', include_point_details, 'bool') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestPoint]', self._unwrap_collection(response)) def update_test_points(self, point_update_model, project, plan_id, suite_id, point_ids): """UpdateTestPoints. Update test points. :param :class:` ` point_update_model: Data to update. :param str project: Project ID or project name :param int plan_id: ID of the test plan. :param int suite_id: ID of the suite that contains the points. :param str point_ids: ID of the test point to get. Use a comma-separated list of IDs to update multiple test points. :rtype: [TestPoint] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if point_ids is not None: route_values['pointIds'] = self._serialize.url('point_ids', point_ids, 'str') content = self._serialize.body(point_update_model, 'PointUpdateModel') response = self._send(http_method='PATCH', location_id='3bcfd5c8-be62-488e-b1da-b8289ce9299c', version='5.0', route_values=route_values, content=content) return self._deserialize('[TestPoint]', self._unwrap_collection(response)) def get_points_by_query(self, query, project, skip=None, top=None): """GetPointsByQuery. [Preview API] Get test points using query. :param :class:` ` query: TestPointsQuery to get test points. :param str project: Project ID or project name :param int skip: Number of test points to skip.. :param int top: Number of test points to return. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') content = self._serialize.body(query, 'TestPointsQuery') response = self._send(http_method='POST', location_id='b4264fd0-a5d1-43e2-82a5-b9c46b7da9ce', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('TestPointsQuery', response) def get_result_retention_settings(self, project): """GetResultRetentionSettings. [Preview API] Get test result retention settings :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='a3206d9e-fa8d-42d3-88cb-f75c51e69cde', version='5.0-preview.1', route_values=route_values) return self._deserialize('ResultRetentionSettings', response) def update_result_retention_settings(self, retention_settings, project): """UpdateResultRetentionSettings. [Preview API] Update test result retention settings :param :class:` ` retention_settings: Test result retention settings details to be updated :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(retention_settings, 'ResultRetentionSettings') response = self._send(http_method='PATCH', location_id='a3206d9e-fa8d-42d3-88cb-f75c51e69cde', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('ResultRetentionSettings', response) def add_test_results_to_test_run(self, results, project, run_id): """AddTestResultsToTestRun. Add test results to a test run. :param [TestCaseResult] results: List of test results to add. :param str project: Project ID or project name :param int run_id: Test run ID into which test results to add. :rtype: [TestCaseResult] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') content = self._serialize.body(results, '[TestCaseResult]') response = self._send(http_method='POST', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', version='5.0', route_values=route_values, content=content) return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) def get_test_result_by_id(self, project, run_id, test_case_result_id, details_to_include=None): """GetTestResultById. Get a test result for a test run. :param str project: Project ID or project name :param int run_id: Test run ID of a test result to fetch. :param int test_case_result_id: Test result ID. :param str details_to_include: Details to include with test results. Default is None. Other values are Iterations, WorkItems and SubResults. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') if test_case_result_id is not None: route_values['testCaseResultId'] = self._serialize.url('test_case_result_id', test_case_result_id, 'int') query_parameters = {} if details_to_include is not None: query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str') response = self._send(http_method='GET', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestCaseResult', response) def get_test_results(self, project, run_id, details_to_include=None, skip=None, top=None, outcomes=None): """GetTestResults. Get test results for a test run. :param str project: Project ID or project name :param int run_id: Test run ID of test results to fetch. :param str details_to_include: Details to include with test results. Default is None. Other values are Iterations and WorkItems. :param int skip: Number of test results to skip from beginning. :param int top: Number of test results to return. Maximum is 1000 when detailsToInclude is None and 200 otherwise. :param [TestOutcome] outcomes: Comma separated list of test outcomes to filter test results. :rtype: [TestCaseResult] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') query_parameters = {} if details_to_include is not None: query_parameters['detailsToInclude'] = self._serialize.query('details_to_include', details_to_include, 'str') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if outcomes is not None: outcomes = ",".join(map(str, outcomes)) query_parameters['outcomes'] = self._serialize.query('outcomes', outcomes, 'str') response = self._send(http_method='GET', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) def update_test_results(self, results, project, run_id): """UpdateTestResults. Update test results in a test run. :param [TestCaseResult] results: List of test results to update. :param str project: Project ID or project name :param int run_id: Test run ID whose test results to update. :rtype: [TestCaseResult] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') content = self._serialize.body(results, '[TestCaseResult]') response = self._send(http_method='PATCH', location_id='4637d869-3a76-4468-8057-0bb02aa385cf', version='5.0', route_values=route_values, content=content) return self._deserialize('[TestCaseResult]', self._unwrap_collection(response)) def get_test_run_statistics(self, project, run_id): """GetTestRunStatistics. Get test run statistics :param str project: Project ID or project name :param int run_id: ID of the run to get. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') response = self._send(http_method='GET', location_id='0a42c424-d764-4a16-a2d5-5c85f87d0ae8', version='5.0', route_values=route_values) return self._deserialize('TestRunStatistic', response) def create_test_run(self, test_run, project): """CreateTestRun. Create new test run. :param :class:` ` test_run: Run details RunCreateModel :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(test_run, 'RunCreateModel') response = self._send(http_method='POST', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.0', route_values=route_values, content=content) return self._deserialize('TestRun', response) def delete_test_run(self, project, run_id): """DeleteTestRun. Delete a test run by its ID. :param str project: Project ID or project name :param int run_id: ID of the run to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') self._send(http_method='DELETE', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.0', route_values=route_values) def get_test_run_by_id(self, project, run_id, include_details=None): """GetTestRunById. Get a test run by its ID. :param str project: Project ID or project name :param int run_id: ID of the run to get. :param bool include_details: Defualt value is true. It includes details like run statistics,release,build,Test enviornment,Post process state and more :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') query_parameters = {} if include_details is not None: query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') response = self._send(http_method='GET', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestRun', response) def get_test_runs(self, project, build_uri=None, owner=None, tmi_run_id=None, plan_id=None, include_run_details=None, automated=None, skip=None, top=None): """GetTestRuns. Get a list of test runs. :param str project: Project ID or project name :param str build_uri: URI of the build that the runs used. :param str owner: Team foundation ID of the owner of the runs. :param str tmi_run_id: :param int plan_id: ID of the test plan that the runs are a part of. :param bool include_run_details: If true, include all the properties of the runs. :param bool automated: If true, only returns automated runs. :param int skip: Number of test runs to skip. :param int top: Number of test runs to return. :rtype: [TestRun] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if build_uri is not None: query_parameters['buildUri'] = self._serialize.query('build_uri', build_uri, 'str') if owner is not None: query_parameters['owner'] = self._serialize.query('owner', owner, 'str') if tmi_run_id is not None: query_parameters['tmiRunId'] = self._serialize.query('tmi_run_id', tmi_run_id, 'str') if plan_id is not None: query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'int') if include_run_details is not None: query_parameters['includeRunDetails'] = self._serialize.query('include_run_details', include_run_details, 'bool') if automated is not None: query_parameters['automated'] = self._serialize.query('automated', automated, 'bool') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestRun]', self._unwrap_collection(response)) def query_test_runs(self, project, min_last_updated_date, max_last_updated_date, state=None, plan_ids=None, is_automated=None, publish_context=None, build_ids=None, build_def_ids=None, branch_name=None, release_ids=None, release_def_ids=None, release_env_ids=None, release_env_def_ids=None, run_title=None, top=None, continuation_token=None): """QueryTestRuns. Query Test Runs based on filters. Mandatory fields are minLastUpdatedDate and maxLastUpdatedDate. :param str project: Project ID or project name :param datetime min_last_updated_date: Minimum Last Modified Date of run to be queried (Mandatory). :param datetime max_last_updated_date: Maximum Last Modified Date of run to be queried (Mandatory, difference between min and max date can be atmost 7 days). :param str state: Current state of the Runs to be queried. :param [int] plan_ids: Plan Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param bool is_automated: Automation type of the Runs to be queried. :param str publish_context: PublishContext of the Runs to be queried. :param [int] build_ids: Build Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param [int] build_def_ids: Build Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param str branch_name: Source Branch name of the Runs to be queried. :param [int] release_ids: Release Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param [int] release_def_ids: Release Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param [int] release_env_ids: Release Environment Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param [int] release_env_def_ids: Release Environment Definition Ids of the Runs to be queried, comma seperated list of valid ids (limit no. of ids 10). :param str run_title: Run Title of the Runs to be queried. :param int top: Number of runs to be queried. Limit is 100 :param str continuation_token: continuationToken received from previous batch or null for first batch. It is not supposed to be created (or altered, if received from last batch) by user. :rtype: [TestRun] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if min_last_updated_date is not None: query_parameters['minLastUpdatedDate'] = self._serialize.query('min_last_updated_date', min_last_updated_date, 'iso-8601') if max_last_updated_date is not None: query_parameters['maxLastUpdatedDate'] = self._serialize.query('max_last_updated_date', max_last_updated_date, 'iso-8601') if state is not None: query_parameters['state'] = self._serialize.query('state', state, 'str') if plan_ids is not None: plan_ids = ",".join(map(str, plan_ids)) query_parameters['planIds'] = self._serialize.query('plan_ids', plan_ids, 'str') if is_automated is not None: query_parameters['isAutomated'] = self._serialize.query('is_automated', is_automated, 'bool') if publish_context is not None: query_parameters['publishContext'] = self._serialize.query('publish_context', publish_context, 'str') if build_ids is not None: build_ids = ",".join(map(str, build_ids)) query_parameters['buildIds'] = self._serialize.query('build_ids', build_ids, 'str') if build_def_ids is not None: build_def_ids = ",".join(map(str, build_def_ids)) query_parameters['buildDefIds'] = self._serialize.query('build_def_ids', build_def_ids, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') if release_ids is not None: release_ids = ",".join(map(str, release_ids)) query_parameters['releaseIds'] = self._serialize.query('release_ids', release_ids, 'str') if release_def_ids is not None: release_def_ids = ",".join(map(str, release_def_ids)) query_parameters['releaseDefIds'] = self._serialize.query('release_def_ids', release_def_ids, 'str') if release_env_ids is not None: release_env_ids = ",".join(map(str, release_env_ids)) query_parameters['releaseEnvIds'] = self._serialize.query('release_env_ids', release_env_ids, 'str') if release_env_def_ids is not None: release_env_def_ids = ",".join(map(str, release_env_def_ids)) query_parameters['releaseEnvDefIds'] = self._serialize.query('release_env_def_ids', release_env_def_ids, 'str') if run_title is not None: query_parameters['runTitle'] = self._serialize.query('run_title', run_title, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestRun]', self._unwrap_collection(response)) def update_test_run(self, run_update_model, project, run_id): """UpdateTestRun. Update test run by its ID. :param :class:` ` run_update_model: Run details RunUpdateModel :param str project: Project ID or project name :param int run_id: ID of the run to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if run_id is not None: route_values['runId'] = self._serialize.url('run_id', run_id, 'int') content = self._serialize.body(run_update_model, 'RunUpdateModel') response = self._send(http_method='PATCH', location_id='cadb3810-d47d-4a3c-a234-fe5f3be50138', version='5.0', route_values=route_values, content=content) return self._deserialize('TestRun', response) def create_test_session(self, test_session, team_context): """CreateTestSession. [Preview API] Create a test session :param :class:` ` test_session: Test session details for creation :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(test_session, 'TestSession') response = self._send(http_method='POST', location_id='1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('TestSession', response) def get_test_sessions(self, team_context, period=None, all_sessions=None, include_all_properties=None, source=None, include_only_completed_sessions=None): """GetTestSessions. [Preview API] Get a list of test sessions :param :class:` ` team_context: The team context for the operation :param int period: Period in days from now, for which test sessions are fetched. :param bool all_sessions: If false, returns test sessions for current user. Otherwise, it returns test sessions for all users :param bool include_all_properties: If true, it returns all properties of the test sessions. Otherwise, it returns the skinny version. :param str source: Source of the test session. :param bool include_only_completed_sessions: If true, it returns test sessions in completed state. Otherwise, it returns test sessions for all states :rtype: [TestSession] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') query_parameters = {} if period is not None: query_parameters['period'] = self._serialize.query('period', period, 'int') if all_sessions is not None: query_parameters['allSessions'] = self._serialize.query('all_sessions', all_sessions, 'bool') if include_all_properties is not None: query_parameters['includeAllProperties'] = self._serialize.query('include_all_properties', include_all_properties, 'bool') if source is not None: query_parameters['source'] = self._serialize.query('source', source, 'str') if include_only_completed_sessions is not None: query_parameters['includeOnlyCompletedSessions'] = self._serialize.query('include_only_completed_sessions', include_only_completed_sessions, 'bool') response = self._send(http_method='GET', location_id='1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestSession]', self._unwrap_collection(response)) def update_test_session(self, test_session, team_context): """UpdateTestSession. [Preview API] Update a test session :param :class:` ` test_session: Test session details for update :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(test_session, 'TestSession') response = self._send(http_method='PATCH', location_id='1500b4b4-6c69-4ca6-9b18-35e9e97fe2ac', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('TestSession', response) def get_suite_entries(self, project, suite_id): """GetSuiteEntries. [Preview API] Get a list of test suite entries in the test suite. :param str project: Project ID or project name :param int suite_id: Id of the parent suite. :rtype: [SuiteEntry] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') response = self._send(http_method='GET', location_id='bf8b7f78-0c1f-49cb-89e9-d1a17bcaaad3', version='5.0-preview.1', route_values=route_values) return self._deserialize('[SuiteEntry]', self._unwrap_collection(response)) def reorder_suite_entries(self, suite_entries, project, suite_id): """ReorderSuiteEntries. [Preview API] Reorder test suite entries in the test suite. :param [SuiteEntryUpdateModel] suite_entries: List of SuiteEntryUpdateModel to reorder. :param str project: Project ID or project name :param int suite_id: Id of the parent test suite. :rtype: [SuiteEntry] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') content = self._serialize.body(suite_entries, '[SuiteEntryUpdateModel]') response = self._send(http_method='PATCH', location_id='bf8b7f78-0c1f-49cb-89e9-d1a17bcaaad3', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('[SuiteEntry]', self._unwrap_collection(response)) def add_test_cases_to_suite(self, project, plan_id, suite_id, test_case_ids): """AddTestCasesToSuite. Add test cases to suite. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suite. :param int suite_id: ID of the test suite to which the test cases must be added. :param str test_case_ids: IDs of the test cases to add to the suite. Ids are specified in comma separated format. :rtype: [SuiteTestCase] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if test_case_ids is not None: route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str') route_values['action'] = 'TestCases' response = self._send(http_method='POST', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.0', route_values=route_values) return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) def get_test_case_by_id(self, project, plan_id, suite_id, test_case_ids): """GetTestCaseById. Get a specific test case in a test suite with test case id. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suites. :param int suite_id: ID of the suite that contains the test case. :param int test_case_ids: ID of the test case to get. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if test_case_ids is not None: route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'int') route_values['action'] = 'TestCases' response = self._send(http_method='GET', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.0', route_values=route_values) return self._deserialize('SuiteTestCase', response) def get_test_cases(self, project, plan_id, suite_id): """GetTestCases. Get all test cases in a suite. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suites. :param int suite_id: ID of the suite to get. :rtype: [SuiteTestCase] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') route_values['action'] = 'TestCases' response = self._send(http_method='GET', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.0', route_values=route_values) return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) def remove_test_cases_from_suite_url(self, project, plan_id, suite_id, test_case_ids): """RemoveTestCasesFromSuiteUrl. The test points associated with the test cases are removed from the test suite. The test case work item is not deleted from the system. See test cases resource to delete a test case permanently. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suite. :param int suite_id: ID of the suite to get. :param str test_case_ids: IDs of the test cases to remove from the suite. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if test_case_ids is not None: route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str') route_values['action'] = 'TestCases' self._send(http_method='DELETE', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.0', route_values=route_values) def update_suite_test_cases(self, suite_test_case_update_model, project, plan_id, suite_id, test_case_ids): """UpdateSuiteTestCases. Updates the properties of the test case association in a suite. :param :class:` ` suite_test_case_update_model: Model for updation of the properties of test case suite association. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suite. :param int suite_id: ID of the test suite to which the test cases must be added. :param str test_case_ids: IDs of the test cases to add to the suite. Ids are specified in comma separated format. :rtype: [SuiteTestCase] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') if test_case_ids is not None: route_values['testCaseIds'] = self._serialize.url('test_case_ids', test_case_ids, 'str') route_values['action'] = 'TestCases' content = self._serialize.body(suite_test_case_update_model, 'SuiteTestCaseUpdateModel') response = self._send(http_method='PATCH', location_id='a4a1ec1c-b03f-41ca-8857-704594ecf58e', version='5.0', route_values=route_values, content=content) return self._deserialize('[SuiteTestCase]', self._unwrap_collection(response)) def create_test_suite(self, test_suite, project, plan_id, suite_id): """CreateTestSuite. Create a test suite. :param :class:` ` test_suite: Test suite data. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suite. :param int suite_id: ID of the parent suite. :rtype: [TestSuite] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') content = self._serialize.body(test_suite, 'SuiteCreateModel') response = self._send(http_method='POST', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', version='5.0', route_values=route_values, content=content) return self._deserialize('[TestSuite]', self._unwrap_collection(response)) def delete_test_suite(self, project, plan_id, suite_id): """DeleteTestSuite. Delete test suite. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suite. :param int suite_id: ID of the test suite to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') self._send(http_method='DELETE', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', version='5.0', route_values=route_values) def get_test_suite_by_id(self, project, plan_id, suite_id, expand=None): """GetTestSuiteById. Get test suite by suite id. :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suites. :param int suite_id: ID of the suite to get. :param int expand: Include the children suites and testers details :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'int') response = self._send(http_method='GET', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TestSuite', response) def get_test_suites_for_plan(self, project, plan_id, expand=None, skip=None, top=None, as_tree_view=None): """GetTestSuitesForPlan. Get test suites for plan. :param str project: Project ID or project name :param int plan_id: ID of the test plan for which suites are requested. :param int expand: Include the children suites and testers details. :param int skip: Number of suites to skip from the result. :param int top: Number of Suites to be return after skipping the suites from the result. :param bool as_tree_view: If the suites returned should be in a tree structure. :rtype: [TestSuite] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if as_tree_view is not None: query_parameters['$asTreeView'] = self._serialize.query('as_tree_view', as_tree_view, 'bool') response = self._send(http_method='GET', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestSuite]', self._unwrap_collection(response)) def update_test_suite(self, suite_update_model, project, plan_id, suite_id): """UpdateTestSuite. Update a test suite. :param :class:` ` suite_update_model: Suite Model to update :param str project: Project ID or project name :param int plan_id: ID of the test plan that contains the suites. :param int suite_id: ID of the suite to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if plan_id is not None: route_values['planId'] = self._serialize.url('plan_id', plan_id, 'int') if suite_id is not None: route_values['suiteId'] = self._serialize.url('suite_id', suite_id, 'int') content = self._serialize.body(suite_update_model, 'SuiteUpdateModel') response = self._send(http_method='PATCH', location_id='7b7619a0-cb54-4ab3-bf22-194056f45dd1', version='5.0', route_values=route_values, content=content) return self._deserialize('TestSuite', response) def get_suites_by_test_case_id(self, test_case_id): """GetSuitesByTestCaseId. Find the list of all test suites in which a given test case is present. This is helpful if you need to find out which test suites are using a test case, when you need to make changes to a test case. :param int test_case_id: ID of the test case for which suites need to be fetched. :rtype: [TestSuite] """ query_parameters = {} if test_case_id is not None: query_parameters['testCaseId'] = self._serialize.query('test_case_id', test_case_id, 'int') response = self._send(http_method='GET', location_id='09a6167b-e969-4775-9247-b94cf3819caf', version='5.0', query_parameters=query_parameters) return self._deserialize('[TestSuite]', self._unwrap_collection(response)) def delete_test_case(self, project, test_case_id): """DeleteTestCase. [Preview API] Delete a test case. :param str project: Project ID or project name :param int test_case_id: Id of test case to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if test_case_id is not None: route_values['testCaseId'] = self._serialize.url('test_case_id', test_case_id, 'int') self._send(http_method='DELETE', location_id='4d472e0f-e32c-4ef8-adf4-a4078772889c', version='5.0-preview.1', route_values=route_values) def query_test_history(self, filter, project): """QueryTestHistory. [Preview API] Get history of a test method using TestHistoryQuery :param :class:` ` filter: TestHistoryQuery to get history :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(filter, 'TestHistoryQuery') response = self._send(http_method='POST', location_id='929fd86c-3e38-4d8c-b4b6-90df256e5971', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('TestHistoryQuery', response) def create_test_variable(self, test_variable, project): """CreateTestVariable. [Preview API] Create a test variable. :param :class:` ` test_variable: TestVariable :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(test_variable, 'TestVariable') response = self._send(http_method='POST', location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('TestVariable', response) def delete_test_variable(self, project, test_variable_id): """DeleteTestVariable. [Preview API] Delete a test variable by its ID. :param str project: Project ID or project name :param int test_variable_id: ID of the test variable to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if test_variable_id is not None: route_values['testVariableId'] = self._serialize.url('test_variable_id', test_variable_id, 'int') self._send(http_method='DELETE', location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912', version='5.0-preview.1', route_values=route_values) def get_test_variable_by_id(self, project, test_variable_id): """GetTestVariableById. [Preview API] Get a test variable by its ID. :param str project: Project ID or project name :param int test_variable_id: ID of the test variable to get. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if test_variable_id is not None: route_values['testVariableId'] = self._serialize.url('test_variable_id', test_variable_id, 'int') response = self._send(http_method='GET', location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912', version='5.0-preview.1', route_values=route_values) return self._deserialize('TestVariable', response) def get_test_variables(self, project, skip=None, top=None): """GetTestVariables. [Preview API] Get a list of test variables. :param str project: Project ID or project name :param int skip: Number of test variables to skip. :param int top: Number of test variables to return. :rtype: [TestVariable] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TestVariable]', self._unwrap_collection(response)) def update_test_variable(self, test_variable, project, test_variable_id): """UpdateTestVariable. [Preview API] Update a test variable by its ID. :param :class:` ` test_variable: TestVariable :param str project: Project ID or project name :param int test_variable_id: ID of the test variable to update. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if test_variable_id is not None: route_values['testVariableId'] = self._serialize.url('test_variable_id', test_variable_id, 'int') content = self._serialize.body(test_variable, 'TestVariable') response = self._send(http_method='PATCH', location_id='be3fcb2b-995b-47bf-90e5-ca3cf9980912', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('TestVariable', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/tfvc/000077500000000000000000000000001360605530400300175ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/tfvc/__init__.py000066400000000000000000000030631360605530400321320ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .tfvc_client import TfvcClient __all__ = [ 'AssociatedWorkItem', 'Change', 'CheckinNote', 'FileContentMetadata', 'GitRepository', 'GitRepositoryRef', 'GraphSubjectBase', 'IdentityRef', 'ItemContent', 'ItemModel', 'ReferenceLinks', 'TeamProjectCollectionReference', 'TeamProjectReference', 'TfvcBranch', 'TfvcBranchMapping', 'TfvcBranchRef', 'TfvcChange', 'TfvcChangeset', 'TfvcChangesetRef', 'TfvcChangesetSearchCriteria', 'TfvcChangesetsRequestData', 'TfvcItem', 'TfvcItemDescriptor', 'TfvcItemRequestData', 'TfvcLabel', 'TfvcLabelRef', 'TfvcLabelRequestData', 'TfvcMappingFilter', 'TfvcMergeSource', 'TfvcPolicyFailureInfo', 'TfvcPolicyOverrideInfo', 'TfvcShallowBranchRef', 'TfvcShelveset', 'TfvcShelvesetRef', 'TfvcShelvesetRequestData', 'TfvcStatistics', 'TfvcVersionDescriptor', 'VersionControlProjectInfo', 'VstsInfo', 'TfvcClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/tfvc/models.py000066400000000000000000001533701360605530400316650ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AssociatedWorkItem(Model): """AssociatedWorkItem. :param assigned_to: :type assigned_to: str :param id: Id of associated the work item. :type id: int :param state: :type state: str :param title: :type title: str :param url: REST Url of the work item. :type url: str :param web_url: :type web_url: str :param work_item_type: :type work_item_type: str """ _attribute_map = { 'assigned_to': {'key': 'assignedTo', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'state': {'key': 'state', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'web_url': {'key': 'webUrl', 'type': 'str'}, 'work_item_type': {'key': 'workItemType', 'type': 'str'} } def __init__(self, assigned_to=None, id=None, state=None, title=None, url=None, web_url=None, work_item_type=None): super(AssociatedWorkItem, self).__init__() self.assigned_to = assigned_to self.id = id self.state = state self.title = title self.url = url self.web_url = web_url self.work_item_type = work_item_type class Change(Model): """Change. :param change_type: The type of change that was made to the item. :type change_type: object :param item: Current version. :type item: object :param new_content: Content of the item after the change. :type new_content: :class:`ItemContent ` :param source_server_item: Path of the item on the server. :type source_server_item: str :param url: URL to retrieve the item. :type url: str """ _attribute_map = { 'change_type': {'key': 'changeType', 'type': 'object'}, 'item': {'key': 'item', 'type': 'object'}, 'new_content': {'key': 'newContent', 'type': 'ItemContent'}, 'source_server_item': {'key': 'sourceServerItem', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, change_type=None, item=None, new_content=None, source_server_item=None, url=None): super(Change, self).__init__() self.change_type = change_type self.item = item self.new_content = new_content self.source_server_item = source_server_item self.url = url class CheckinNote(Model): """CheckinNote. :param name: :type name: str :param value: :type value: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, name=None, value=None): super(CheckinNote, self).__init__() self.name = name self.value = value class FileContentMetadata(Model): """FileContentMetadata. :param content_type: :type content_type: str :param encoding: :type encoding: int :param extension: :type extension: str :param file_name: :type file_name: str :param is_binary: :type is_binary: bool :param is_image: :type is_image: bool :param vs_link: :type vs_link: str """ _attribute_map = { 'content_type': {'key': 'contentType', 'type': 'str'}, 'encoding': {'key': 'encoding', 'type': 'int'}, 'extension': {'key': 'extension', 'type': 'str'}, 'file_name': {'key': 'fileName', 'type': 'str'}, 'is_binary': {'key': 'isBinary', 'type': 'bool'}, 'is_image': {'key': 'isImage', 'type': 'bool'}, 'vs_link': {'key': 'vsLink', 'type': 'str'} } def __init__(self, content_type=None, encoding=None, extension=None, file_name=None, is_binary=None, is_image=None, vs_link=None): super(FileContentMetadata, self).__init__() self.content_type = content_type self.encoding = encoding self.extension = extension self.file_name = file_name self.is_binary = is_binary self.is_image = is_image self.vs_link = vs_link class GitRepository(Model): """GitRepository. :param _links: :type _links: :class:`ReferenceLinks ` :param default_branch: :type default_branch: str :param id: :type id: str :param is_fork: True if the repository was created as a fork :type is_fork: bool :param name: :type name: str :param parent_repository: :type parent_repository: :class:`GitRepositoryRef ` :param project: :type project: :class:`TeamProjectReference ` :param remote_url: :type remote_url: str :param size: Compressed size (bytes) of the repository. :type size: long :param ssh_url: :type ssh_url: str :param url: :type url: str :param valid_remote_urls: :type valid_remote_urls: list of str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_fork': {'key': 'isFork', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'parent_repository': {'key': 'parentRepository', 'type': 'GitRepositoryRef'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'size': {'key': 'size', 'type': 'long'}, 'ssh_url': {'key': 'sshUrl', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'valid_remote_urls': {'key': 'validRemoteUrls', 'type': '[str]'} } def __init__(self, _links=None, default_branch=None, id=None, is_fork=None, name=None, parent_repository=None, project=None, remote_url=None, size=None, ssh_url=None, url=None, valid_remote_urls=None): super(GitRepository, self).__init__() self._links = _links self.default_branch = default_branch self.id = id self.is_fork = is_fork self.name = name self.parent_repository = parent_repository self.project = project self.remote_url = remote_url self.size = size self.ssh_url = ssh_url self.url = url self.valid_remote_urls = valid_remote_urls class GitRepositoryRef(Model): """GitRepositoryRef. :param collection: Team Project Collection where this Fork resides :type collection: :class:`TeamProjectCollectionReference ` :param id: :type id: str :param is_fork: True if the repository was created as a fork :type is_fork: bool :param name: :type name: str :param project: :type project: :class:`TeamProjectReference ` :param remote_url: :type remote_url: str :param ssh_url: :type ssh_url: str :param url: :type url: str """ _attribute_map = { 'collection': {'key': 'collection', 'type': 'TeamProjectCollectionReference'}, 'id': {'key': 'id', 'type': 'str'}, 'is_fork': {'key': 'isFork', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'ssh_url': {'key': 'sshUrl', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, collection=None, id=None, is_fork=None, name=None, project=None, remote_url=None, ssh_url=None, url=None): super(GitRepositoryRef, self).__init__() self.collection = collection self.id = id self.is_fork = is_fork self.name = name self.project = project self.remote_url = remote_url self.ssh_url = ssh_url self.url = url class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class ItemContent(Model): """ItemContent. :param content: :type content: str :param content_type: :type content_type: object """ _attribute_map = { 'content': {'key': 'content', 'type': 'str'}, 'content_type': {'key': 'contentType', 'type': 'object'} } def __init__(self, content=None, content_type=None): super(ItemContent, self).__init__() self.content = content self.content_type = content_type class ItemModel(Model): """ItemModel. :param _links: :type _links: :class:`ReferenceLinks ` :param content: :type content: str :param content_metadata: :type content_metadata: :class:`FileContentMetadata ` :param is_folder: :type is_folder: bool :param is_sym_link: :type is_sym_link: bool :param path: :type path: str :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'content': {'key': 'content', 'type': 'str'}, 'content_metadata': {'key': 'contentMetadata', 'type': 'FileContentMetadata'}, 'is_folder': {'key': 'isFolder', 'type': 'bool'}, 'is_sym_link': {'key': 'isSymLink', 'type': 'bool'}, 'path': {'key': 'path', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, content=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None): super(ItemModel, self).__init__() self._links = _links self.content = content self.content_metadata = content_metadata self.is_folder = is_folder self.is_sym_link = is_sym_link self.path = path self.url = url class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class TeamProjectCollectionReference(Model): """TeamProjectCollectionReference. :param id: Collection Id. :type id: str :param name: Collection Name. :type name: str :param url: Collection REST Url. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, name=None, url=None): super(TeamProjectCollectionReference, self).__init__() self.id = id self.name = name self.url = url class TeamProjectReference(Model): """TeamProjectReference. :param abbreviation: Project abbreviation. :type abbreviation: str :param default_team_image_url: Url to default team identity image. :type default_team_image_url: str :param description: The project's description (if any). :type description: str :param id: Project identifier. :type id: str :param name: Project name. :type name: str :param revision: Project revision. :type revision: long :param state: Project state. :type state: object :param url: Url to the full version of the object. :type url: str :param visibility: Project visibility. :type visibility: object """ _attribute_map = { 'abbreviation': {'key': 'abbreviation', 'type': 'str'}, 'default_team_image_url': {'key': 'defaultTeamImageUrl', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'long'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'visibility': {'key': 'visibility', 'type': 'object'} } def __init__(self, abbreviation=None, default_team_image_url=None, description=None, id=None, name=None, revision=None, state=None, url=None, visibility=None): super(TeamProjectReference, self).__init__() self.abbreviation = abbreviation self.default_team_image_url = default_team_image_url self.description = description self.id = id self.name = name self.revision = revision self.state = state self.url = url self.visibility = visibility class TfvcBranchMapping(Model): """TfvcBranchMapping. :param depth: Depth of the branch. :type depth: str :param server_item: Server item for the branch. :type server_item: str :param type: Type of the branch. :type type: str """ _attribute_map = { 'depth': {'key': 'depth', 'type': 'str'}, 'server_item': {'key': 'serverItem', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, depth=None, server_item=None, type=None): super(TfvcBranchMapping, self).__init__() self.depth = depth self.server_item = server_item self.type = type class TfvcChange(Change): """TfvcChange. :param merge_sources: List of merge sources in case of rename or branch creation. :type merge_sources: list of :class:`TfvcMergeSource ` :param pending_version: Version at which a (shelved) change was pended against :type pending_version: int """ _attribute_map = { 'merge_sources': {'key': 'mergeSources', 'type': '[TfvcMergeSource]'}, 'pending_version': {'key': 'pendingVersion', 'type': 'int'} } def __init__(self, merge_sources=None, pending_version=None): super(TfvcChange, self).__init__() self.merge_sources = merge_sources self.pending_version = pending_version class TfvcChangesetRef(Model): """TfvcChangesetRef. :param _links: A collection of REST reference links. :type _links: :class:`ReferenceLinks ` :param author: Alias or display name of user. :type author: :class:`IdentityRef ` :param changeset_id: Changeset Id. :type changeset_id: int :param checked_in_by: Alias or display name of user. :type checked_in_by: :class:`IdentityRef ` :param comment: Comment for the changeset. :type comment: str :param comment_truncated: Was the Comment result truncated? :type comment_truncated: bool :param created_date: Creation date of the changeset. :type created_date: datetime :param url: URL to retrieve the item. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'IdentityRef'}, 'changeset_id': {'key': 'changesetId', 'type': 'int'}, 'checked_in_by': {'key': 'checkedInBy', 'type': 'IdentityRef'}, 'comment': {'key': 'comment', 'type': 'str'}, 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, author=None, changeset_id=None, checked_in_by=None, comment=None, comment_truncated=None, created_date=None, url=None): super(TfvcChangesetRef, self).__init__() self._links = _links self.author = author self.changeset_id = changeset_id self.checked_in_by = checked_in_by self.comment = comment self.comment_truncated = comment_truncated self.created_date = created_date self.url = url class TfvcChangesetSearchCriteria(Model): """TfvcChangesetSearchCriteria. :param author: Alias or display name of user who made the changes. :type author: str :param follow_renames: Whether or not to follow renames for the given item being queried. :type follow_renames: bool :param from_date: If provided, only include changesets created after this date (string). :type from_date: str :param from_id: If provided, only include changesets after this changesetID. :type from_id: int :param include_links: Whether to include the _links field on the shallow references. :type include_links: bool :param item_path: Path of item to search under. :type item_path: str :param mappings: :type mappings: list of :class:`TfvcMappingFilter ` :param to_date: If provided, only include changesets created before this date (string). :type to_date: str :param to_id: If provided, a version descriptor for the latest change list to include. :type to_id: int """ _attribute_map = { 'author': {'key': 'author', 'type': 'str'}, 'follow_renames': {'key': 'followRenames', 'type': 'bool'}, 'from_date': {'key': 'fromDate', 'type': 'str'}, 'from_id': {'key': 'fromId', 'type': 'int'}, 'include_links': {'key': 'includeLinks', 'type': 'bool'}, 'item_path': {'key': 'itemPath', 'type': 'str'}, 'mappings': {'key': 'mappings', 'type': '[TfvcMappingFilter]'}, 'to_date': {'key': 'toDate', 'type': 'str'}, 'to_id': {'key': 'toId', 'type': 'int'} } def __init__(self, author=None, follow_renames=None, from_date=None, from_id=None, include_links=None, item_path=None, mappings=None, to_date=None, to_id=None): super(TfvcChangesetSearchCriteria, self).__init__() self.author = author self.follow_renames = follow_renames self.from_date = from_date self.from_id = from_id self.include_links = include_links self.item_path = item_path self.mappings = mappings self.to_date = to_date self.to_id = to_id class TfvcChangesetsRequestData(Model): """TfvcChangesetsRequestData. :param changeset_ids: List of changeset Ids. :type changeset_ids: list of int :param comment_length: Max length of the comment. :type comment_length: int :param include_links: Whether to include the _links field on the shallow references :type include_links: bool """ _attribute_map = { 'changeset_ids': {'key': 'changesetIds', 'type': '[int]'}, 'comment_length': {'key': 'commentLength', 'type': 'int'}, 'include_links': {'key': 'includeLinks', 'type': 'bool'} } def __init__(self, changeset_ids=None, comment_length=None, include_links=None): super(TfvcChangesetsRequestData, self).__init__() self.changeset_ids = changeset_ids self.comment_length = comment_length self.include_links = include_links class TfvcItem(ItemModel): """TfvcItem. :param _links: :type _links: :class:`ReferenceLinks ` :param content: :type content: str :param content_metadata: :type content_metadata: :class:`FileContentMetadata ` :param is_folder: :type is_folder: bool :param is_sym_link: :type is_sym_link: bool :param path: :type path: str :param url: :type url: str :param change_date: Item changed datetime. :type change_date: datetime :param deletion_id: Greater than 0 if item is deleted. :type deletion_id: int :param encoding: File encoding from database, -1 represents binary. :type encoding: int :param hash_value: MD5 hash as a base 64 string, applies to files only. :type hash_value: str :param is_branch: True if item is a branch. :type is_branch: bool :param is_pending_change: True if there is a change pending. :type is_pending_change: bool :param size: The size of the file, if applicable. :type size: long :param version: Changeset version Id. :type version: int """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'content': {'key': 'content', 'type': 'str'}, 'content_metadata': {'key': 'contentMetadata', 'type': 'FileContentMetadata'}, 'is_folder': {'key': 'isFolder', 'type': 'bool'}, 'is_sym_link': {'key': 'isSymLink', 'type': 'bool'}, 'path': {'key': 'path', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'change_date': {'key': 'changeDate', 'type': 'iso-8601'}, 'deletion_id': {'key': 'deletionId', 'type': 'int'}, 'encoding': {'key': 'encoding', 'type': 'int'}, 'hash_value': {'key': 'hashValue', 'type': 'str'}, 'is_branch': {'key': 'isBranch', 'type': 'bool'}, 'is_pending_change': {'key': 'isPendingChange', 'type': 'bool'}, 'size': {'key': 'size', 'type': 'long'}, 'version': {'key': 'version', 'type': 'int'} } def __init__(self, _links=None, content=None, content_metadata=None, is_folder=None, is_sym_link=None, path=None, url=None, change_date=None, deletion_id=None, encoding=None, hash_value=None, is_branch=None, is_pending_change=None, size=None, version=None): super(TfvcItem, self).__init__(_links=_links, content=content, content_metadata=content_metadata, is_folder=is_folder, is_sym_link=is_sym_link, path=path, url=url) self.change_date = change_date self.deletion_id = deletion_id self.encoding = encoding self.hash_value = hash_value self.is_branch = is_branch self.is_pending_change = is_pending_change self.size = size self.version = version class TfvcItemDescriptor(Model): """TfvcItemDescriptor. :param path: Item path. :type path: str :param recursion_level: Defaults to OneLevel. :type recursion_level: object :param version: Specify the desired version, can be null or empty string only if VersionType is latest or tip. :type version: str :param version_option: Defaults to None. :type version_option: object :param version_type: Defaults to Latest. :type version_type: object """ _attribute_map = { 'path': {'key': 'path', 'type': 'str'}, 'recursion_level': {'key': 'recursionLevel', 'type': 'object'}, 'version': {'key': 'version', 'type': 'str'}, 'version_option': {'key': 'versionOption', 'type': 'object'}, 'version_type': {'key': 'versionType', 'type': 'object'} } def __init__(self, path=None, recursion_level=None, version=None, version_option=None, version_type=None): super(TfvcItemDescriptor, self).__init__() self.path = path self.recursion_level = recursion_level self.version = version self.version_option = version_option self.version_type = version_type class TfvcItemRequestData(Model): """TfvcItemRequestData. :param include_content_metadata: If true, include metadata about the file type :type include_content_metadata: bool :param include_links: Whether to include the _links field on the shallow references :type include_links: bool :param item_descriptors: :type item_descriptors: list of :class:`TfvcItemDescriptor ` """ _attribute_map = { 'include_content_metadata': {'key': 'includeContentMetadata', 'type': 'bool'}, 'include_links': {'key': 'includeLinks', 'type': 'bool'}, 'item_descriptors': {'key': 'itemDescriptors', 'type': '[TfvcItemDescriptor]'} } def __init__(self, include_content_metadata=None, include_links=None, item_descriptors=None): super(TfvcItemRequestData, self).__init__() self.include_content_metadata = include_content_metadata self.include_links = include_links self.item_descriptors = item_descriptors class TfvcLabelRef(Model): """TfvcLabelRef. :param _links: Collection of reference links. :type _links: :class:`ReferenceLinks ` :param description: Label description. :type description: str :param id: Label Id. :type id: int :param label_scope: Label scope. :type label_scope: str :param modified_date: Last modified datetime for the label. :type modified_date: datetime :param name: Label name. :type name: str :param owner: Label owner. :type owner: :class:`IdentityRef ` :param url: Label Url. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'label_scope': {'key': 'labelScope', 'type': 'str'}, 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, description=None, id=None, label_scope=None, modified_date=None, name=None, owner=None, url=None): super(TfvcLabelRef, self).__init__() self._links = _links self.description = description self.id = id self.label_scope = label_scope self.modified_date = modified_date self.name = name self.owner = owner self.url = url class TfvcLabelRequestData(Model): """TfvcLabelRequestData. :param include_links: Whether to include the _links field on the shallow references :type include_links: bool :param item_label_filter: :type item_label_filter: str :param label_scope: :type label_scope: str :param max_item_count: :type max_item_count: int :param name: :type name: str :param owner: :type owner: str """ _attribute_map = { 'include_links': {'key': 'includeLinks', 'type': 'bool'}, 'item_label_filter': {'key': 'itemLabelFilter', 'type': 'str'}, 'label_scope': {'key': 'labelScope', 'type': 'str'}, 'max_item_count': {'key': 'maxItemCount', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'str'} } def __init__(self, include_links=None, item_label_filter=None, label_scope=None, max_item_count=None, name=None, owner=None): super(TfvcLabelRequestData, self).__init__() self.include_links = include_links self.item_label_filter = item_label_filter self.label_scope = label_scope self.max_item_count = max_item_count self.name = name self.owner = owner class TfvcMappingFilter(Model): """TfvcMappingFilter. :param exclude: True if ServerPath should be excluded. :type exclude: bool :param server_path: Path to be included or excluded. :type server_path: str """ _attribute_map = { 'exclude': {'key': 'exclude', 'type': 'bool'}, 'server_path': {'key': 'serverPath', 'type': 'str'} } def __init__(self, exclude=None, server_path=None): super(TfvcMappingFilter, self).__init__() self.exclude = exclude self.server_path = server_path class TfvcMergeSource(Model): """TfvcMergeSource. :param is_rename: Indicates if this a rename source. If false, it is a merge source. :type is_rename: bool :param server_item: The server item of the merge source. :type server_item: str :param version_from: Start of the version range. :type version_from: int :param version_to: End of the version range. :type version_to: int """ _attribute_map = { 'is_rename': {'key': 'isRename', 'type': 'bool'}, 'server_item': {'key': 'serverItem', 'type': 'str'}, 'version_from': {'key': 'versionFrom', 'type': 'int'}, 'version_to': {'key': 'versionTo', 'type': 'int'} } def __init__(self, is_rename=None, server_item=None, version_from=None, version_to=None): super(TfvcMergeSource, self).__init__() self.is_rename = is_rename self.server_item = server_item self.version_from = version_from self.version_to = version_to class TfvcPolicyFailureInfo(Model): """TfvcPolicyFailureInfo. :param message: Policy failure message. :type message: str :param policy_name: Name of the policy that failed. :type policy_name: str """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'policy_name': {'key': 'policyName', 'type': 'str'} } def __init__(self, message=None, policy_name=None): super(TfvcPolicyFailureInfo, self).__init__() self.message = message self.policy_name = policy_name class TfvcPolicyOverrideInfo(Model): """TfvcPolicyOverrideInfo. :param comment: Overidden policy comment. :type comment: str :param policy_failures: Information on the failed policy that was overridden. :type policy_failures: list of :class:`TfvcPolicyFailureInfo ` """ _attribute_map = { 'comment': {'key': 'comment', 'type': 'str'}, 'policy_failures': {'key': 'policyFailures', 'type': '[TfvcPolicyFailureInfo]'} } def __init__(self, comment=None, policy_failures=None): super(TfvcPolicyOverrideInfo, self).__init__() self.comment = comment self.policy_failures = policy_failures class TfvcShallowBranchRef(Model): """TfvcShallowBranchRef. :param path: Path for the branch. :type path: str """ _attribute_map = { 'path': {'key': 'path', 'type': 'str'} } def __init__(self, path=None): super(TfvcShallowBranchRef, self).__init__() self.path = path class TfvcShelvesetRef(Model): """TfvcShelvesetRef. :param _links: List of reference links for the shelveset. :type _links: :class:`ReferenceLinks ` :param comment: Shelveset comment. :type comment: str :param comment_truncated: Shelveset comment truncated as applicable. :type comment_truncated: bool :param created_date: Shelveset create date. :type created_date: datetime :param id: Shelveset Id. :type id: str :param name: Shelveset name. :type name: str :param owner: Shelveset Owner. :type owner: :class:`IdentityRef ` :param url: Shelveset Url. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'comment': {'key': 'comment', 'type': 'str'}, 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, comment=None, comment_truncated=None, created_date=None, id=None, name=None, owner=None, url=None): super(TfvcShelvesetRef, self).__init__() self._links = _links self.comment = comment self.comment_truncated = comment_truncated self.created_date = created_date self.id = id self.name = name self.owner = owner self.url = url class TfvcShelvesetRequestData(Model): """TfvcShelvesetRequestData. :param include_details: Whether to include policyOverride and notes Only applies when requesting a single deep shelveset :type include_details: bool :param include_links: Whether to include the _links field on the shallow references. Does not apply when requesting a single deep shelveset object. Links will always be included in the deep shelveset. :type include_links: bool :param include_work_items: Whether to include workItems :type include_work_items: bool :param max_change_count: Max number of changes to include :type max_change_count: int :param max_comment_length: Max length of comment :type max_comment_length: int :param name: Shelveset name :type name: str :param owner: Owner's ID. Could be a name or a guid. :type owner: str """ _attribute_map = { 'include_details': {'key': 'includeDetails', 'type': 'bool'}, 'include_links': {'key': 'includeLinks', 'type': 'bool'}, 'include_work_items': {'key': 'includeWorkItems', 'type': 'bool'}, 'max_change_count': {'key': 'maxChangeCount', 'type': 'int'}, 'max_comment_length': {'key': 'maxCommentLength', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'str'} } def __init__(self, include_details=None, include_links=None, include_work_items=None, max_change_count=None, max_comment_length=None, name=None, owner=None): super(TfvcShelvesetRequestData, self).__init__() self.include_details = include_details self.include_links = include_links self.include_work_items = include_work_items self.max_change_count = max_change_count self.max_comment_length = max_comment_length self.name = name self.owner = owner class TfvcStatistics(Model): """TfvcStatistics. :param changeset_id: Id of the last changeset the stats are based on. :type changeset_id: int :param file_count_total: Count of files at the requested scope. :type file_count_total: long """ _attribute_map = { 'changeset_id': {'key': 'changesetId', 'type': 'int'}, 'file_count_total': {'key': 'fileCountTotal', 'type': 'long'} } def __init__(self, changeset_id=None, file_count_total=None): super(TfvcStatistics, self).__init__() self.changeset_id = changeset_id self.file_count_total = file_count_total class TfvcVersionDescriptor(Model): """TfvcVersionDescriptor. :param version: Version object. :type version: str :param version_option: :type version_option: object :param version_type: :type version_type: object """ _attribute_map = { 'version': {'key': 'version', 'type': 'str'}, 'version_option': {'key': 'versionOption', 'type': 'object'}, 'version_type': {'key': 'versionType', 'type': 'object'} } def __init__(self, version=None, version_option=None, version_type=None): super(TfvcVersionDescriptor, self).__init__() self.version = version self.version_option = version_option self.version_type = version_type class VersionControlProjectInfo(Model): """VersionControlProjectInfo. :param default_source_control_type: :type default_source_control_type: object :param project: :type project: :class:`TeamProjectReference ` :param supports_git: :type supports_git: bool :param supports_tFVC: :type supports_tFVC: bool """ _attribute_map = { 'default_source_control_type': {'key': 'defaultSourceControlType', 'type': 'object'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'supports_git': {'key': 'supportsGit', 'type': 'bool'}, 'supports_tFVC': {'key': 'supportsTFVC', 'type': 'bool'} } def __init__(self, default_source_control_type=None, project=None, supports_git=None, supports_tFVC=None): super(VersionControlProjectInfo, self).__init__() self.default_source_control_type = default_source_control_type self.project = project self.supports_git = supports_git self.supports_tFVC = supports_tFVC class VstsInfo(Model): """VstsInfo. :param collection: :type collection: :class:`TeamProjectCollectionReference ` :param repository: :type repository: :class:`GitRepository ` :param server_url: :type server_url: str """ _attribute_map = { 'collection': {'key': 'collection', 'type': 'TeamProjectCollectionReference'}, 'repository': {'key': 'repository', 'type': 'GitRepository'}, 'server_url': {'key': 'serverUrl', 'type': 'str'} } def __init__(self, collection=None, repository=None, server_url=None): super(VstsInfo, self).__init__() self.collection = collection self.repository = repository self.server_url = server_url class TfvcBranchRef(TfvcShallowBranchRef): """TfvcBranchRef. :param path: Path for the branch. :type path: str :param _links: A collection of REST reference links. :type _links: :class:`ReferenceLinks ` :param created_date: Creation date of the branch. :type created_date: datetime :param description: Branch description. :type description: str :param is_deleted: Is the branch deleted? :type is_deleted: bool :param owner: Alias or display name of user :type owner: :class:`IdentityRef ` :param url: URL to retrieve the item. :type url: str """ _attribute_map = { 'path': {'key': 'path', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, path=None, _links=None, created_date=None, description=None, is_deleted=None, owner=None, url=None): super(TfvcBranchRef, self).__init__(path=path) self._links = _links self.created_date = created_date self.description = description self.is_deleted = is_deleted self.owner = owner self.url = url class TfvcChangeset(TfvcChangesetRef): """TfvcChangeset. :param _links: A collection of REST reference links. :type _links: :class:`ReferenceLinks ` :param author: Alias or display name of user. :type author: :class:`IdentityRef ` :param changeset_id: Changeset Id. :type changeset_id: int :param checked_in_by: Alias or display name of user. :type checked_in_by: :class:`IdentityRef ` :param comment: Comment for the changeset. :type comment: str :param comment_truncated: Was the Comment result truncated? :type comment_truncated: bool :param created_date: Creation date of the changeset. :type created_date: datetime :param url: URL to retrieve the item. :type url: str :param account_id: Changeset Account Id also known as Organization Id. :type account_id: str :param changes: List of associated changes. :type changes: list of :class:`TfvcChange ` :param checkin_notes: List of Checkin Notes for the changeset. :type checkin_notes: list of :class:`CheckinNote ` :param collection_id: Changeset collection Id. :type collection_id: str :param has_more_changes: True if more changes are available. :type has_more_changes: bool :param policy_override: Policy Override for the changeset. :type policy_override: :class:`TfvcPolicyOverrideInfo ` :param team_project_ids: Team Project Ids for the changeset. :type team_project_ids: list of str :param work_items: List of work items associated with the changeset. :type work_items: list of :class:`AssociatedWorkItem ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'IdentityRef'}, 'changeset_id': {'key': 'changesetId', 'type': 'int'}, 'checked_in_by': {'key': 'checkedInBy', 'type': 'IdentityRef'}, 'comment': {'key': 'comment', 'type': 'str'}, 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'url': {'key': 'url', 'type': 'str'}, 'account_id': {'key': 'accountId', 'type': 'str'}, 'changes': {'key': 'changes', 'type': '[TfvcChange]'}, 'checkin_notes': {'key': 'checkinNotes', 'type': '[CheckinNote]'}, 'collection_id': {'key': 'collectionId', 'type': 'str'}, 'has_more_changes': {'key': 'hasMoreChanges', 'type': 'bool'}, 'policy_override': {'key': 'policyOverride', 'type': 'TfvcPolicyOverrideInfo'}, 'team_project_ids': {'key': 'teamProjectIds', 'type': '[str]'}, 'work_items': {'key': 'workItems', 'type': '[AssociatedWorkItem]'} } def __init__(self, _links=None, author=None, changeset_id=None, checked_in_by=None, comment=None, comment_truncated=None, created_date=None, url=None, account_id=None, changes=None, checkin_notes=None, collection_id=None, has_more_changes=None, policy_override=None, team_project_ids=None, work_items=None): super(TfvcChangeset, self).__init__(_links=_links, author=author, changeset_id=changeset_id, checked_in_by=checked_in_by, comment=comment, comment_truncated=comment_truncated, created_date=created_date, url=url) self.account_id = account_id self.changes = changes self.checkin_notes = checkin_notes self.collection_id = collection_id self.has_more_changes = has_more_changes self.policy_override = policy_override self.team_project_ids = team_project_ids self.work_items = work_items class TfvcLabel(TfvcLabelRef): """TfvcLabel. :param _links: Collection of reference links. :type _links: :class:`ReferenceLinks ` :param description: Label description. :type description: str :param id: Label Id. :type id: int :param label_scope: Label scope. :type label_scope: str :param modified_date: Last modified datetime for the label. :type modified_date: datetime :param name: Label name. :type name: str :param owner: Label owner. :type owner: :class:`IdentityRef ` :param url: Label Url. :type url: str :param items: List of items. :type items: list of :class:`TfvcItem ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'label_scope': {'key': 'labelScope', 'type': 'str'}, 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'url': {'key': 'url', 'type': 'str'}, 'items': {'key': 'items', 'type': '[TfvcItem]'} } def __init__(self, _links=None, description=None, id=None, label_scope=None, modified_date=None, name=None, owner=None, url=None, items=None): super(TfvcLabel, self).__init__(_links=_links, description=description, id=id, label_scope=label_scope, modified_date=modified_date, name=name, owner=owner, url=url) self.items = items class TfvcShelveset(TfvcShelvesetRef): """TfvcShelveset. :param _links: List of reference links for the shelveset. :type _links: :class:`ReferenceLinks ` :param comment: Shelveset comment. :type comment: str :param comment_truncated: Shelveset comment truncated as applicable. :type comment_truncated: bool :param created_date: Shelveset create date. :type created_date: datetime :param id: Shelveset Id. :type id: str :param name: Shelveset name. :type name: str :param owner: Shelveset Owner. :type owner: :class:`IdentityRef ` :param url: Shelveset Url. :type url: str :param changes: List of changes. :type changes: list of :class:`TfvcChange ` :param notes: List of checkin notes. :type notes: list of :class:`CheckinNote ` :param policy_override: Policy override information if applicable. :type policy_override: :class:`TfvcPolicyOverrideInfo ` :param work_items: List of associated workitems. :type work_items: list of :class:`AssociatedWorkItem ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'comment': {'key': 'comment', 'type': 'str'}, 'comment_truncated': {'key': 'commentTruncated', 'type': 'bool'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'url': {'key': 'url', 'type': 'str'}, 'changes': {'key': 'changes', 'type': '[TfvcChange]'}, 'notes': {'key': 'notes', 'type': '[CheckinNote]'}, 'policy_override': {'key': 'policyOverride', 'type': 'TfvcPolicyOverrideInfo'}, 'work_items': {'key': 'workItems', 'type': '[AssociatedWorkItem]'} } def __init__(self, _links=None, comment=None, comment_truncated=None, created_date=None, id=None, name=None, owner=None, url=None, changes=None, notes=None, policy_override=None, work_items=None): super(TfvcShelveset, self).__init__(_links=_links, comment=comment, comment_truncated=comment_truncated, created_date=created_date, id=id, name=name, owner=owner, url=url) self.changes = changes self.notes = notes self.policy_override = policy_override self.work_items = work_items class TfvcBranch(TfvcBranchRef): """TfvcBranch. :param path: Path for the branch. :type path: str :param _links: A collection of REST reference links. :type _links: :class:`ReferenceLinks ` :param created_date: Creation date of the branch. :type created_date: datetime :param description: Branch description. :type description: str :param is_deleted: Is the branch deleted? :type is_deleted: bool :param owner: Alias or display name of user :type owner: :class:`IdentityRef ` :param url: URL to retrieve the item. :type url: str :param children: List of children for the branch. :type children: list of :class:`TfvcBranch ` :param mappings: List of branch mappings. :type mappings: list of :class:`TfvcBranchMapping ` :param parent: Path of the branch's parent. :type parent: :class:`TfvcShallowBranchRef ` :param related_branches: List of paths of the related branches. :type related_branches: list of :class:`TfvcShallowBranchRef ` """ _attribute_map = { 'path': {'key': 'path', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'owner': {'key': 'owner', 'type': 'IdentityRef'}, 'url': {'key': 'url', 'type': 'str'}, 'children': {'key': 'children', 'type': '[TfvcBranch]'}, 'mappings': {'key': 'mappings', 'type': '[TfvcBranchMapping]'}, 'parent': {'key': 'parent', 'type': 'TfvcShallowBranchRef'}, 'related_branches': {'key': 'relatedBranches', 'type': '[TfvcShallowBranchRef]'} } def __init__(self, path=None, _links=None, created_date=None, description=None, is_deleted=None, owner=None, url=None, children=None, mappings=None, parent=None, related_branches=None): super(TfvcBranch, self).__init__(path=path, _links=_links, created_date=created_date, description=description, is_deleted=is_deleted, owner=owner, url=url) self.children = children self.mappings = mappings self.parent = parent self.related_branches = related_branches __all__ = [ 'AssociatedWorkItem', 'Change', 'CheckinNote', 'FileContentMetadata', 'GitRepository', 'GitRepositoryRef', 'GraphSubjectBase', 'IdentityRef', 'ItemContent', 'ItemModel', 'ReferenceLinks', 'TeamProjectCollectionReference', 'TeamProjectReference', 'TfvcBranchMapping', 'TfvcChange', 'TfvcChangesetRef', 'TfvcChangesetSearchCriteria', 'TfvcChangesetsRequestData', 'TfvcItem', 'TfvcItemDescriptor', 'TfvcItemRequestData', 'TfvcLabelRef', 'TfvcLabelRequestData', 'TfvcMappingFilter', 'TfvcMergeSource', 'TfvcPolicyFailureInfo', 'TfvcPolicyOverrideInfo', 'TfvcShallowBranchRef', 'TfvcShelvesetRef', 'TfvcShelvesetRequestData', 'TfvcStatistics', 'TfvcVersionDescriptor', 'VersionControlProjectInfo', 'VstsInfo', 'TfvcBranchRef', 'TfvcChangeset', 'TfvcLabel', 'TfvcShelveset', 'TfvcBranch', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/tfvc/tfvc_client.py000066400000000000000000001321361360605530400326770ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class TfvcClient(Client): """Tfvc :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TfvcClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '8aa40520-446d-40e6-89f6-9c9f9ce44c48' def get_branch(self, path, project=None, include_parent=None, include_children=None): """GetBranch. Get a single branch hierarchy at the given path with parents or children as specified. :param str path: Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder. :param str project: Project ID or project name :param bool include_parent: Return the parent branch, if there is one. Default: False :param bool include_children: Return child branches, if there are any. Default: False :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if include_parent is not None: query_parameters['includeParent'] = self._serialize.query('include_parent', include_parent, 'bool') if include_children is not None: query_parameters['includeChildren'] = self._serialize.query('include_children', include_children, 'bool') response = self._send(http_method='GET', location_id='bc1f417e-239d-42e7-85e1-76e80cb2d6eb', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcBranch', response) def get_branches(self, project=None, include_parent=None, include_children=None, include_deleted=None, include_links=None): """GetBranches. Get a collection of branch roots -- first-level children, branches with no parents. :param str project: Project ID or project name :param bool include_parent: Return the parent branch, if there is one. Default: False :param bool include_children: Return the child branches for each root branch. Default: False :param bool include_deleted: Return deleted branches. Default: False :param bool include_links: Return links. Default: False :rtype: [TfvcBranch] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if include_parent is not None: query_parameters['includeParent'] = self._serialize.query('include_parent', include_parent, 'bool') if include_children is not None: query_parameters['includeChildren'] = self._serialize.query('include_children', include_children, 'bool') if include_deleted is not None: query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='bc1f417e-239d-42e7-85e1-76e80cb2d6eb', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcBranch]', self._unwrap_collection(response)) def get_branch_refs(self, scope_path, project=None, include_deleted=None, include_links=None): """GetBranchRefs. Get branch hierarchies below the specified scopePath :param str scope_path: Full path to the branch. Default: $/ Examples: $/, $/MyProject, $/MyProject/SomeFolder. :param str project: Project ID or project name :param bool include_deleted: Return deleted branches. Default: False :param bool include_links: Return links. Default: False :rtype: [TfvcBranchRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if include_deleted is not None: query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') response = self._send(http_method='GET', location_id='bc1f417e-239d-42e7-85e1-76e80cb2d6eb', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcBranchRef]', self._unwrap_collection(response)) def get_changeset_changes(self, id=None, skip=None, top=None): """GetChangesetChanges. Retrieve Tfvc changes for a given changeset. :param int id: ID of the changeset. Default: null :param int skip: Number of results to skip. Default: null :param int top: The maximum number of results to return. Default: null :rtype: [TfvcChange] """ route_values = {} if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='f32b86f2-15b9-4fe6-81b1-6f8938617ee5', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcChange]', self._unwrap_collection(response)) def create_changeset(self, changeset, project=None): """CreateChangeset. Create a new changeset. :param :class:` ` changeset: :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(changeset, 'TfvcChangeset') response = self._send(http_method='POST', location_id='0bc8f0a4-6bfb-42a9-ba84-139da7b99c49', version='5.0', route_values=route_values, content=content) return self._deserialize('TfvcChangesetRef', response) def get_changeset(self, id, project=None, max_change_count=None, include_details=None, include_work_items=None, max_comment_length=None, include_source_rename=None, skip=None, top=None, orderby=None, search_criteria=None): """GetChangeset. Retrieve a Tfvc Changeset :param int id: Changeset Id to retrieve. :param str project: Project ID or project name :param int max_change_count: Number of changes to return (maximum 100 changes) Default: 0 :param bool include_details: Include policy details and check-in notes in the response. Default: false :param bool include_work_items: Include workitems. Default: false :param int max_comment_length: Include details about associated work items in the response. Default: null :param bool include_source_rename: Include renames. Default: false :param int skip: Number of results to skip. Default: null :param int top: The maximum number of results to return. Default: null :param str orderby: Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. :param :class:` ` search_criteria: Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if max_change_count is not None: query_parameters['maxChangeCount'] = self._serialize.query('max_change_count', max_change_count, 'int') if include_details is not None: query_parameters['includeDetails'] = self._serialize.query('include_details', include_details, 'bool') if include_work_items is not None: query_parameters['includeWorkItems'] = self._serialize.query('include_work_items', include_work_items, 'bool') if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if include_source_rename is not None: query_parameters['includeSourceRename'] = self._serialize.query('include_source_rename', include_source_rename, 'bool') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if orderby is not None: query_parameters['$orderby'] = self._serialize.query('orderby', orderby, 'str') if search_criteria is not None: if search_criteria.item_path is not None: query_parameters['searchCriteria.itemPath'] = search_criteria.item_path if search_criteria.author is not None: query_parameters['searchCriteria.author'] = search_criteria.author if search_criteria.from_date is not None: query_parameters['searchCriteria.fromDate'] = search_criteria.from_date if search_criteria.to_date is not None: query_parameters['searchCriteria.toDate'] = search_criteria.to_date if search_criteria.from_id is not None: query_parameters['searchCriteria.fromId'] = search_criteria.from_id if search_criteria.to_id is not None: query_parameters['searchCriteria.toId'] = search_criteria.to_id if search_criteria.follow_renames is not None: query_parameters['searchCriteria.followRenames'] = search_criteria.follow_renames if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if search_criteria.mappings is not None: query_parameters['searchCriteria.mappings'] = search_criteria.mappings response = self._send(http_method='GET', location_id='0bc8f0a4-6bfb-42a9-ba84-139da7b99c49', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcChangeset', response) def get_changesets(self, project=None, max_comment_length=None, skip=None, top=None, orderby=None, search_criteria=None): """GetChangesets. Retrieve Tfvc Changesets :param str project: Project ID or project name :param int max_comment_length: Include details about associated work items in the response. Default: null :param int skip: Number of results to skip. Default: null :param int top: The maximum number of results to return. Default: null :param str orderby: Results are sorted by ID in descending order by default. Use id asc to sort by ID in ascending order. :param :class:` ` search_criteria: Following criteria available (.itemPath, .version, .versionType, .versionOption, .author, .fromId, .toId, .fromDate, .toDate) Default: null :rtype: [TfvcChangesetRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if max_comment_length is not None: query_parameters['maxCommentLength'] = self._serialize.query('max_comment_length', max_comment_length, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if orderby is not None: query_parameters['$orderby'] = self._serialize.query('orderby', orderby, 'str') if search_criteria is not None: if search_criteria.item_path is not None: query_parameters['searchCriteria.itemPath'] = search_criteria.item_path if search_criteria.author is not None: query_parameters['searchCriteria.author'] = search_criteria.author if search_criteria.from_date is not None: query_parameters['searchCriteria.fromDate'] = search_criteria.from_date if search_criteria.to_date is not None: query_parameters['searchCriteria.toDate'] = search_criteria.to_date if search_criteria.from_id is not None: query_parameters['searchCriteria.fromId'] = search_criteria.from_id if search_criteria.to_id is not None: query_parameters['searchCriteria.toId'] = search_criteria.to_id if search_criteria.follow_renames is not None: query_parameters['searchCriteria.followRenames'] = search_criteria.follow_renames if search_criteria.include_links is not None: query_parameters['searchCriteria.includeLinks'] = search_criteria.include_links if search_criteria.mappings is not None: query_parameters['searchCriteria.mappings'] = search_criteria.mappings response = self._send(http_method='GET', location_id='0bc8f0a4-6bfb-42a9-ba84-139da7b99c49', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcChangesetRef]', self._unwrap_collection(response)) def get_batched_changesets(self, changesets_request_data): """GetBatchedChangesets. Returns changesets for a given list of changeset Ids. :param :class:` ` changesets_request_data: List of changeset IDs. :rtype: [TfvcChangesetRef] """ content = self._serialize.body(changesets_request_data, 'TfvcChangesetsRequestData') response = self._send(http_method='POST', location_id='b7e7c173-803c-4fea-9ec8-31ee35c5502a', version='5.0', content=content) return self._deserialize('[TfvcChangesetRef]', self._unwrap_collection(response)) def get_changeset_work_items(self, id=None): """GetChangesetWorkItems. Retrieves the work items associated with a particular changeset. :param int id: ID of the changeset. :rtype: [AssociatedWorkItem] """ route_values = {} if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') response = self._send(http_method='GET', location_id='64ae0bea-1d71-47c9-a9e5-fe73f5ea0ff4', version='5.0', route_values=route_values) return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) def get_items_batch(self, item_request_data, project=None): """GetItemsBatch. Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. :param :class:` ` item_request_data: :param str project: Project ID or project name :rtype: [[TfvcItem]] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(item_request_data, 'TfvcItemRequestData') response = self._send(http_method='POST', location_id='fe6f827b-5f64-480f-b8af-1eca3b80e833', version='5.0', route_values=route_values, content=content) return self._deserialize('[[TfvcItem]]', self._unwrap_collection(response)) def get_items_batch_zip(self, item_request_data, project=None, **kwargs): """GetItemsBatchZip. Post for retrieving a set of items given a list of paths or a long path. Allows for specifying the recursionLevel and version descriptors for each path. :param :class:` ` item_request_data: :param str project: Project ID or project name :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(item_request_data, 'TfvcItemRequestData') response = self._send(http_method='POST', location_id='fe6f827b-5f64-480f-b8af-1eca3b80e833', version='5.0', route_values=route_values, content=content, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_item(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None): """GetItem. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str path: Version control path of an individual item to return. :param str project: Project ID or project name :param str file_name: file name of item returned. :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcItem', response) def get_item_content(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetItemContent. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str path: Version control path of an individual item to return. :param str project: Project ID or project name :param str file_name: file name of item returned. :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_items(self, project=None, scope_path=None, recursion_level=None, include_links=None, version_descriptor=None): """GetItems. Get a list of Tfvc items :param str project: Project ID or project name :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param bool include_links: True to include links. :param :class:` ` version_descriptor: :rtype: [TfvcItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if include_links is not None: query_parameters['includeLinks'] = self._serialize.query('include_links', include_links, 'bool') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcItem]', self._unwrap_collection(response)) def get_item_text(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetItemText. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str path: Version control path of an individual item to return. :param str project: Project ID or project name :param str file_name: file name of item returned. :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_item_zip(self, path, project=None, file_name=None, download=None, scope_path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetItemZip. Get Item Metadata and/or Content for a single item. The download parameter is to indicate whether the content should be available as a download or just sent as a stream in the response. Doesn't apply to zipped content which is always returned as a download. :param str path: Version control path of an individual item to return. :param str project: Project ID or project name :param str file_name: file name of item returned. :param bool download: If true, create a downloadable attachment. :param str scope_path: Version control path of a folder to return multiple items. :param str recursion_level: None (just the item), or OneLevel (contents of a folder). :param :class:` ` version_descriptor: Version descriptor. Default is null. :param bool include_content: Set to true to include item content when requesting json. Default is false. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') if scope_path is not None: query_parameters['scopePath'] = self._serialize.query('scope_path', scope_path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_option is not None: query_parameters['versionDescriptor.versionOption'] = version_descriptor.version_option if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='ba9fc436-9a38-4578-89d6-e4f3241f5040', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_label_items(self, label_id, top=None, skip=None): """GetLabelItems. Get items under a label. :param str label_id: Unique identifier of label :param int top: Max number of items to return :param int skip: Number of items to skip :rtype: [TfvcItem] """ route_values = {} if label_id is not None: route_values['labelId'] = self._serialize.url('label_id', label_id, 'str') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='06166e34-de17-4b60-8cd1-23182a346fda', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcItem]', self._unwrap_collection(response)) def get_label(self, label_id, request_data, project=None): """GetLabel. Get a single deep label. :param str label_id: Unique identifier of label :param :class:` ` request_data: maxItemCount :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if label_id is not None: route_values['labelId'] = self._serialize.url('label_id', label_id, 'str') query_parameters = {} if request_data is not None: if request_data.label_scope is not None: query_parameters['requestData.labelScope'] = request_data.label_scope if request_data.name is not None: query_parameters['requestData.name'] = request_data.name if request_data.owner is not None: query_parameters['requestData.owner'] = request_data.owner if request_data.item_label_filter is not None: query_parameters['requestData.itemLabelFilter'] = request_data.item_label_filter if request_data.max_item_count is not None: query_parameters['requestData.maxItemCount'] = request_data.max_item_count if request_data.include_links is not None: query_parameters['requestData.includeLinks'] = request_data.include_links response = self._send(http_method='GET', location_id='a5d9bd7f-b661-4d0e-b9be-d9c16affae54', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TfvcLabel', response) def get_labels(self, request_data, project=None, top=None, skip=None): """GetLabels. Get a collection of shallow label references. :param :class:` ` request_data: labelScope, name, owner, and itemLabelFilter :param str project: Project ID or project name :param int top: Max number of labels to return :param int skip: Number of labels to skip :rtype: [TfvcLabelRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if request_data is not None: if request_data.label_scope is not None: query_parameters['requestData.labelScope'] = request_data.label_scope if request_data.name is not None: query_parameters['requestData.name'] = request_data.name if request_data.owner is not None: query_parameters['requestData.owner'] = request_data.owner if request_data.item_label_filter is not None: query_parameters['requestData.itemLabelFilter'] = request_data.item_label_filter if request_data.max_item_count is not None: query_parameters['requestData.maxItemCount'] = request_data.max_item_count if request_data.include_links is not None: query_parameters['requestData.includeLinks'] = request_data.include_links if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='a5d9bd7f-b661-4d0e-b9be-d9c16affae54', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TfvcLabelRef]', self._unwrap_collection(response)) def get_shelveset_changes(self, shelveset_id, top=None, skip=None): """GetShelvesetChanges. Get changes included in a shelveset. :param str shelveset_id: Shelveset's unique ID :param int top: Max number of changes to return :param int skip: Number of changes to skip :rtype: [TfvcChange] """ query_parameters = {} if shelveset_id is not None: query_parameters['shelvesetId'] = self._serialize.query('shelveset_id', shelveset_id, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='dbaf075b-0445-4c34-9e5b-82292f856522', version='5.0', query_parameters=query_parameters) return self._deserialize('[TfvcChange]', self._unwrap_collection(response)) def get_shelveset(self, shelveset_id, request_data=None): """GetShelveset. Get a single deep shelveset. :param str shelveset_id: Shelveset's unique ID :param :class:` ` request_data: includeDetails, includeWorkItems, maxChangeCount, and maxCommentLength :rtype: :class:` ` """ query_parameters = {} if shelveset_id is not None: query_parameters['shelvesetId'] = self._serialize.query('shelveset_id', shelveset_id, 'str') if request_data is not None: if request_data.name is not None: query_parameters['requestData.name'] = request_data.name if request_data.owner is not None: query_parameters['requestData.owner'] = request_data.owner if request_data.max_comment_length is not None: query_parameters['requestData.maxCommentLength'] = request_data.max_comment_length if request_data.max_change_count is not None: query_parameters['requestData.maxChangeCount'] = request_data.max_change_count if request_data.include_details is not None: query_parameters['requestData.includeDetails'] = request_data.include_details if request_data.include_work_items is not None: query_parameters['requestData.includeWorkItems'] = request_data.include_work_items if request_data.include_links is not None: query_parameters['requestData.includeLinks'] = request_data.include_links response = self._send(http_method='GET', location_id='e36d44fb-e907-4b0a-b194-f83f1ed32ad3', version='5.0', query_parameters=query_parameters) return self._deserialize('TfvcShelveset', response) def get_shelvesets(self, request_data=None, top=None, skip=None): """GetShelvesets. Return a collection of shallow shelveset references. :param :class:` ` request_data: name, owner, and maxCommentLength :param int top: Max number of shelvesets to return :param int skip: Number of shelvesets to skip :rtype: [TfvcShelvesetRef] """ query_parameters = {} if request_data is not None: if request_data.name is not None: query_parameters['requestData.name'] = request_data.name if request_data.owner is not None: query_parameters['requestData.owner'] = request_data.owner if request_data.max_comment_length is not None: query_parameters['requestData.maxCommentLength'] = request_data.max_comment_length if request_data.max_change_count is not None: query_parameters['requestData.maxChangeCount'] = request_data.max_change_count if request_data.include_details is not None: query_parameters['requestData.includeDetails'] = request_data.include_details if request_data.include_work_items is not None: query_parameters['requestData.includeWorkItems'] = request_data.include_work_items if request_data.include_links is not None: query_parameters['requestData.includeLinks'] = request_data.include_links if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='e36d44fb-e907-4b0a-b194-f83f1ed32ad3', version='5.0', query_parameters=query_parameters) return self._deserialize('[TfvcShelvesetRef]', self._unwrap_collection(response)) def get_shelveset_work_items(self, shelveset_id): """GetShelvesetWorkItems. Get work items associated with a shelveset. :param str shelveset_id: Shelveset's unique ID :rtype: [AssociatedWorkItem] """ query_parameters = {} if shelveset_id is not None: query_parameters['shelvesetId'] = self._serialize.query('shelveset_id', shelveset_id, 'str') response = self._send(http_method='GET', location_id='a7a0c1c1-373e-425a-b031-a519474d743d', version='5.0', query_parameters=query_parameters) return self._deserialize('[AssociatedWorkItem]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/token_admin/000077500000000000000000000000001360605530400313455ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/token_admin/__init__.py000066400000000000000000000014171360605530400334610ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .token_admin_client import TokenAdminClient __all__ = [ 'SessionToken', 'TokenAdminPagedSessionTokens', 'TokenAdminRevocation', 'TokenAdminRevocationRule', 'TokenAdminClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/token_admin/models.py000066400000000000000000000135301360605530400332040ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class SessionToken(Model): """SessionToken. :param access_id: :type access_id: str :param alternate_token: This is populated when user requests a compact token. The alternate token value is self describing token. :type alternate_token: str :param authorization_id: :type authorization_id: str :param client_id: :type client_id: str :param display_name: :type display_name: str :param host_authorization_id: :type host_authorization_id: str :param is_public: :type is_public: bool :param is_valid: :type is_valid: bool :param public_data: :type public_data: str :param scope: :type scope: str :param source: :type source: str :param target_accounts: :type target_accounts: list of str :param token: This is computed and not returned in Get queries :type token: str :param user_id: :type user_id: str :param valid_from: :type valid_from: datetime :param valid_to: :type valid_to: datetime """ _attribute_map = { 'access_id': {'key': 'accessId', 'type': 'str'}, 'alternate_token': {'key': 'alternateToken', 'type': 'str'}, 'authorization_id': {'key': 'authorizationId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'host_authorization_id': {'key': 'hostAuthorizationId', 'type': 'str'}, 'is_public': {'key': 'isPublic', 'type': 'bool'}, 'is_valid': {'key': 'isValid', 'type': 'bool'}, 'public_data': {'key': 'publicData', 'type': 'str'}, 'scope': {'key': 'scope', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'}, 'target_accounts': {'key': 'targetAccounts', 'type': '[str]'}, 'token': {'key': 'token', 'type': 'str'}, 'user_id': {'key': 'userId', 'type': 'str'}, 'valid_from': {'key': 'validFrom', 'type': 'iso-8601'}, 'valid_to': {'key': 'validTo', 'type': 'iso-8601'} } def __init__(self, access_id=None, alternate_token=None, authorization_id=None, client_id=None, display_name=None, host_authorization_id=None, is_public=None, is_valid=None, public_data=None, scope=None, source=None, target_accounts=None, token=None, user_id=None, valid_from=None, valid_to=None): super(SessionToken, self).__init__() self.access_id = access_id self.alternate_token = alternate_token self.authorization_id = authorization_id self.client_id = client_id self.display_name = display_name self.host_authorization_id = host_authorization_id self.is_public = is_public self.is_valid = is_valid self.public_data = public_data self.scope = scope self.source = source self.target_accounts = target_accounts self.token = token self.user_id = user_id self.valid_from = valid_from self.valid_to = valid_to class TokenAdminPagedSessionTokens(Model): """TokenAdminPagedSessionTokens. :param continuation_token: The continuation token that can be used to retrieve the next page of session tokens, or null if there is no next page. :type continuation_token: str :param value: The list of all session tokens in the current page. :type value: list of :class:`SessionToken ` """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, 'value': {'key': 'value', 'type': '[SessionToken]'} } def __init__(self, continuation_token=None, value=None): super(TokenAdminPagedSessionTokens, self).__init__() self.continuation_token = continuation_token self.value = value class TokenAdminRevocation(Model): """TokenAdminRevocation. :param authorization_id: The authorization ID of the OAuth authorization to revoke. :type authorization_id: str """ _attribute_map = { 'authorization_id': {'key': 'authorizationId', 'type': 'str'} } def __init__(self, authorization_id=None): super(TokenAdminRevocation, self).__init__() self.authorization_id = authorization_id class TokenAdminRevocationRule(Model): """TokenAdminRevocationRule. :param created_before: A datetime cutoff. Tokens created before this time will be rejected. This is an optional paramter. If omitted, defaults to the time at which the rule was created. :type created_before: datetime :param scopes: A string containing a space-delimited list of OAuth scopes. A token matching any one of the scopes will be rejected. For a list of all OAuth scopes supported by VSTS, see: https://docs.microsoft.com/en-us/vsts/integrate/get-started/authentication/oauth?view=vsts#scopes. This is a mandatory parameter. :type scopes: str """ _attribute_map = { 'created_before': {'key': 'createdBefore', 'type': 'iso-8601'}, 'scopes': {'key': 'scopes', 'type': 'str'} } def __init__(self, created_before=None, scopes=None): super(TokenAdminRevocationRule, self).__init__() self.created_before = created_before self.scopes = scopes __all__ = [ 'SessionToken', 'TokenAdminPagedSessionTokens', 'TokenAdminRevocation', 'TokenAdminRevocationRule', ] token_admin_client.py000066400000000000000000000122001360605530400354610ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/token_admin# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class TokenAdminClient(Client): """TokenAdmin :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TokenAdminClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'af68438b-ed04-4407-9eb6-f1dbae3f922e' def list_personal_access_tokens(self, subject_descriptor, page_size=None, continuation_token=None, is_public=None): """ListPersonalAccessTokens. [Preview API] Lists of all the session token details of the personal access tokens (PATs) for a particular user. :param :class:` ` subject_descriptor: The descriptor of the target user. :param int page_size: The maximum number of results to return on each page. :param str continuation_token: An opaque data blob that allows the next page of data to resume immediately after where the previous page ended. The only reliable way to know if there is more data left is the presence of a continuation token. :param bool is_public: Set to false for PAT tokens and true for SSH tokens. :rtype: :class:` ` """ route_values = {} if subject_descriptor is not None: route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') query_parameters = {} if page_size is not None: query_parameters['pageSize'] = self._serialize.query('page_size', page_size, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if is_public is not None: query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') response = self._send(http_method='GET', location_id='af68438b-ed04-4407-9eb6-f1dbae3f922e', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('TokenAdminPagedSessionTokens', response) def create_revocation_rule(self, revocation_rule): """CreateRevocationRule. [Preview API] Creates a revocation rule to prevent the further usage of any OAuth authorizations that were created before the current point in time and which match the conditions in the rule. :param :class:` ` revocation_rule: The revocation rule to create. The rule must specify a space-separated list of scopes, after which preexisting OAuth authorizations that match that any of the scopes will be rejected. For a list of all OAuth scopes supported by VSTS, see: https://docs.microsoft.com/en-us/vsts/integrate/get-started/authentication/oauth?view=vsts#scopes The rule may also specify the time before which to revoke tokens. """ content = self._serialize.body(revocation_rule, 'TokenAdminRevocationRule') self._send(http_method='POST', location_id='ee4afb16-e7ab-4ed8-9d4b-4ef3e78f97e4', version='5.0-preview.1', content=content) def revoke_authorizations(self, revocations, is_public=None): """RevokeAuthorizations. [Preview API] Revokes the listed OAuth authorizations. :param [TokenAdminRevocation] revocations: The list of objects containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be revoked. :param bool is_public: Set to false for PAT tokens and true for SSH tokens. """ query_parameters = {} if is_public is not None: query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') content = self._serialize.body(revocations, '[TokenAdminRevocation]') self._send(http_method='POST', location_id='a9c08b2c-5466-4e22-8626-1ff304ffdf0f', version='5.0-preview.1', query_parameters=query_parameters, content=content) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/token_administration/000077500000000000000000000000001360605530400333025ustar00rootroot00000000000000__init__.py000066400000000000000000000014571360605530400353430ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/token_administration# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .token_administration_client import TokenAdministrationClient __all__ = [ 'SessionToken', 'TokenAdministrationRevocation', 'TokenAdminPagedSessionTokens', 'TokenAdminRevocation', 'TokenAdministrationClient' ] models.py000066400000000000000000000131521360605530400350620ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/token_administration# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class SessionToken(Model): """SessionToken. :param access_id: :type access_id: str :param alternate_token: This is populated when user requests a compact token. The alternate token value is self describing token. :type alternate_token: str :param authorization_id: :type authorization_id: str :param client_id: :type client_id: str :param display_name: :type display_name: str :param host_authorization_id: :type host_authorization_id: str :param is_public: :type is_public: bool :param is_valid: :type is_valid: bool :param public_data: :type public_data: str :param scope: :type scope: str :param source: :type source: str :param target_accounts: :type target_accounts: list of str :param token: This is computed and not returned in Get queries :type token: str :param user_id: :type user_id: str :param valid_from: :type valid_from: datetime :param valid_to: :type valid_to: datetime """ _attribute_map = { 'access_id': {'key': 'accessId', 'type': 'str'}, 'alternate_token': {'key': 'alternateToken', 'type': 'str'}, 'authorization_id': {'key': 'authorizationId', 'type': 'str'}, 'client_id': {'key': 'clientId', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'host_authorization_id': {'key': 'hostAuthorizationId', 'type': 'str'}, 'is_public': {'key': 'isPublic', 'type': 'bool'}, 'is_valid': {'key': 'isValid', 'type': 'bool'}, 'public_data': {'key': 'publicData', 'type': 'str'}, 'scope': {'key': 'scope', 'type': 'str'}, 'source': {'key': 'source', 'type': 'str'}, 'target_accounts': {'key': 'targetAccounts', 'type': '[str]'}, 'token': {'key': 'token', 'type': 'str'}, 'user_id': {'key': 'userId', 'type': 'str'}, 'valid_from': {'key': 'validFrom', 'type': 'iso-8601'}, 'valid_to': {'key': 'validTo', 'type': 'iso-8601'} } def __init__(self, access_id=None, alternate_token=None, authorization_id=None, client_id=None, display_name=None, host_authorization_id=None, is_public=None, is_valid=None, public_data=None, scope=None, source=None, target_accounts=None, token=None, user_id=None, valid_from=None, valid_to=None): super(SessionToken, self).__init__() self.access_id = access_id self.alternate_token = alternate_token self.authorization_id = authorization_id self.client_id = client_id self.display_name = display_name self.host_authorization_id = host_authorization_id self.is_public = is_public self.is_valid = is_valid self.public_data = public_data self.scope = scope self.source = source self.target_accounts = target_accounts self.token = token self.user_id = user_id self.valid_from = valid_from self.valid_to = valid_to class TokenAdministrationRevocation(Model): """TokenAdministrationRevocation. :param audience: A list of audience (target accounts) to limit the revocations to :type audience: list of str :param authorization_ids: A list of authorization ID of the OAuth authorization to revoke. :type authorization_ids: list of str """ _attribute_map = { 'audience': {'key': 'audience', 'type': '[str]'}, 'authorization_ids': {'key': 'authorizationIds', 'type': '[str]'} } def __init__(self, audience=None, authorization_ids=None): super(TokenAdministrationRevocation, self).__init__() self.audience = audience self.authorization_ids = authorization_ids class TokenAdminPagedSessionTokens(Model): """TokenAdminPagedSessionTokens. :param continuation_token: The continuation token that can be used to retrieve the next page of session tokens, or null if there is no next page. :type continuation_token: str :param value: The list of all session tokens in the current page. :type value: list of :class:`SessionToken ` """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, 'value': {'key': 'value', 'type': '[SessionToken]'} } def __init__(self, continuation_token=None, value=None): super(TokenAdminPagedSessionTokens, self).__init__() self.continuation_token = continuation_token self.value = value class TokenAdminRevocation(Model): """TokenAdminRevocation. :param authorization_id: The authorization ID of the OAuth authorization to revoke. :type authorization_id: str """ _attribute_map = { 'authorization_id': {'key': 'authorizationId', 'type': 'str'} } def __init__(self, authorization_id=None): super(TokenAdminRevocation, self).__init__() self.authorization_id = authorization_id __all__ = [ 'SessionToken', 'TokenAdministrationRevocation', 'TokenAdminPagedSessionTokens', 'TokenAdminRevocation', ] token_administration_client.py000066400000000000000000000134731360605530400413700ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/token_administration# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class TokenAdministrationClient(Client): """TokenAdministration :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(TokenAdministrationClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '95935461-9e54-44bd-b9fb-04f4dd05d640' def list_identities_with_global_access_tokens(self, revocations, is_public=None): """ListIdentitiesWithGlobalAccessTokens. [Preview API] Revokes the listed OAuth authorizations. :param [TokenAdminRevocation] revocations: The list of identities containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be checked for global access tokens. :param bool is_public: Set to false for PAT tokens and true for SSH tokens. :rtype: [str] """ query_parameters = {} if is_public is not None: query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') content = self._serialize.body(revocations, '[TokenAdminRevocation]') response = self._send(http_method='POST', location_id='30d3a12b-66c3-4669-b016-ecb0706c8d0f', version='5.0-preview.1', query_parameters=query_parameters, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def list_personal_access_tokens(self, audience, subject_descriptor, page_size=None, continuation_token=None, si_public=None): """ListPersonalAccessTokens. [Preview API] Lists of all the session token details of the personal access tokens (PATs) for a particular user. :param [str] audience: :param :class:` ` subject_descriptor: The descriptor of the target user. :param int page_size: The maximum number of results to return on each page. :param str continuation_token: An opaque data blob that allows the next page of data to resume immediately after where the previous page ended. The only reliable way to know if there is more data left is the presence of a continuation token. :param bool si_public: :rtype: :class:` ` """ route_values = {} if subject_descriptor is not None: route_values['subjectDescriptor'] = self._serialize.url('subject_descriptor', subject_descriptor, 'str') query_parameters = {} if page_size is not None: query_parameters['pageSize'] = self._serialize.query('page_size', page_size, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if si_public is not None: query_parameters['siPublic'] = self._serialize.query('si_public', si_public, 'bool') content = self._serialize.body(audience, '[str]') response = self._send(http_method='POST', location_id='1bb7db14-87c5-4762-bf77-a70ad34a9ab3', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('TokenAdminPagedSessionTokens', response) def revoke_authorizations(self, revocations, host_id, is_public=None): """RevokeAuthorizations. [Preview API] Revokes the listed OAuth authorizations. :param :class:` ` revocations: The list of objects containing the authorization IDs of the OAuth authorizations, such as session tokens retrieved by listed a users PATs, that should be revoked. :param str host_id: Host Id to display on the notification page to manage tokens. :param bool is_public: Set to false for PAT tokens and true for SSH tokens. :rtype: [SessionToken] """ query_parameters = {} if host_id is not None: query_parameters['hostId'] = self._serialize.query('host_id', host_id, 'str') if is_public is not None: query_parameters['isPublic'] = self._serialize.query('is_public', is_public, 'bool') content = self._serialize.body(revocations, 'TokenAdministrationRevocation') response = self._send(http_method='POST', location_id='a2e4520b-1cc8-4526-871e-f3a8f865f221', version='5.0-preview.1', query_parameters=query_parameters, content=content) return self._deserialize('[SessionToken]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/universal/000077500000000000000000000000001360605530400310655ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/universal/__init__.py000066400000000000000000000016351360605530400332030ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .upack_api_client import UPackApiClient __all__ = [ 'BatchOperationData', 'JsonPatchOperation', 'MinimalPackageDetails', 'Package', 'PackageVersionDetails', 'ReferenceLinks', 'UPackPackagesBatchRequest', 'UPackPackageVersionDeletionState', 'UPackRecycleBinPackageVersionDetails', 'UPackApiClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/universal/models.py000066400000000000000000000153341360605530400327300ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class BatchOperationData(Model): """BatchOperationData. """ _attribute_map = { } def __init__(self): super(BatchOperationData, self).__init__() class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class MinimalPackageDetails(Model): """MinimalPackageDetails. :param id: Package name. :type id: str :param version: Package version. :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, version=None): super(MinimalPackageDetails, self).__init__() self.id = id self.version = version class Package(Model): """Package. :param _links: Related REST links. :type _links: :class:`ReferenceLinks ` :param deleted_date: If and when the package was deleted. :type deleted_date: datetime :param id: Package Id. :type id: str :param name: The display name of the package. :type name: str :param permanently_deleted_date: If and when the package was permanently deleted. :type permanently_deleted_date: datetime :param version: The version of the package. :type version: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'permanently_deleted_date': {'key': 'permanentlyDeletedDate', 'type': 'iso-8601'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, _links=None, deleted_date=None, id=None, name=None, permanently_deleted_date=None, version=None): super(Package, self).__init__() self._links = _links self.deleted_date = deleted_date self.id = id self.name = name self.permanently_deleted_date = permanently_deleted_date self.version = version class PackageVersionDetails(Model): """PackageVersionDetails. :param views: The view to which the package version will be added :type views: :class:`JsonPatchOperation ` """ _attribute_map = { 'views': {'key': 'views', 'type': 'JsonPatchOperation'} } def __init__(self, views=None): super(PackageVersionDetails, self).__init__() self.views = views class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class UPackPackagesBatchRequest(Model): """UPackPackagesBatchRequest. :param data: Data required to perform the operation. This is optional based on the type of the operation. Use BatchPromoteData if performing a promote operation. :type data: :class:`BatchOperationData ` :param operation: Type of operation that needs to be performed on packages. :type operation: object :param packages: The packages onto which the operation will be performed. :type packages: list of :class:`MinimalPackageDetails ` """ _attribute_map = { 'data': {'key': 'data', 'type': 'BatchOperationData'}, 'operation': {'key': 'operation', 'type': 'object'}, 'packages': {'key': 'packages', 'type': '[MinimalPackageDetails]'} } def __init__(self, data=None, operation=None, packages=None): super(UPackPackagesBatchRequest, self).__init__() self.data = data self.operation = operation self.packages = packages class UPackPackageVersionDeletionState(Model): """UPackPackageVersionDeletionState. :param deleted_date: UTC date the package was deleted. :type deleted_date: datetime :param name: Name of the package. :type name: str :param version: Version of the package. :type version: str """ _attribute_map = { 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, deleted_date=None, name=None, version=None): super(UPackPackageVersionDeletionState, self).__init__() self.deleted_date = deleted_date self.name = name self.version = version class UPackRecycleBinPackageVersionDetails(Model): """UPackRecycleBinPackageVersionDetails. :param deleted: Setting to false will undo earlier deletion and restore the package to feed. :type deleted: bool """ _attribute_map = { 'deleted': {'key': 'deleted', 'type': 'bool'} } def __init__(self, deleted=None): super(UPackRecycleBinPackageVersionDetails, self).__init__() self.deleted = deleted __all__ = [ 'BatchOperationData', 'JsonPatchOperation', 'MinimalPackageDetails', 'Package', 'PackageVersionDetails', 'ReferenceLinks', 'UPackPackagesBatchRequest', 'UPackPackageVersionDeletionState', 'UPackRecycleBinPackageVersionDetails', ] universal_client.py000066400000000000000000000212241360605530400347270ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/universal# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class UPackApiClient(Client): """UPackApi :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(UPackApiClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'd397749b-f115-4027-b6dd-77a65dd10d21' def delete_package_version_from_recycle_bin(self, feed_id, package_name, package_version): """DeletePackageVersionFromRecycleBin. [Preview API] Delete a package version from the recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') self._send(http_method='DELETE', location_id='3ba455ae-31e6-409e-849f-56c66888d004', version='5.0-preview.1', route_values=route_values) def get_package_version_metadata_from_recycle_bin(self, feed_id, package_name, package_version): """GetPackageVersionMetadataFromRecycleBin. [Preview API] Get information about a package version in the recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='GET', location_id='3ba455ae-31e6-409e-849f-56c66888d004', version='5.0-preview.1', route_values=route_values) return self._deserialize('UPackPackageVersionDeletionState', response) def restore_package_version_from_recycle_bin(self, package_version_details, feed_id, package_name, package_version): """RestorePackageVersionFromRecycleBin. [Preview API] Restore a package version from the recycle bin to its associated feed. :param :class:` ` package_version_details: Set the 'Deleted' property to 'false' to restore the package. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'UPackRecycleBinPackageVersionDetails') self._send(http_method='PATCH', location_id='3ba455ae-31e6-409e-849f-56c66888d004', version='5.0-preview.1', route_values=route_values, content=content) def delete_package_version(self, feed_id, package_name, package_version): """DeletePackageVersion. [Preview API] Delete a package version from a feed's recycle bin. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') response = self._send(http_method='DELETE', location_id='72f61ca4-e07c-4eca-be75-6c0b2f3f4051', version='5.0-preview.1', route_values=route_values) return self._deserialize('Package', response) def get_package_version(self, feed_id, package_name, package_version, show_deleted=None): """GetPackageVersion. [Preview API] Show information about a package version. :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. :param bool show_deleted: True to show information for deleted versions :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') query_parameters = {} if show_deleted is not None: query_parameters['showDeleted'] = self._serialize.query('show_deleted', show_deleted, 'bool') response = self._send(http_method='GET', location_id='72f61ca4-e07c-4eca-be75-6c0b2f3f4051', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Package', response) def update_package_version(self, package_version_details, feed_id, package_name, package_version): """UpdatePackageVersion. [Preview API] Update information for a package version. :param :class:` ` package_version_details: :param str feed_id: Name or ID of the feed. :param str package_name: Name of the package. :param str package_version: Version of the package. """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(package_version_details, 'PackageVersionDetails') self._send(http_method='PATCH', location_id='72f61ca4-e07c-4eca-be75-6c0b2f3f4051', version='5.0-preview.1', route_values=route_values, content=content) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/upack_packaging/000077500000000000000000000000001360605530400321645ustar00rootroot00000000000000__init__.py000066400000000000000000000015351360605530400342220ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/upack_packaging# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .upack_packaging_client import UPackPackagingClient __all__ = [ 'UPackLimitedPackageMetadata', 'UPackLimitedPackageMetadataListResponse', 'UPackPackageMetadata', 'UPackPackagePushMetadata', 'UPackPackageVersionDeletionState', 'UPackPackagingClient' ] models.py000066400000000000000000000103731360605530400337460ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/upack_packaging# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class UPackLimitedPackageMetadata(Model): """UPackLimitedPackageMetadata. :param version: :type version: str """ _attribute_map = { 'version': {'key': 'version', 'type': 'str'} } def __init__(self, version=None): super(UPackLimitedPackageMetadata, self).__init__() self.version = version class UPackLimitedPackageMetadataListResponse(Model): """UPackLimitedPackageMetadataListResponse. :param count: :type count: int :param value: :type value: list of :class:`UPackLimitedPackageMetadata ` """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'value': {'key': 'value', 'type': '[UPackLimitedPackageMetadata]'} } def __init__(self, count=None, value=None): super(UPackLimitedPackageMetadataListResponse, self).__init__() self.count = count self.value = value class UPackPackageMetadata(Model): """UPackPackageMetadata. :param description: :type description: str :param manifest_id: :type manifest_id: str :param super_root_id: :type super_root_id: str :param version: :type version: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'manifest_id': {'key': 'manifestId', 'type': 'str'}, 'super_root_id': {'key': 'superRootId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, description=None, manifest_id=None, super_root_id=None, version=None): super(UPackPackageMetadata, self).__init__() self.description = description self.manifest_id = manifest_id self.super_root_id = super_root_id self.version = version class UPackPackagePushMetadata(UPackPackageMetadata): """UPackPackagePushMetadata. :param description: :type description: str :param manifest_id: :type manifest_id: str :param super_root_id: :type super_root_id: str :param version: :type version: str :param proof_nodes: :type proof_nodes: list of str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'manifest_id': {'key': 'manifestId', 'type': 'str'}, 'super_root_id': {'key': 'superRootId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'}, 'proof_nodes': {'key': 'proofNodes', 'type': '[str]'} } def __init__(self, description=None, manifest_id=None, super_root_id=None, version=None, proof_nodes=None): super(UPackPackagePushMetadata, self).__init__(description=description, manifest_id=manifest_id, super_root_id=super_root_id, version=version) self.proof_nodes = proof_nodes class UPackPackageVersionDeletionState(Model): """UPackPackageVersionDeletionState. :param deleted_date: UTC date the package was deleted. :type deleted_date: datetime :param name: Name of the package. :type name: str :param version: Version of the package. :type version: str """ _attribute_map = { 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, deleted_date=None, name=None, version=None): super(UPackPackageVersionDeletionState, self).__init__() self.deleted_date = deleted_date self.name = name self.version = version __all__ = [ 'UPackLimitedPackageMetadata', 'UPackLimitedPackageMetadataListResponse', 'UPackPackageMetadata', 'UPackPackagePushMetadata', 'UPackPackageVersionDeletionState', ] upack_packaging_client.py000066400000000000000000000107771360605530400371400ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/upack_packaging# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class UPackPackagingClient(Client): """UPackPackaging :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(UPackPackagingClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'd397749b-f115-4027-b6dd-77a65dd10d21' def add_package(self, metadata, feed_id, package_name, package_version): """AddPackage. [Preview API] :param :class:` ` metadata: :param str feed_id: :param str package_name: :param str package_version: """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') content = self._serialize.body(metadata, 'UPackPackagePushMetadata') self._send(http_method='PUT', location_id='4cdb2ced-0758-4651-8032-010f070dd7e5', version='5.0-preview.1', route_values=route_values, content=content) def get_package_metadata(self, feed_id, package_name, package_version, intent=None): """GetPackageMetadata. [Preview API] :param str feed_id: :param str package_name: :param str package_version: :param str intent: :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') if package_version is not None: route_values['packageVersion'] = self._serialize.url('package_version', package_version, 'str') query_parameters = {} if intent is not None: query_parameters['intent'] = self._serialize.query('intent', intent, 'str') response = self._send(http_method='GET', location_id='4cdb2ced-0758-4651-8032-010f070dd7e5', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('UPackPackageMetadata', response) def get_package_versions_metadata(self, feed_id, package_name): """GetPackageVersionsMetadata. [Preview API] :param str feed_id: :param str package_name: :rtype: :class:` ` """ route_values = {} if feed_id is not None: route_values['feedId'] = self._serialize.url('feed_id', feed_id, 'str') if package_name is not None: route_values['packageName'] = self._serialize.url('package_name', package_name, 'str') response = self._send(http_method='GET', location_id='4cdb2ced-0758-4651-8032-010f070dd7e5', version='5.0-preview.1', route_values=route_values) return self._deserialize('UPackLimitedPackageMetadataListResponse', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/wiki/000077500000000000000000000000001360605530400300205ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/wiki/__init__.py000066400000000000000000000020441360605530400321310ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .wiki_client import WikiClient __all__ = [ 'GitRepository', 'GitRepositoryRef', 'GitVersionDescriptor', 'WikiAttachment', 'WikiAttachmentResponse', 'WikiCreateBaseParameters', 'WikiCreateParametersV2', 'WikiPage', 'WikiPageCreateOrUpdateParameters', 'WikiPageMove', 'WikiPageMoveParameters', 'WikiPageMoveResponse', 'WikiPageResponse', 'WikiPageViewStats', 'WikiUpdateParameters', 'WikiV2', 'WikiClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/wiki/models.py000066400000000000000000000437051360605530400316660ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class GitRepository(Model): """GitRepository. :param _links: :type _links: ReferenceLinks :param default_branch: :type default_branch: str :param id: :type id: str :param is_fork: True if the repository was created as a fork :type is_fork: bool :param name: :type name: str :param parent_repository: :type parent_repository: :class:`GitRepositoryRef ` :param project: :type project: TeamProjectReference :param remote_url: :type remote_url: str :param size: Compressed size (bytes) of the repository. :type size: long :param ssh_url: :type ssh_url: str :param url: :type url: str :param valid_remote_urls: :type valid_remote_urls: list of str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_fork': {'key': 'isFork', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'parent_repository': {'key': 'parentRepository', 'type': 'GitRepositoryRef'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'size': {'key': 'size', 'type': 'long'}, 'ssh_url': {'key': 'sshUrl', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'valid_remote_urls': {'key': 'validRemoteUrls', 'type': '[str]'} } def __init__(self, _links=None, default_branch=None, id=None, is_fork=None, name=None, parent_repository=None, project=None, remote_url=None, size=None, ssh_url=None, url=None, valid_remote_urls=None): super(GitRepository, self).__init__() self._links = _links self.default_branch = default_branch self.id = id self.is_fork = is_fork self.name = name self.parent_repository = parent_repository self.project = project self.remote_url = remote_url self.size = size self.ssh_url = ssh_url self.url = url self.valid_remote_urls = valid_remote_urls class GitRepositoryRef(Model): """GitRepositoryRef. :param collection: Team Project Collection where this Fork resides :type collection: TeamProjectCollectionReference :param id: :type id: str :param is_fork: True if the repository was created as a fork :type is_fork: bool :param name: :type name: str :param project: :type project: TeamProjectReference :param remote_url: :type remote_url: str :param ssh_url: :type ssh_url: str :param url: :type url: str """ _attribute_map = { 'collection': {'key': 'collection', 'type': 'TeamProjectCollectionReference'}, 'id': {'key': 'id', 'type': 'str'}, 'is_fork': {'key': 'isFork', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'ssh_url': {'key': 'sshUrl', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, collection=None, id=None, is_fork=None, name=None, project=None, remote_url=None, ssh_url=None, url=None): super(GitRepositoryRef, self).__init__() self.collection = collection self.id = id self.is_fork = is_fork self.name = name self.project = project self.remote_url = remote_url self.ssh_url = ssh_url self.url = url class GitVersionDescriptor(Model): """GitVersionDescriptor. :param version: Version string identifier (name of tag/branch, SHA1 of commit) :type version: str :param version_options: Version options - Specify additional modifiers to version (e.g Previous) :type version_options: object :param version_type: Version type (branch, tag, or commit). Determines how Id is interpreted :type version_type: object """ _attribute_map = { 'version': {'key': 'version', 'type': 'str'}, 'version_options': {'key': 'versionOptions', 'type': 'object'}, 'version_type': {'key': 'versionType', 'type': 'object'} } def __init__(self, version=None, version_options=None, version_type=None): super(GitVersionDescriptor, self).__init__() self.version = version self.version_options = version_options self.version_type = version_type class WikiAttachment(Model): """WikiAttachment. :param name: Name of the wiki attachment file. :type name: str :param path: Path of the wiki attachment file. :type path: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, name=None, path=None): super(WikiAttachment, self).__init__() self.name = name self.path = path class WikiAttachmentResponse(Model): """WikiAttachmentResponse. :param attachment: Defines properties for wiki attachment file. :type attachment: :class:`WikiAttachment ` :param eTag: Contains the list of ETag values from the response header of the attachments API call. The first item in the list contains the version of the wiki attachment. :type eTag: list of str """ _attribute_map = { 'attachment': {'key': 'attachment', 'type': 'WikiAttachment'}, 'eTag': {'key': 'eTag', 'type': '[str]'} } def __init__(self, attachment=None, eTag=None): super(WikiAttachmentResponse, self).__init__() self.attachment = attachment self.eTag = eTag class WikiCreateBaseParameters(Model): """WikiCreateBaseParameters. :param mapped_path: Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type. :type mapped_path: str :param name: Wiki name. :type name: str :param project_id: ID of the project in which the wiki is to be created. :type project_id: str :param repository_id: ID of the git repository that backs up the wiki. Not required for ProjectWiki type. :type repository_id: str :param type: Type of the wiki. :type type: object """ _attribute_map = { 'mapped_path': {'key': 'mappedPath', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, mapped_path=None, name=None, project_id=None, repository_id=None, type=None): super(WikiCreateBaseParameters, self).__init__() self.mapped_path = mapped_path self.name = name self.project_id = project_id self.repository_id = repository_id self.type = type class WikiCreateParametersV2(WikiCreateBaseParameters): """WikiCreateParametersV2. :param mapped_path: Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type. :type mapped_path: str :param name: Wiki name. :type name: str :param project_id: ID of the project in which the wiki is to be created. :type project_id: str :param repository_id: ID of the git repository that backs up the wiki. Not required for ProjectWiki type. :type repository_id: str :param type: Type of the wiki. :type type: object :param version: Version of the wiki. Not required for ProjectWiki type. :type version: :class:`GitVersionDescriptor ` """ _attribute_map = { 'mapped_path': {'key': 'mappedPath', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'}, 'version': {'key': 'version', 'type': 'GitVersionDescriptor'} } def __init__(self, mapped_path=None, name=None, project_id=None, repository_id=None, type=None, version=None): super(WikiCreateParametersV2, self).__init__(mapped_path=mapped_path, name=name, project_id=project_id, repository_id=repository_id, type=type) self.version = version class WikiPageCreateOrUpdateParameters(Model): """WikiPageCreateOrUpdateParameters. :param content: Content of the wiki page. :type content: str """ _attribute_map = { 'content': {'key': 'content', 'type': 'str'} } def __init__(self, content=None): super(WikiPageCreateOrUpdateParameters, self).__init__() self.content = content class WikiPageMoveParameters(Model): """WikiPageMoveParameters. :param new_order: New order of the wiki page. :type new_order: int :param new_path: New path of the wiki page. :type new_path: str :param path: Current path of the wiki page. :type path: str """ _attribute_map = { 'new_order': {'key': 'newOrder', 'type': 'int'}, 'new_path': {'key': 'newPath', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, new_order=None, new_path=None, path=None): super(WikiPageMoveParameters, self).__init__() self.new_order = new_order self.new_path = new_path self.path = path class WikiPageMoveResponse(Model): """WikiPageMoveResponse. :param eTag: Contains the list of ETag values from the response header of the page move API call. The first item in the list contains the version of the wiki page subject to page move. :type eTag: list of str :param page_move: Defines properties for wiki page move. :type page_move: :class:`WikiPageMove ` """ _attribute_map = { 'eTag': {'key': 'eTag', 'type': '[str]'}, 'page_move': {'key': 'pageMove', 'type': 'WikiPageMove'} } def __init__(self, eTag=None, page_move=None): super(WikiPageMoveResponse, self).__init__() self.eTag = eTag self.page_move = page_move class WikiPageResponse(Model): """WikiPageResponse. :param eTag: Contains the list of ETag values from the response header of the pages API call. The first item in the list contains the version of the wiki page. :type eTag: list of str :param page: Defines properties for wiki page. :type page: :class:`WikiPage ` """ _attribute_map = { 'eTag': {'key': 'eTag', 'type': '[str]'}, 'page': {'key': 'page', 'type': 'WikiPage'} } def __init__(self, eTag=None, page=None): super(WikiPageResponse, self).__init__() self.eTag = eTag self.page = page class WikiPageViewStats(Model): """WikiPageViewStats. :param count: Wiki page view count. :type count: int :param last_viewed_time: Wiki page last viewed time. :type last_viewed_time: datetime :param path: Wiki page path. :type path: str """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'last_viewed_time': {'key': 'lastViewedTime', 'type': 'iso-8601'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, count=None, last_viewed_time=None, path=None): super(WikiPageViewStats, self).__init__() self.count = count self.last_viewed_time = last_viewed_time self.path = path class WikiUpdateParameters(Model): """WikiUpdateParameters. :param name: Name for wiki. :type name: str :param versions: Versions of the wiki. :type versions: list of :class:`GitVersionDescriptor ` """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'versions': {'key': 'versions', 'type': '[GitVersionDescriptor]'} } def __init__(self, name=None, versions=None): super(WikiUpdateParameters, self).__init__() self.name = name self.versions = versions class WikiV2(WikiCreateBaseParameters): """WikiV2. :param mapped_path: Folder path inside repository which is shown as Wiki. Not required for ProjectWiki type. :type mapped_path: str :param name: Wiki name. :type name: str :param project_id: ID of the project in which the wiki is to be created. :type project_id: str :param repository_id: ID of the git repository that backs up the wiki. Not required for ProjectWiki type. :type repository_id: str :param type: Type of the wiki. :type type: object :param id: ID of the wiki. :type id: str :param properties: Properties of the wiki. :type properties: dict :param remote_url: Remote web url to the wiki. :type remote_url: str :param url: REST url for this wiki. :type url: str :param versions: Versions of the wiki. :type versions: list of :class:`GitVersionDescriptor ` """ _attribute_map = { 'mapped_path': {'key': 'mappedPath', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'repository_id': {'key': 'repositoryId', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'}, 'id': {'key': 'id', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'versions': {'key': 'versions', 'type': '[GitVersionDescriptor]'} } def __init__(self, mapped_path=None, name=None, project_id=None, repository_id=None, type=None, id=None, properties=None, remote_url=None, url=None, versions=None): super(WikiV2, self).__init__(mapped_path=mapped_path, name=name, project_id=project_id, repository_id=repository_id, type=type) self.id = id self.properties = properties self.remote_url = remote_url self.url = url self.versions = versions class WikiPage(WikiPageCreateOrUpdateParameters): """WikiPage. :param content: Content of the wiki page. :type content: str :param git_item_path: Path of the git item corresponding to the wiki page stored in the backing Git repository. :type git_item_path: str :param is_non_conformant: True if a page is non-conforming, i.e. 1) if the name doesn't match page naming standards. 2) if the page does not have a valid entry in the appropriate order file. :type is_non_conformant: bool :param is_parent_page: True if this page has subpages under its path. :type is_parent_page: bool :param order: Order of the wiki page, relative to other pages in the same hierarchy level. :type order: int :param path: Path of the wiki page. :type path: str :param remote_url: Remote web url to the wiki page. :type remote_url: str :param sub_pages: List of subpages of the current page. :type sub_pages: list of :class:`WikiPage ` :param url: REST url for this wiki page. :type url: str """ _attribute_map = { 'content': {'key': 'content', 'type': 'str'}, 'git_item_path': {'key': 'gitItemPath', 'type': 'str'}, 'is_non_conformant': {'key': 'isNonConformant', 'type': 'bool'}, 'is_parent_page': {'key': 'isParentPage', 'type': 'bool'}, 'order': {'key': 'order', 'type': 'int'}, 'path': {'key': 'path', 'type': 'str'}, 'remote_url': {'key': 'remoteUrl', 'type': 'str'}, 'sub_pages': {'key': 'subPages', 'type': '[WikiPage]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, content=None, git_item_path=None, is_non_conformant=None, is_parent_page=None, order=None, path=None, remote_url=None, sub_pages=None, url=None): super(WikiPage, self).__init__(content=content) self.git_item_path = git_item_path self.is_non_conformant = is_non_conformant self.is_parent_page = is_parent_page self.order = order self.path = path self.remote_url = remote_url self.sub_pages = sub_pages self.url = url class WikiPageMove(WikiPageMoveParameters): """WikiPageMove. :param new_order: New order of the wiki page. :type new_order: int :param new_path: New path of the wiki page. :type new_path: str :param path: Current path of the wiki page. :type path: str :param page: Resultant page of this page move operation. :type page: :class:`WikiPage ` """ _attribute_map = { 'new_order': {'key': 'newOrder', 'type': 'int'}, 'new_path': {'key': 'newPath', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'page': {'key': 'page', 'type': 'WikiPage'} } def __init__(self, new_order=None, new_path=None, path=None, page=None): super(WikiPageMove, self).__init__(new_order=new_order, new_path=new_path, path=path) self.page = page __all__ = [ 'GitRepository', 'GitRepositoryRef', 'GitVersionDescriptor', 'WikiAttachment', 'WikiAttachmentResponse', 'WikiCreateBaseParameters', 'WikiCreateParametersV2', 'WikiPageCreateOrUpdateParameters', 'WikiPageMoveParameters', 'WikiPageMoveResponse', 'WikiPageResponse', 'WikiPageViewStats', 'WikiUpdateParameters', 'WikiV2', 'WikiPage', 'WikiPageMove', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/wiki/wiki_client.py000066400000000000000000000520541360605530400327010ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class WikiClient(Client): """Wiki :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(WikiClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = 'bf7d82a0-8aa5-4613-94ef-6172a5ea01f3' def create_attachment(self, upload_stream, project, wiki_identifier, name, **kwargs): """CreateAttachment. Creates an attachment in the wiki. :param object upload_stream: Stream to upload :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str name: Wiki attachment name. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='PUT', location_id='c4382d8d-fefc-40e0-92c5-49852e9e17c0', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/octet-stream') response_object = models.WikiAttachmentResponse() response_object.attachment = self._deserialize('WikiAttachment', response) response_object.eTag = response.headers.get('ETag') return response_object def create_page_move(self, page_move_parameters, project, wiki_identifier, comment=None): """CreatePageMove. Creates a page move operation that updates the path and order of the page as provided in the parameters. :param :class:` ` page_move_parameters: Page more operation parameters. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str comment: Comment that is to be associated with this page move. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if comment is not None: query_parameters['comment'] = self._serialize.query('comment', comment, 'str') content = self._serialize.body(page_move_parameters, 'WikiPageMoveParameters') response = self._send(http_method='POST', location_id='e37bbe71-cbae-49e5-9a4e-949143b9d910', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) response_object = models.WikiPageMoveResponse() response_object.page_move = self._deserialize('WikiPageMove', response) response_object.eTag = response.headers.get('ETag') return response_object def create_or_update_page(self, parameters, project, wiki_identifier, path, version, comment=None): """CreateOrUpdatePage. Creates or edits a wiki page. :param :class:` ` parameters: Wiki create or update operation parameters. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param String version: Version of the page on which the change is to be made. Mandatory for `Edit` scenario. To be populated in the If-Match header of the request. :param str comment: Comment to be associated with the page operation. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if comment is not None: query_parameters['comment'] = self._serialize.query('comment', comment, 'str') additional_headers = {} if version is not None: additional_headers['If-Match'] = version content = self._serialize.body(parameters, 'WikiPageCreateOrUpdateParameters') response = self._send(http_method='PUT', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.0', route_values=route_values, query_parameters=query_parameters, additional_headers=additional_headers, content=content) response_object = models.WikiPageResponse() response_object.page = self._deserialize('WikiPage', response) response_object.eTag = response.headers.get('ETag') return response_object def delete_page(self, project, wiki_identifier, path, comment=None): """DeletePage. Deletes a wiki page. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param str comment: Comment to be associated with this page delete. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if comment is not None: query_parameters['comment'] = self._serialize.query('comment', comment, 'str') response = self._send(http_method='DELETE', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.0', route_values=route_values, query_parameters=query_parameters) response_object = models.WikiPageResponse() response_object.page = self._deserialize('WikiPage', response) response_object.eTag = response.headers.get('ETag') return response_object def get_page(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None): """GetPage. Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.0', route_values=route_values, query_parameters=query_parameters) response_object = models.WikiPageResponse() response_object.page = self._deserialize('WikiPage', response) response_object.eTag = response.headers.get('ETag') return response_object def get_page_text(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetPageText. Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_page_zip(self, project, wiki_identifier, path=None, recursion_level=None, version_descriptor=None, include_content=None, **kwargs): """GetPageZip. Gets metadata or content of the wiki page for the provided path. Content negotiation is done based on the `Accept` header sent in the request. :param str project: Project ID or project name :param str wiki_identifier: Wiki Id or name. :param str path: Wiki page path. :param str recursion_level: Recursion level for subpages retrieval. Defaults to `None` (Optional). :param :class:` ` version_descriptor: GitVersionDescriptor for the page. Defaults to the default branch (Optional). :param bool include_content: True to include the content of the page in the response for Json content type. Defaults to false (Optional) :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if recursion_level is not None: query_parameters['recursionLevel'] = self._serialize.query('recursion_level', recursion_level, 'str') if version_descriptor is not None: if version_descriptor.version_type is not None: query_parameters['versionDescriptor.versionType'] = version_descriptor.version_type if version_descriptor.version is not None: query_parameters['versionDescriptor.version'] = version_descriptor.version if version_descriptor.version_options is not None: query_parameters['versionDescriptor.versionOptions'] = version_descriptor.version_options if include_content is not None: query_parameters['includeContent'] = self._serialize.query('include_content', include_content, 'bool') response = self._send(http_method='GET', location_id='25d3fbc7-fe3d-46cb-b5a5-0b6f79caf27b', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def create_wiki(self, wiki_create_params, project=None): """CreateWiki. Creates the wiki resource. :param :class:` ` wiki_create_params: Parameters for the wiki creation. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(wiki_create_params, 'WikiCreateParametersV2') response = self._send(http_method='POST', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.0', route_values=route_values, content=content) return self._deserialize('WikiV2', response) def delete_wiki(self, wiki_identifier, project=None): """DeleteWiki. Deletes the wiki corresponding to the wiki name or Id provided. :param str wiki_identifier: Wiki name or Id. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') response = self._send(http_method='DELETE', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.0', route_values=route_values) return self._deserialize('WikiV2', response) def get_all_wikis(self, project=None): """GetAllWikis. Gets all wikis in a project or collection. :param str project: Project ID or project name :rtype: [WikiV2] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.0', route_values=route_values) return self._deserialize('[WikiV2]', self._unwrap_collection(response)) def get_wiki(self, wiki_identifier, project=None): """GetWiki. Gets the wiki corresponding to the wiki name or Id provided. :param str wiki_identifier: Wiki name or id. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') response = self._send(http_method='GET', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.0', route_values=route_values) return self._deserialize('WikiV2', response) def update_wiki(self, update_parameters, wiki_identifier, project=None): """UpdateWiki. Updates the wiki corresponding to the wiki Id or name provided using the update parameters. :param :class:` ` update_parameters: Update parameters. :param str wiki_identifier: Wiki name or Id. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if wiki_identifier is not None: route_values['wikiIdentifier'] = self._serialize.url('wiki_identifier', wiki_identifier, 'str') content = self._serialize.body(update_parameters, 'WikiUpdateParameters') response = self._send(http_method='PATCH', location_id='288d122c-dbd4-451d-aa5f-7dbbba070728', version='5.0', route_values=route_values, content=content) return self._deserialize('WikiV2', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work/000077500000000000000000000000001360605530400300375ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work/__init__.py000066400000000000000000000042111360605530400321460ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .work_client import WorkClient __all__ = [ 'Activity', 'BacklogColumn', 'BacklogConfiguration', 'BacklogFields', 'BacklogLevel', 'BacklogLevelConfiguration', 'BacklogLevelWorkItems', 'Board', 'BoardCardRuleSettings', 'BoardCardSettings', 'BoardChart', 'BoardChartReference', 'BoardColumn', 'BoardFields', 'BoardReference', 'BoardRow', 'BoardSuggestedValue', 'BoardUserSettings', 'CapacityPatch', 'CategoryConfiguration', 'CreatePlan', 'DateRange', 'DeliveryViewData', 'FieldReference', 'FilterClause', 'GraphSubjectBase', 'IdentityRef', 'IterationWorkItems', 'Link', 'Member', 'ParentChildWIMap', 'Plan', 'PlanViewData', 'PredefinedQuery', 'ProcessConfiguration', 'ReferenceLinks', 'Rule', 'TeamContext', 'TeamFieldValue', 'TeamFieldValues', 'TeamFieldValuesPatch', 'TeamIterationAttributes', 'TeamMemberCapacity', 'TeamSetting', 'TeamSettingsDataContractBase', 'TeamSettingsDaysOff', 'TeamSettingsDaysOffPatch', 'TeamSettingsIteration', 'TeamSettingsPatch', 'TimelineCriteriaStatus', 'TimelineIterationStatus', 'TimelineTeamData', 'TimelineTeamIteration', 'TimelineTeamStatus', 'UpdatePlan', 'WorkItem', 'WorkItemColor', 'WorkItemFieldReference', 'WorkItemLink', 'WorkItemReference', 'WorkItemRelation', 'WorkItemTrackingResource', 'WorkItemTrackingResourceReference', 'WorkItemTypeReference', 'WorkItemTypeStateInfo', 'WorkClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work/models.py000066400000000000000000002037501360605530400317030ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class Activity(Model): """Activity. :param capacity_per_day: :type capacity_per_day: int :param name: :type name: str """ _attribute_map = { 'capacity_per_day': {'key': 'capacityPerDay', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, capacity_per_day=None, name=None): super(Activity, self).__init__() self.capacity_per_day = capacity_per_day self.name = name class BacklogColumn(Model): """BacklogColumn. :param column_field_reference: :type column_field_reference: :class:`WorkItemFieldReference ` :param width: :type width: int """ _attribute_map = { 'column_field_reference': {'key': 'columnFieldReference', 'type': 'WorkItemFieldReference'}, 'width': {'key': 'width', 'type': 'int'} } def __init__(self, column_field_reference=None, width=None): super(BacklogColumn, self).__init__() self.column_field_reference = column_field_reference self.width = width class BacklogConfiguration(Model): """BacklogConfiguration. :param backlog_fields: Behavior/type field mapping :type backlog_fields: :class:`BacklogFields ` :param bugs_behavior: Bugs behavior :type bugs_behavior: object :param hidden_backlogs: Hidden Backlog :type hidden_backlogs: list of str :param portfolio_backlogs: Portfolio backlog descriptors :type portfolio_backlogs: list of :class:`BacklogLevelConfiguration ` :param requirement_backlog: Requirement backlog :type requirement_backlog: :class:`BacklogLevelConfiguration ` :param task_backlog: Task backlog :type task_backlog: :class:`BacklogLevelConfiguration ` :param url: :type url: str :param work_item_type_mapped_states: Mapped states for work item types :type work_item_type_mapped_states: list of :class:`WorkItemTypeStateInfo ` """ _attribute_map = { 'backlog_fields': {'key': 'backlogFields', 'type': 'BacklogFields'}, 'bugs_behavior': {'key': 'bugsBehavior', 'type': 'object'}, 'hidden_backlogs': {'key': 'hiddenBacklogs', 'type': '[str]'}, 'portfolio_backlogs': {'key': 'portfolioBacklogs', 'type': '[BacklogLevelConfiguration]'}, 'requirement_backlog': {'key': 'requirementBacklog', 'type': 'BacklogLevelConfiguration'}, 'task_backlog': {'key': 'taskBacklog', 'type': 'BacklogLevelConfiguration'}, 'url': {'key': 'url', 'type': 'str'}, 'work_item_type_mapped_states': {'key': 'workItemTypeMappedStates', 'type': '[WorkItemTypeStateInfo]'} } def __init__(self, backlog_fields=None, bugs_behavior=None, hidden_backlogs=None, portfolio_backlogs=None, requirement_backlog=None, task_backlog=None, url=None, work_item_type_mapped_states=None): super(BacklogConfiguration, self).__init__() self.backlog_fields = backlog_fields self.bugs_behavior = bugs_behavior self.hidden_backlogs = hidden_backlogs self.portfolio_backlogs = portfolio_backlogs self.requirement_backlog = requirement_backlog self.task_backlog = task_backlog self.url = url self.work_item_type_mapped_states = work_item_type_mapped_states class BacklogFields(Model): """BacklogFields. :param type_fields: Field Type (e.g. Order, Activity) to Field Reference Name map :type type_fields: dict """ _attribute_map = { 'type_fields': {'key': 'typeFields', 'type': '{str}'} } def __init__(self, type_fields=None): super(BacklogFields, self).__init__() self.type_fields = type_fields class BacklogLevel(Model): """BacklogLevel. :param category_reference_name: Reference name of the corresponding WIT category :type category_reference_name: str :param plural_name: Plural name for the backlog level :type plural_name: str :param work_item_states: Collection of work item states that are included in the plan. The server will filter to only these work item types. :type work_item_states: list of str :param work_item_types: Collection of valid workitem type names for the given backlog level :type work_item_types: list of str """ _attribute_map = { 'category_reference_name': {'key': 'categoryReferenceName', 'type': 'str'}, 'plural_name': {'key': 'pluralName', 'type': 'str'}, 'work_item_states': {'key': 'workItemStates', 'type': '[str]'}, 'work_item_types': {'key': 'workItemTypes', 'type': '[str]'} } def __init__(self, category_reference_name=None, plural_name=None, work_item_states=None, work_item_types=None): super(BacklogLevel, self).__init__() self.category_reference_name = category_reference_name self.plural_name = plural_name self.work_item_states = work_item_states self.work_item_types = work_item_types class BacklogLevelConfiguration(Model): """BacklogLevelConfiguration. :param add_panel_fields: List of fields to include in Add Panel :type add_panel_fields: list of :class:`WorkItemFieldReference ` :param color: Color for the backlog level :type color: str :param column_fields: Default list of columns for the backlog :type column_fields: list of :class:`BacklogColumn ` :param default_work_item_type: Defaulst Work Item Type for the backlog :type default_work_item_type: :class:`WorkItemTypeReference ` :param id: Backlog Id (for Legacy Backlog Level from process config it can be categoryref name) :type id: str :param is_hidden: Indicates whether the backlog level is hidden :type is_hidden: bool :param name: Backlog Name :type name: str :param rank: Backlog Rank (Taskbacklog is 0) :type rank: int :param type: The type of this backlog level :type type: object :param work_item_count_limit: Max number of work items to show in the given backlog :type work_item_count_limit: int :param work_item_types: Work Item types participating in this backlog as known by the project/Process, can be overridden by team settings for bugs :type work_item_types: list of :class:`WorkItemTypeReference ` """ _attribute_map = { 'add_panel_fields': {'key': 'addPanelFields', 'type': '[WorkItemFieldReference]'}, 'color': {'key': 'color', 'type': 'str'}, 'column_fields': {'key': 'columnFields', 'type': '[BacklogColumn]'}, 'default_work_item_type': {'key': 'defaultWorkItemType', 'type': 'WorkItemTypeReference'}, 'id': {'key': 'id', 'type': 'str'}, 'is_hidden': {'key': 'isHidden', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'rank': {'key': 'rank', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'work_item_count_limit': {'key': 'workItemCountLimit', 'type': 'int'}, 'work_item_types': {'key': 'workItemTypes', 'type': '[WorkItemTypeReference]'} } def __init__(self, add_panel_fields=None, color=None, column_fields=None, default_work_item_type=None, id=None, is_hidden=None, name=None, rank=None, type=None, work_item_count_limit=None, work_item_types=None): super(BacklogLevelConfiguration, self).__init__() self.add_panel_fields = add_panel_fields self.color = color self.column_fields = column_fields self.default_work_item_type = default_work_item_type self.id = id self.is_hidden = is_hidden self.name = name self.rank = rank self.type = type self.work_item_count_limit = work_item_count_limit self.work_item_types = work_item_types class BacklogLevelWorkItems(Model): """BacklogLevelWorkItems. :param work_items: A list of work items within a backlog level :type work_items: list of :class:`WorkItemLink ` """ _attribute_map = { 'work_items': {'key': 'workItems', 'type': '[WorkItemLink]'} } def __init__(self, work_items=None): super(BacklogLevelWorkItems, self).__init__() self.work_items = work_items class BoardCardRuleSettings(Model): """BoardCardRuleSettings. :param _links: :type _links: :class:`ReferenceLinks ` :param rules: :type rules: dict :param url: :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'rules': {'key': 'rules', 'type': '{[Rule]}'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, rules=None, url=None): super(BoardCardRuleSettings, self).__init__() self._links = _links self.rules = rules self.url = url class BoardCardSettings(Model): """BoardCardSettings. :param cards: :type cards: dict """ _attribute_map = { 'cards': {'key': 'cards', 'type': '{[FieldSetting]}'} } def __init__(self, cards=None): super(BoardCardSettings, self).__init__() self.cards = cards class BoardChartReference(Model): """BoardChartReference. :param name: Name of the resource :type name: str :param url: Full http link to the resource :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, url=None): super(BoardChartReference, self).__init__() self.name = name self.url = url class BoardColumn(Model): """BoardColumn. :param column_type: :type column_type: object :param description: :type description: str :param id: :type id: str :param is_split: :type is_split: bool :param item_limit: :type item_limit: int :param name: :type name: str :param state_mappings: :type state_mappings: dict """ _attribute_map = { 'column_type': {'key': 'columnType', 'type': 'object'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_split': {'key': 'isSplit', 'type': 'bool'}, 'item_limit': {'key': 'itemLimit', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'state_mappings': {'key': 'stateMappings', 'type': '{str}'} } def __init__(self, column_type=None, description=None, id=None, is_split=None, item_limit=None, name=None, state_mappings=None): super(BoardColumn, self).__init__() self.column_type = column_type self.description = description self.id = id self.is_split = is_split self.item_limit = item_limit self.name = name self.state_mappings = state_mappings class BoardFields(Model): """BoardFields. :param column_field: :type column_field: :class:`FieldReference ` :param done_field: :type done_field: :class:`FieldReference ` :param row_field: :type row_field: :class:`FieldReference ` """ _attribute_map = { 'column_field': {'key': 'columnField', 'type': 'FieldReference'}, 'done_field': {'key': 'doneField', 'type': 'FieldReference'}, 'row_field': {'key': 'rowField', 'type': 'FieldReference'} } def __init__(self, column_field=None, done_field=None, row_field=None): super(BoardFields, self).__init__() self.column_field = column_field self.done_field = done_field self.row_field = row_field class BoardReference(Model): """BoardReference. :param id: Id of the resource :type id: str :param name: Name of the resource :type name: str :param url: Full http link to the resource :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, name=None, url=None): super(BoardReference, self).__init__() self.id = id self.name = name self.url = url class BoardRow(Model): """BoardRow. :param id: :type id: str :param name: :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, name=None): super(BoardRow, self).__init__() self.id = id self.name = name class BoardSuggestedValue(Model): """BoardSuggestedValue. :param name: :type name: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'} } def __init__(self, name=None): super(BoardSuggestedValue, self).__init__() self.name = name class BoardUserSettings(Model): """BoardUserSettings. :param auto_refresh_state: :type auto_refresh_state: bool """ _attribute_map = { 'auto_refresh_state': {'key': 'autoRefreshState', 'type': 'bool'} } def __init__(self, auto_refresh_state=None): super(BoardUserSettings, self).__init__() self.auto_refresh_state = auto_refresh_state class CapacityPatch(Model): """CapacityPatch. :param activities: :type activities: list of :class:`Activity ` :param days_off: :type days_off: list of :class:`DateRange ` """ _attribute_map = { 'activities': {'key': 'activities', 'type': '[Activity]'}, 'days_off': {'key': 'daysOff', 'type': '[DateRange]'} } def __init__(self, activities=None, days_off=None): super(CapacityPatch, self).__init__() self.activities = activities self.days_off = days_off class CategoryConfiguration(Model): """CategoryConfiguration. :param name: Name :type name: str :param reference_name: Category Reference Name :type reference_name: str :param work_item_types: Work item types for the backlog category :type work_item_types: list of :class:`WorkItemTypeReference ` """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'work_item_types': {'key': 'workItemTypes', 'type': '[WorkItemTypeReference]'} } def __init__(self, name=None, reference_name=None, work_item_types=None): super(CategoryConfiguration, self).__init__() self.name = name self.reference_name = reference_name self.work_item_types = work_item_types class CreatePlan(Model): """CreatePlan. :param description: Description of the plan :type description: str :param name: Name of the plan to create. :type name: str :param properties: Plan properties. :type properties: object :param type: Type of plan to create. :type type: object """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, description=None, name=None, properties=None, type=None): super(CreatePlan, self).__init__() self.description = description self.name = name self.properties = properties self.type = type class DateRange(Model): """DateRange. :param end: End of the date range. :type end: datetime :param start: Start of the date range. :type start: datetime """ _attribute_map = { 'end': {'key': 'end', 'type': 'iso-8601'}, 'start': {'key': 'start', 'type': 'iso-8601'} } def __init__(self, end=None, start=None): super(DateRange, self).__init__() self.end = end self.start = start class FieldReference(Model): """FieldReference. :param reference_name: fieldRefName for the field :type reference_name: str :param url: Full http link to more information about the field :type url: str """ _attribute_map = { 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, reference_name=None, url=None): super(FieldReference, self).__init__() self.reference_name = reference_name self.url = url class FilterClause(Model): """FilterClause. :param field_name: :type field_name: str :param index: :type index: int :param logical_operator: :type logical_operator: str :param operator: :type operator: str :param value: :type value: str """ _attribute_map = { 'field_name': {'key': 'fieldName', 'type': 'str'}, 'index': {'key': 'index', 'type': 'int'}, 'logical_operator': {'key': 'logicalOperator', 'type': 'str'}, 'operator': {'key': 'operator', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, field_name=None, index=None, logical_operator=None, operator=None, value=None): super(FilterClause, self).__init__() self.field_name = field_name self.index = index self.logical_operator = logical_operator self.operator = operator self.value = value class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class Link(Model): """Link. :param attributes: Collection of link attributes. :type attributes: dict :param rel: Relation type. :type rel: str :param url: Link url. :type url: str """ _attribute_map = { 'attributes': {'key': 'attributes', 'type': '{object}'}, 'rel': {'key': 'rel', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, attributes=None, rel=None, url=None): super(Link, self).__init__() self.attributes = attributes self.rel = rel self.url = url class Member(Model): """Member. :param display_name: :type display_name: str :param id: :type id: str :param image_url: :type image_url: str :param unique_name: :type unique_name: str :param url: :type url: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, display_name=None, id=None, image_url=None, unique_name=None, url=None): super(Member, self).__init__() self.display_name = display_name self.id = id self.image_url = image_url self.unique_name = unique_name self.url = url class ParentChildWIMap(Model): """ParentChildWIMap. :param child_work_item_ids: :type child_work_item_ids: list of int :param id: :type id: int :param title: :type title: str """ _attribute_map = { 'child_work_item_ids': {'key': 'childWorkItemIds', 'type': '[int]'}, 'id': {'key': 'id', 'type': 'int'}, 'title': {'key': 'title', 'type': 'str'} } def __init__(self, child_work_item_ids=None, id=None, title=None): super(ParentChildWIMap, self).__init__() self.child_work_item_ids = child_work_item_ids self.id = id self.title = title class Plan(Model): """Plan. :param created_by_identity: Identity that created this plan. Defaults to null for records before upgrading to ScaledAgileViewComponent4. :type created_by_identity: :class:`IdentityRef ` :param created_date: Date when the plan was created :type created_date: datetime :param description: Description of the plan :type description: str :param id: Id of the plan :type id: str :param modified_by_identity: Identity that last modified this plan. Defaults to null for records before upgrading to ScaledAgileViewComponent4. :type modified_by_identity: :class:`IdentityRef ` :param modified_date: Date when the plan was last modified. Default to CreatedDate when the plan is first created. :type modified_date: datetime :param name: Name of the plan :type name: str :param properties: The PlanPropertyCollection instance associated with the plan. These are dependent on the type of the plan. For example, DeliveryTimelineView, it would be of type DeliveryViewPropertyCollection. :type properties: object :param revision: Revision of the plan. Used to safeguard users from overwriting each other's changes. :type revision: int :param type: Type of the plan :type type: object :param url: The resource url to locate the plan via rest api :type url: str :param user_permissions: Bit flag indicating set of permissions a user has to the plan. :type user_permissions: object """ _attribute_map = { 'created_by_identity': {'key': 'createdByIdentity', 'type': 'IdentityRef'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'modified_by_identity': {'key': 'modifiedByIdentity', 'type': 'IdentityRef'}, 'modified_date': {'key': 'modifiedDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'user_permissions': {'key': 'userPermissions', 'type': 'object'} } def __init__(self, created_by_identity=None, created_date=None, description=None, id=None, modified_by_identity=None, modified_date=None, name=None, properties=None, revision=None, type=None, url=None, user_permissions=None): super(Plan, self).__init__() self.created_by_identity = created_by_identity self.created_date = created_date self.description = description self.id = id self.modified_by_identity = modified_by_identity self.modified_date = modified_date self.name = name self.properties = properties self.revision = revision self.type = type self.url = url self.user_permissions = user_permissions class PlanViewData(Model): """PlanViewData. :param id: :type id: str :param revision: :type revision: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'} } def __init__(self, id=None, revision=None): super(PlanViewData, self).__init__() self.id = id self.revision = revision class PredefinedQuery(Model): """PredefinedQuery. :param has_more: Whether or not the query returned the complete set of data or if the data was truncated. :type has_more: bool :param id: Id of the query :type id: str :param name: Localized name of the query :type name: str :param results: The results of the query. This will be a set of WorkItem objects with only the 'id' set. The client is responsible for paging in the data as needed. :type results: list of :class:`WorkItem ` :param url: REST API Url to use to retrieve results for this query :type url: str :param web_url: Url to use to display a page in the browser with the results of this query :type web_url: str """ _attribute_map = { 'has_more': {'key': 'hasMore', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'results': {'key': 'results', 'type': '[WorkItem]'}, 'url': {'key': 'url', 'type': 'str'}, 'web_url': {'key': 'webUrl', 'type': 'str'} } def __init__(self, has_more=None, id=None, name=None, results=None, url=None, web_url=None): super(PredefinedQuery, self).__init__() self.has_more = has_more self.id = id self.name = name self.results = results self.url = url self.web_url = web_url class ProcessConfiguration(Model): """ProcessConfiguration. :param bug_work_items: Details about bug work items :type bug_work_items: :class:`CategoryConfiguration ` :param portfolio_backlogs: Details about portfolio backlogs :type portfolio_backlogs: list of :class:`CategoryConfiguration ` :param requirement_backlog: Details of requirement backlog :type requirement_backlog: :class:`CategoryConfiguration ` :param task_backlog: Details of task backlog :type task_backlog: :class:`CategoryConfiguration ` :param type_fields: Type fields for the process configuration :type type_fields: dict :param url: :type url: str """ _attribute_map = { 'bug_work_items': {'key': 'bugWorkItems', 'type': 'CategoryConfiguration'}, 'portfolio_backlogs': {'key': 'portfolioBacklogs', 'type': '[CategoryConfiguration]'}, 'requirement_backlog': {'key': 'requirementBacklog', 'type': 'CategoryConfiguration'}, 'task_backlog': {'key': 'taskBacklog', 'type': 'CategoryConfiguration'}, 'type_fields': {'key': 'typeFields', 'type': '{WorkItemFieldReference}'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, bug_work_items=None, portfolio_backlogs=None, requirement_backlog=None, task_backlog=None, type_fields=None, url=None): super(ProcessConfiguration, self).__init__() self.bug_work_items = bug_work_items self.portfolio_backlogs = portfolio_backlogs self.requirement_backlog = requirement_backlog self.task_backlog = task_backlog self.type_fields = type_fields self.url = url class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class Rule(Model): """Rule. :param clauses: :type clauses: list of :class:`FilterClause ` :param filter: :type filter: str :param is_enabled: :type is_enabled: str :param name: :type name: str :param settings: :type settings: dict """ _attribute_map = { 'clauses': {'key': 'clauses', 'type': '[FilterClause]'}, 'filter': {'key': 'filter', 'type': 'str'}, 'is_enabled': {'key': 'isEnabled', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'settings': {'key': 'settings', 'type': '{str}'} } def __init__(self, clauses=None, filter=None, is_enabled=None, name=None, settings=None): super(Rule, self).__init__() self.clauses = clauses self.filter = filter self.is_enabled = is_enabled self.name = name self.settings = settings class TeamContext(Model): """TeamContext. :param project: The team project Id or name. Ignored if ProjectId is set. :type project: str :param project_id: The Team Project ID. Required if Project is not set. :type project_id: str :param team: The Team Id or name. Ignored if TeamId is set. :type team: str :param team_id: The Team Id :type team_id: str """ _attribute_map = { 'project': {'key': 'project', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'team': {'key': 'team', 'type': 'str'}, 'team_id': {'key': 'teamId', 'type': 'str'} } def __init__(self, project=None, project_id=None, team=None, team_id=None): super(TeamContext, self).__init__() self.project = project self.project_id = project_id self.team = team self.team_id = team_id class TeamFieldValue(Model): """TeamFieldValue. :param include_children: :type include_children: bool :param value: :type value: str """ _attribute_map = { 'include_children': {'key': 'includeChildren', 'type': 'bool'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, include_children=None, value=None): super(TeamFieldValue, self).__init__() self.include_children = include_children self.value = value class TeamFieldValuesPatch(Model): """TeamFieldValuesPatch. :param default_value: :type default_value: str :param values: :type values: list of :class:`TeamFieldValue ` """ _attribute_map = { 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'values': {'key': 'values', 'type': '[TeamFieldValue]'} } def __init__(self, default_value=None, values=None): super(TeamFieldValuesPatch, self).__init__() self.default_value = default_value self.values = values class TeamIterationAttributes(Model): """TeamIterationAttributes. :param finish_date: :type finish_date: datetime :param start_date: :type start_date: datetime :param time_frame: :type time_frame: object """ _attribute_map = { 'finish_date': {'key': 'finishDate', 'type': 'iso-8601'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'time_frame': {'key': 'timeFrame', 'type': 'object'} } def __init__(self, finish_date=None, start_date=None, time_frame=None): super(TeamIterationAttributes, self).__init__() self.finish_date = finish_date self.start_date = start_date self.time_frame = time_frame class TeamSettingsDataContractBase(Model): """TeamSettingsDataContractBase. :param _links: Collection of links relevant to resource :type _links: :class:`ReferenceLinks ` :param url: Full http link to the resource :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, url=None): super(TeamSettingsDataContractBase, self).__init__() self._links = _links self.url = url class TeamSettingsDaysOff(TeamSettingsDataContractBase): """TeamSettingsDaysOff. :param _links: Collection of links relevant to resource :type _links: :class:`ReferenceLinks ` :param url: Full http link to the resource :type url: str :param days_off: :type days_off: list of :class:`DateRange ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'url': {'key': 'url', 'type': 'str'}, 'days_off': {'key': 'daysOff', 'type': '[DateRange]'} } def __init__(self, _links=None, url=None, days_off=None): super(TeamSettingsDaysOff, self).__init__(_links=_links, url=url) self.days_off = days_off class TeamSettingsDaysOffPatch(Model): """TeamSettingsDaysOffPatch. :param days_off: :type days_off: list of :class:`DateRange ` """ _attribute_map = { 'days_off': {'key': 'daysOff', 'type': '[DateRange]'} } def __init__(self, days_off=None): super(TeamSettingsDaysOffPatch, self).__init__() self.days_off = days_off class TeamSettingsIteration(TeamSettingsDataContractBase): """TeamSettingsIteration. :param _links: Collection of links relevant to resource :type _links: :class:`ReferenceLinks ` :param url: Full http link to the resource :type url: str :param attributes: Attributes such as start and end date :type attributes: :class:`TeamIterationAttributes ` :param id: Id of the resource :type id: str :param name: Name of the resource :type name: str :param path: Relative path of the iteration :type path: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'url': {'key': 'url', 'type': 'str'}, 'attributes': {'key': 'attributes', 'type': 'TeamIterationAttributes'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'} } def __init__(self, _links=None, url=None, attributes=None, id=None, name=None, path=None): super(TeamSettingsIteration, self).__init__(_links=_links, url=url) self.attributes = attributes self.id = id self.name = name self.path = path class TeamSettingsPatch(Model): """TeamSettingsPatch. :param backlog_iteration: :type backlog_iteration: str :param backlog_visibilities: :type backlog_visibilities: dict :param bugs_behavior: :type bugs_behavior: object :param default_iteration: :type default_iteration: str :param default_iteration_macro: :type default_iteration_macro: str :param working_days: :type working_days: list of str """ _attribute_map = { 'backlog_iteration': {'key': 'backlogIteration', 'type': 'str'}, 'backlog_visibilities': {'key': 'backlogVisibilities', 'type': '{bool}'}, 'bugs_behavior': {'key': 'bugsBehavior', 'type': 'object'}, 'default_iteration': {'key': 'defaultIteration', 'type': 'str'}, 'default_iteration_macro': {'key': 'defaultIterationMacro', 'type': 'str'}, 'working_days': {'key': 'workingDays', 'type': '[object]'} } def __init__(self, backlog_iteration=None, backlog_visibilities=None, bugs_behavior=None, default_iteration=None, default_iteration_macro=None, working_days=None): super(TeamSettingsPatch, self).__init__() self.backlog_iteration = backlog_iteration self.backlog_visibilities = backlog_visibilities self.bugs_behavior = bugs_behavior self.default_iteration = default_iteration self.default_iteration_macro = default_iteration_macro self.working_days = working_days class TimelineCriteriaStatus(Model): """TimelineCriteriaStatus. :param message: :type message: str :param type: :type type: object """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, message=None, type=None): super(TimelineCriteriaStatus, self).__init__() self.message = message self.type = type class TimelineIterationStatus(Model): """TimelineIterationStatus. :param message: :type message: str :param type: :type type: object """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, message=None, type=None): super(TimelineIterationStatus, self).__init__() self.message = message self.type = type class TimelineTeamData(Model): """TimelineTeamData. :param backlog: Backlog matching the mapped backlog associated with this team. :type backlog: :class:`BacklogLevel ` :param field_reference_names: The field reference names of the work item data :type field_reference_names: list of str :param id: The id of the team :type id: str :param is_expanded: Was iteration and work item data retrieved for this team. Teams with IsExpanded false have not had their iteration, work item, and field related data queried and will never contain this data. If true then these items are queried and, if there are items in the queried range, there will be data. :type is_expanded: bool :param iterations: The iteration data, including the work items, in the queried date range. :type iterations: list of :class:`TimelineTeamIteration ` :param name: The name of the team :type name: str :param order_by_field: The order by field name of this team :type order_by_field: str :param partially_paged_field_reference_names: The field reference names of the partially paged work items, such as ID, WorkItemType :type partially_paged_field_reference_names: list of str :param project_id: The project id the team belongs team :type project_id: str :param status: Status for this team. :type status: :class:`TimelineTeamStatus ` :param team_field_default_value: The team field default value :type team_field_default_value: str :param team_field_name: The team field name of this team :type team_field_name: str :param team_field_values: The team field values :type team_field_values: list of :class:`TeamFieldValue ` :param work_item_type_colors: Colors for the work item types. :type work_item_type_colors: list of :class:`WorkItemColor ` """ _attribute_map = { 'backlog': {'key': 'backlog', 'type': 'BacklogLevel'}, 'field_reference_names': {'key': 'fieldReferenceNames', 'type': '[str]'}, 'id': {'key': 'id', 'type': 'str'}, 'is_expanded': {'key': 'isExpanded', 'type': 'bool'}, 'iterations': {'key': 'iterations', 'type': '[TimelineTeamIteration]'}, 'name': {'key': 'name', 'type': 'str'}, 'order_by_field': {'key': 'orderByField', 'type': 'str'}, 'partially_paged_field_reference_names': {'key': 'partiallyPagedFieldReferenceNames', 'type': '[str]'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'status': {'key': 'status', 'type': 'TimelineTeamStatus'}, 'team_field_default_value': {'key': 'teamFieldDefaultValue', 'type': 'str'}, 'team_field_name': {'key': 'teamFieldName', 'type': 'str'}, 'team_field_values': {'key': 'teamFieldValues', 'type': '[TeamFieldValue]'}, 'work_item_type_colors': {'key': 'workItemTypeColors', 'type': '[WorkItemColor]'} } def __init__(self, backlog=None, field_reference_names=None, id=None, is_expanded=None, iterations=None, name=None, order_by_field=None, partially_paged_field_reference_names=None, project_id=None, status=None, team_field_default_value=None, team_field_name=None, team_field_values=None, work_item_type_colors=None): super(TimelineTeamData, self).__init__() self.backlog = backlog self.field_reference_names = field_reference_names self.id = id self.is_expanded = is_expanded self.iterations = iterations self.name = name self.order_by_field = order_by_field self.partially_paged_field_reference_names = partially_paged_field_reference_names self.project_id = project_id self.status = status self.team_field_default_value = team_field_default_value self.team_field_name = team_field_name self.team_field_values = team_field_values self.work_item_type_colors = work_item_type_colors class TimelineTeamIteration(Model): """TimelineTeamIteration. :param finish_date: The end date of the iteration :type finish_date: datetime :param name: The iteration name :type name: str :param partially_paged_work_items: All the partially paged workitems in this iteration. :type partially_paged_work_items: list of [object] :param path: The iteration path :type path: str :param start_date: The start date of the iteration :type start_date: datetime :param status: The status of this iteration :type status: :class:`TimelineIterationStatus ` :param work_items: The work items that have been paged in this iteration :type work_items: list of [object] """ _attribute_map = { 'finish_date': {'key': 'finishDate', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'partially_paged_work_items': {'key': 'partiallyPagedWorkItems', 'type': '[[object]]'}, 'path': {'key': 'path', 'type': 'str'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'TimelineIterationStatus'}, 'work_items': {'key': 'workItems', 'type': '[[object]]'} } def __init__(self, finish_date=None, name=None, partially_paged_work_items=None, path=None, start_date=None, status=None, work_items=None): super(TimelineTeamIteration, self).__init__() self.finish_date = finish_date self.name = name self.partially_paged_work_items = partially_paged_work_items self.path = path self.start_date = start_date self.status = status self.work_items = work_items class TimelineTeamStatus(Model): """TimelineTeamStatus. :param message: :type message: str :param type: :type type: object """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, message=None, type=None): super(TimelineTeamStatus, self).__init__() self.message = message self.type = type class UpdatePlan(Model): """UpdatePlan. :param description: Description of the plan :type description: str :param name: Name of the plan to create. :type name: str :param properties: Plan properties. :type properties: object :param revision: Revision of the plan that was updated - the value used here should match the one the server gave the client in the Plan. :type revision: int :param type: Type of the plan :type type: object """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, description=None, name=None, properties=None, revision=None, type=None): super(UpdatePlan, self).__init__() self.description = description self.name = name self.properties = properties self.revision = revision self.type = type class WorkItemColor(Model): """WorkItemColor. :param icon: :type icon: str :param primary_color: :type primary_color: str :param work_item_type_name: :type work_item_type_name: str """ _attribute_map = { 'icon': {'key': 'icon', 'type': 'str'}, 'primary_color': {'key': 'primaryColor', 'type': 'str'}, 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'} } def __init__(self, icon=None, primary_color=None, work_item_type_name=None): super(WorkItemColor, self).__init__() self.icon = icon self.primary_color = primary_color self.work_item_type_name = work_item_type_name class WorkItemFieldReference(Model): """WorkItemFieldReference. :param name: The name of the field. :type name: str :param reference_name: The reference name of the field. :type reference_name: str :param url: The REST URL of the resource. :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, reference_name=None, url=None): super(WorkItemFieldReference, self).__init__() self.name = name self.reference_name = reference_name self.url = url class WorkItemLink(Model): """WorkItemLink. :param rel: The type of link. :type rel: str :param source: The source work item. :type source: :class:`WorkItemReference ` :param target: The target work item. :type target: :class:`WorkItemReference ` """ _attribute_map = { 'rel': {'key': 'rel', 'type': 'str'}, 'source': {'key': 'source', 'type': 'WorkItemReference'}, 'target': {'key': 'target', 'type': 'WorkItemReference'} } def __init__(self, rel=None, source=None, target=None): super(WorkItemLink, self).__init__() self.rel = rel self.source = source self.target = target class WorkItemReference(Model): """WorkItemReference. :param id: Work item ID. :type id: int :param url: REST API URL of the resource :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(WorkItemReference, self).__init__() self.id = id self.url = url class WorkItemRelation(Link): """WorkItemRelation. :param attributes: Collection of link attributes. :type attributes: dict :param rel: Relation type. :type rel: str :param url: Link url. :type url: str """ _attribute_map = { 'attributes': {'key': 'attributes', 'type': '{object}'}, 'rel': {'key': 'rel', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, } def __init__(self, attributes=None, rel=None, url=None): super(WorkItemRelation, self).__init__(attributes=attributes, rel=rel, url=url) class WorkItemTrackingResourceReference(Model): """WorkItemTrackingResourceReference. :param url: :type url: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'} } def __init__(self, url=None): super(WorkItemTrackingResourceReference, self).__init__() self.url = url class WorkItemTypeReference(WorkItemTrackingResourceReference): """WorkItemTypeReference. :param url: :type url: str :param name: Name of the work item type. :type name: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, url=None, name=None): super(WorkItemTypeReference, self).__init__(url=url) self.name = name class WorkItemTypeStateInfo(Model): """WorkItemTypeStateInfo. :param states: State name to state category map :type states: dict :param work_item_type_name: Work Item type name :type work_item_type_name: str """ _attribute_map = { 'states': {'key': 'states', 'type': '{str}'}, 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'} } def __init__(self, states=None, work_item_type_name=None): super(WorkItemTypeStateInfo, self).__init__() self.states = states self.work_item_type_name = work_item_type_name class Board(BoardReference): """Board. :param id: Id of the resource :type id: str :param name: Name of the resource :type name: str :param url: Full http link to the resource :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param allowed_mappings: :type allowed_mappings: dict :param can_edit: :type can_edit: bool :param columns: :type columns: list of :class:`BoardColumn ` :param fields: :type fields: :class:`BoardFields ` :param is_valid: :type is_valid: bool :param revision: :type revision: int :param rows: :type rows: list of :class:`BoardRow ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'allowed_mappings': {'key': 'allowedMappings', 'type': '{{[str]}}'}, 'can_edit': {'key': 'canEdit', 'type': 'bool'}, 'columns': {'key': 'columns', 'type': '[BoardColumn]'}, 'fields': {'key': 'fields', 'type': 'BoardFields'}, 'is_valid': {'key': 'isValid', 'type': 'bool'}, 'revision': {'key': 'revision', 'type': 'int'}, 'rows': {'key': 'rows', 'type': '[BoardRow]'} } def __init__(self, id=None, name=None, url=None, _links=None, allowed_mappings=None, can_edit=None, columns=None, fields=None, is_valid=None, revision=None, rows=None): super(Board, self).__init__(id=id, name=name, url=url) self._links = _links self.allowed_mappings = allowed_mappings self.can_edit = can_edit self.columns = columns self.fields = fields self.is_valid = is_valid self.revision = revision self.rows = rows class BoardChart(BoardChartReference): """BoardChart. :param name: Name of the resource :type name: str :param url: Full http link to the resource :type url: str :param _links: The links for the resource :type _links: :class:`ReferenceLinks ` :param settings: The settings for the resource :type settings: dict """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'settings': {'key': 'settings', 'type': '{object}'} } def __init__(self, name=None, url=None, _links=None, settings=None): super(BoardChart, self).__init__(name=name, url=url) self._links = _links self.settings = settings class DeliveryViewData(PlanViewData): """DeliveryViewData. :param id: :type id: str :param revision: :type revision: int :param child_id_to_parent_id_map: Work item child id to parenet id map :type child_id_to_parent_id_map: dict :param criteria_status: Filter criteria status of the timeline :type criteria_status: :class:`TimelineCriteriaStatus ` :param end_date: The end date of the delivery view data :type end_date: datetime :param start_date: The start date for the delivery view data :type start_date: datetime :param teams: All the team data :type teams: list of :class:`TimelineTeamData ` """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'}, 'child_id_to_parent_id_map': {'key': 'childIdToParentIdMap', 'type': '{int}'}, 'criteria_status': {'key': 'criteriaStatus', 'type': 'TimelineCriteriaStatus'}, 'end_date': {'key': 'endDate', 'type': 'iso-8601'}, 'start_date': {'key': 'startDate', 'type': 'iso-8601'}, 'teams': {'key': 'teams', 'type': '[TimelineTeamData]'} } def __init__(self, id=None, revision=None, child_id_to_parent_id_map=None, criteria_status=None, end_date=None, start_date=None, teams=None): super(DeliveryViewData, self).__init__(id=id, revision=revision) self.child_id_to_parent_id_map = child_id_to_parent_id_map self.criteria_status = criteria_status self.end_date = end_date self.start_date = start_date self.teams = teams class IterationWorkItems(TeamSettingsDataContractBase): """IterationWorkItems. :param _links: Collection of links relevant to resource :type _links: :class:`ReferenceLinks ` :param url: Full http link to the resource :type url: str :param work_item_relations: Work item relations :type work_item_relations: list of :class:`WorkItemLink ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'url': {'key': 'url', 'type': 'str'}, 'work_item_relations': {'key': 'workItemRelations', 'type': '[WorkItemLink]'} } def __init__(self, _links=None, url=None, work_item_relations=None): super(IterationWorkItems, self).__init__(_links=_links, url=url) self.work_item_relations = work_item_relations class TeamFieldValues(TeamSettingsDataContractBase): """TeamFieldValues. :param _links: Collection of links relevant to resource :type _links: :class:`ReferenceLinks ` :param url: Full http link to the resource :type url: str :param default_value: The default team field value :type default_value: str :param field: Shallow ref to the field being used as a team field :type field: :class:`FieldReference ` :param values: Collection of all valid team field values :type values: list of :class:`TeamFieldValue ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'url': {'key': 'url', 'type': 'str'}, 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'field': {'key': 'field', 'type': 'FieldReference'}, 'values': {'key': 'values', 'type': '[TeamFieldValue]'} } def __init__(self, _links=None, url=None, default_value=None, field=None, values=None): super(TeamFieldValues, self).__init__(_links=_links, url=url) self.default_value = default_value self.field = field self.values = values class TeamMemberCapacity(TeamSettingsDataContractBase): """TeamMemberCapacity. :param _links: Collection of links relevant to resource :type _links: :class:`ReferenceLinks ` :param url: Full http link to the resource :type url: str :param activities: Collection of capacities associated with the team member :type activities: list of :class:`Activity ` :param days_off: The days off associated with the team member :type days_off: list of :class:`DateRange ` :param team_member: Shallow Ref to the associated team member :type team_member: :class:`Member ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'url': {'key': 'url', 'type': 'str'}, 'activities': {'key': 'activities', 'type': '[Activity]'}, 'days_off': {'key': 'daysOff', 'type': '[DateRange]'}, 'team_member': {'key': 'teamMember', 'type': 'Member'} } def __init__(self, _links=None, url=None, activities=None, days_off=None, team_member=None): super(TeamMemberCapacity, self).__init__(_links=_links, url=url) self.activities = activities self.days_off = days_off self.team_member = team_member class TeamSetting(TeamSettingsDataContractBase): """TeamSetting. :param _links: Collection of links relevant to resource :type _links: :class:`ReferenceLinks ` :param url: Full http link to the resource :type url: str :param backlog_iteration: Backlog Iteration :type backlog_iteration: :class:`TeamSettingsIteration ` :param backlog_visibilities: Information about categories that are visible on the backlog. :type backlog_visibilities: dict :param bugs_behavior: BugsBehavior (Off, AsTasks, AsRequirements, ...) :type bugs_behavior: object :param default_iteration: Default Iteration, the iteration used when creating a new work item on the queries page. :type default_iteration: :class:`TeamSettingsIteration ` :param default_iteration_macro: Default Iteration macro (if any) :type default_iteration_macro: str :param working_days: Days that the team is working :type working_days: list of str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'url': {'key': 'url', 'type': 'str'}, 'backlog_iteration': {'key': 'backlogIteration', 'type': 'TeamSettingsIteration'}, 'backlog_visibilities': {'key': 'backlogVisibilities', 'type': '{bool}'}, 'bugs_behavior': {'key': 'bugsBehavior', 'type': 'object'}, 'default_iteration': {'key': 'defaultIteration', 'type': 'TeamSettingsIteration'}, 'default_iteration_macro': {'key': 'defaultIterationMacro', 'type': 'str'}, 'working_days': {'key': 'workingDays', 'type': '[object]'} } def __init__(self, _links=None, url=None, backlog_iteration=None, backlog_visibilities=None, bugs_behavior=None, default_iteration=None, default_iteration_macro=None, working_days=None): super(TeamSetting, self).__init__(_links=_links, url=url) self.backlog_iteration = backlog_iteration self.backlog_visibilities = backlog_visibilities self.bugs_behavior = bugs_behavior self.default_iteration = default_iteration self.default_iteration_macro = default_iteration_macro self.working_days = working_days class WorkItemTrackingResource(WorkItemTrackingResourceReference): """WorkItemTrackingResource. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'} } def __init__(self, url=None, _links=None): super(WorkItemTrackingResource, self).__init__(url=url) self._links = _links class WorkItem(WorkItemTrackingResource): """WorkItem. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param fields: Map of field and values for the work item. :type fields: dict :param id: The work item ID. :type id: int :param relations: Relations of the work item. :type relations: list of :class:`WorkItemRelation ` :param rev: Revision number of the work item. :type rev: int """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'fields': {'key': 'fields', 'type': '{object}'}, 'id': {'key': 'id', 'type': 'int'}, 'relations': {'key': 'relations', 'type': '[WorkItemRelation]'}, 'rev': {'key': 'rev', 'type': 'int'} } def __init__(self, url=None, _links=None, fields=None, id=None, relations=None, rev=None): super(WorkItem, self).__init__(url=url, _links=_links) self.fields = fields self.id = id self.relations = relations self.rev = rev __all__ = [ 'Activity', 'BacklogColumn', 'BacklogConfiguration', 'BacklogFields', 'BacklogLevel', 'BacklogLevelConfiguration', 'BacklogLevelWorkItems', 'BoardCardRuleSettings', 'BoardCardSettings', 'BoardChartReference', 'BoardColumn', 'BoardFields', 'BoardReference', 'BoardRow', 'BoardSuggestedValue', 'BoardUserSettings', 'CapacityPatch', 'CategoryConfiguration', 'CreatePlan', 'DateRange', 'FieldReference', 'FilterClause', 'GraphSubjectBase', 'IdentityRef', 'Link', 'Member', 'ParentChildWIMap', 'Plan', 'PlanViewData', 'PredefinedQuery', 'ProcessConfiguration', 'ReferenceLinks', 'Rule', 'TeamContext', 'TeamFieldValue', 'TeamFieldValuesPatch', 'TeamIterationAttributes', 'TeamSettingsDataContractBase', 'TeamSettingsDaysOff', 'TeamSettingsDaysOffPatch', 'TeamSettingsIteration', 'TeamSettingsPatch', 'TimelineCriteriaStatus', 'TimelineIterationStatus', 'TimelineTeamData', 'TimelineTeamIteration', 'TimelineTeamStatus', 'UpdatePlan', 'WorkItemColor', 'WorkItemFieldReference', 'WorkItemLink', 'WorkItemReference', 'WorkItemRelation', 'WorkItemTrackingResourceReference', 'WorkItemTypeReference', 'WorkItemTypeStateInfo', 'Board', 'BoardChart', 'DeliveryViewData', 'IterationWorkItems', 'TeamFieldValues', 'TeamMemberCapacity', 'TeamSetting', 'WorkItemTrackingResource', 'WorkItem', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work/work_client.py000066400000000000000000001761671360605530400327530ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class WorkClient(Client): """Work :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(WorkClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '1d4f49f9-02b9-4e26-b826-2cdb6195f2a9' def get_backlog_configurations(self, team_context): """GetBacklogConfigurations. Gets backlog configuration for a team :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='7799f497-3cb5-4f16-ad4f-5cd06012db64', version='5.0', route_values=route_values) return self._deserialize('BacklogConfiguration', response) def get_backlog_level_work_items(self, team_context, backlog_id): """GetBacklogLevelWorkItems. [Preview API] Get a list of work items within a backlog level :param :class:` ` team_context: The team context for the operation :param str backlog_id: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if backlog_id is not None: route_values['backlogId'] = self._serialize.url('backlog_id', backlog_id, 'str') response = self._send(http_method='GET', location_id='7c468d96-ab1d-4294-a360-92f07e9ccd98', version='5.0-preview.1', route_values=route_values) return self._deserialize('BacklogLevelWorkItems', response) def get_backlog(self, team_context, id): """GetBacklog. [Preview API] Get a backlog level :param :class:` ` team_context: The team context for the operation :param str id: The id of the backlog level :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='a93726f9-7867-4e38-b4f2-0bfafc2f6a94', version='5.0-preview.1', route_values=route_values) return self._deserialize('BacklogLevelConfiguration', response) def get_backlogs(self, team_context): """GetBacklogs. [Preview API] List all backlog levels :param :class:` ` team_context: The team context for the operation :rtype: [BacklogLevelConfiguration] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='a93726f9-7867-4e38-b4f2-0bfafc2f6a94', version='5.0-preview.1', route_values=route_values) return self._deserialize('[BacklogLevelConfiguration]', self._unwrap_collection(response)) def get_column_suggested_values(self, project=None): """GetColumnSuggestedValues. Get available board columns in a project :param str project: Project ID or project name :rtype: [BoardSuggestedValue] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='eb7ec5a3-1ba3-4fd1-b834-49a5a387e57d', version='5.0', route_values=route_values) return self._deserialize('[BoardSuggestedValue]', self._unwrap_collection(response)) def get_board_mapping_parent_items(self, team_context, child_backlog_context_category_ref_name, workitem_ids): """GetBoardMappingParentItems. [Preview API] Returns the list of parent field filter model for the given list of workitem ids :param :class:` ` team_context: The team context for the operation :param str child_backlog_context_category_ref_name: :param [int] workitem_ids: :rtype: [ParentChildWIMap] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') query_parameters = {} if child_backlog_context_category_ref_name is not None: query_parameters['childBacklogContextCategoryRefName'] = self._serialize.query('child_backlog_context_category_ref_name', child_backlog_context_category_ref_name, 'str') if workitem_ids is not None: workitem_ids = ",".join(map(str, workitem_ids)) query_parameters['workitemIds'] = self._serialize.query('workitem_ids', workitem_ids, 'str') response = self._send(http_method='GET', location_id='186abea3-5c35-432f-9e28-7a15b4312a0e', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ParentChildWIMap]', self._unwrap_collection(response)) def get_row_suggested_values(self, project=None): """GetRowSuggestedValues. Get available board rows in a project :param str project: Project ID or project name :rtype: [BoardSuggestedValue] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='bb494cc6-a0f5-4c6c-8dca-ea6912e79eb9', version='5.0', route_values=route_values) return self._deserialize('[BoardSuggestedValue]', self._unwrap_collection(response)) def get_board(self, team_context, id): """GetBoard. Get board :param :class:` ` team_context: The team context for the operation :param str id: identifier for board, either board's backlog level name (Eg:"Stories") or Id :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='23ad19fc-3b8e-4877-8462-b3f92bc06b40', version='5.0', route_values=route_values) return self._deserialize('Board', response) def get_boards(self, team_context): """GetBoards. Get boards :param :class:` ` team_context: The team context for the operation :rtype: [BoardReference] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='23ad19fc-3b8e-4877-8462-b3f92bc06b40', version='5.0', route_values=route_values) return self._deserialize('[BoardReference]', self._unwrap_collection(response)) def set_board_options(self, options, team_context, id): """SetBoardOptions. Update board options :param {str} options: options to updated :param :class:` ` team_context: The team context for the operation :param str id: identifier for board, either category plural name (Eg:"Stories") or guid :rtype: {str} """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') content = self._serialize.body(options, '{str}') response = self._send(http_method='PUT', location_id='23ad19fc-3b8e-4877-8462-b3f92bc06b40', version='5.0', route_values=route_values, content=content) return self._deserialize('{str}', self._unwrap_collection(response)) def get_board_user_settings(self, team_context, board): """GetBoardUserSettings. [Preview API] Get board user settings for a board id :param :class:` ` team_context: The team context for the operation :param str board: Board ID or Name :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='b30d9f58-1891-4b0a-b168-c46408f919b0', version='5.0-preview.1', route_values=route_values) return self._deserialize('BoardUserSettings', response) def update_board_user_settings(self, board_user_settings, team_context, board): """UpdateBoardUserSettings. [Preview API] Update board user settings for the board id :param {str} board_user_settings: :param :class:` ` team_context: The team context for the operation :param str board: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') content = self._serialize.body(board_user_settings, '{str}') response = self._send(http_method='PATCH', location_id='b30d9f58-1891-4b0a-b168-c46408f919b0', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('BoardUserSettings', response) def get_capacities(self, team_context, iteration_id): """GetCapacities. Get a team's capacity :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: [TeamMemberCapacity] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') response = self._send(http_method='GET', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', version='5.0', route_values=route_values) return self._deserialize('[TeamMemberCapacity]', self._unwrap_collection(response)) def get_capacity(self, team_context, iteration_id, team_member_id): """GetCapacity. Get a team member's capacity :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :param str team_member_id: ID of the team member :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') if team_member_id is not None: route_values['teamMemberId'] = self._serialize.url('team_member_id', team_member_id, 'str') response = self._send(http_method='GET', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', version='5.0', route_values=route_values) return self._deserialize('TeamMemberCapacity', response) def replace_capacities(self, capacities, team_context, iteration_id): """ReplaceCapacities. Replace a team's capacity :param [TeamMemberCapacity] capacities: Team capacity to replace :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: [TeamMemberCapacity] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') content = self._serialize.body(capacities, '[TeamMemberCapacity]') response = self._send(http_method='PUT', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', version='5.0', route_values=route_values, content=content) return self._deserialize('[TeamMemberCapacity]', self._unwrap_collection(response)) def update_capacity(self, patch, team_context, iteration_id, team_member_id): """UpdateCapacity. Update a team member's capacity :param :class:` ` patch: Updated capacity :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :param str team_member_id: ID of the team member :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') if team_member_id is not None: route_values['teamMemberId'] = self._serialize.url('team_member_id', team_member_id, 'str') content = self._serialize.body(patch, 'CapacityPatch') response = self._send(http_method='PATCH', location_id='74412d15-8c1a-4352-a48d-ef1ed5587d57', version='5.0', route_values=route_values, content=content) return self._deserialize('TeamMemberCapacity', response) def get_board_card_rule_settings(self, team_context, board): """GetBoardCardRuleSettings. Get board card Rule settings for the board id or board by name :param :class:` ` team_context: The team context for the operation :param str board: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='b044a3d9-02ea-49c7-91a1-b730949cc896', version='5.0', route_values=route_values) return self._deserialize('BoardCardRuleSettings', response) def update_board_card_rule_settings(self, board_card_rule_settings, team_context, board): """UpdateBoardCardRuleSettings. Update board card Rule settings for the board id or board by name :param :class:` ` board_card_rule_settings: :param :class:` ` team_context: The team context for the operation :param str board: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') content = self._serialize.body(board_card_rule_settings, 'BoardCardRuleSettings') response = self._send(http_method='PATCH', location_id='b044a3d9-02ea-49c7-91a1-b730949cc896', version='5.0', route_values=route_values, content=content) return self._deserialize('BoardCardRuleSettings', response) def get_board_card_settings(self, team_context, board): """GetBoardCardSettings. Get board card settings for the board id or board by name :param :class:` ` team_context: The team context for the operation :param str board: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='07c3b467-bc60-4f05-8e34-599ce288fafc', version='5.0', route_values=route_values) return self._deserialize('BoardCardSettings', response) def update_board_card_settings(self, board_card_settings_to_save, team_context, board): """UpdateBoardCardSettings. Update board card settings for the board id or board by name :param :class:` ` board_card_settings_to_save: :param :class:` ` team_context: The team context for the operation :param str board: :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') content = self._serialize.body(board_card_settings_to_save, 'BoardCardSettings') response = self._send(http_method='PUT', location_id='07c3b467-bc60-4f05-8e34-599ce288fafc', version='5.0', route_values=route_values, content=content) return self._deserialize('BoardCardSettings', response) def get_board_chart(self, team_context, board, name): """GetBoardChart. Get a board chart :param :class:` ` team_context: The team context for the operation :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id :param str name: The chart name :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', version='5.0', route_values=route_values) return self._deserialize('BoardChart', response) def get_board_charts(self, team_context, board): """GetBoardCharts. Get board charts :param :class:` ` team_context: The team context for the operation :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id :rtype: [BoardChartReference] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', version='5.0', route_values=route_values) return self._deserialize('[BoardChartReference]', self._unwrap_collection(response)) def update_board_chart(self, chart, team_context, board, name): """UpdateBoardChart. Update a board chart :param :class:` ` chart: :param :class:` ` team_context: The team context for the operation :param str board: Identifier for board, either board's backlog level name (Eg:"Stories") or Id :param str name: The chart name :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') content = self._serialize.body(chart, 'BoardChart') response = self._send(http_method='PATCH', location_id='45fe888c-239e-49fd-958c-df1a1ab21d97', version='5.0', route_values=route_values, content=content) return self._deserialize('BoardChart', response) def get_board_columns(self, team_context, board): """GetBoardColumns. Get columns on a board :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardColumn] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='c555d7ff-84e1-47df-9923-a3fe0cd8751b', version='5.0', route_values=route_values) return self._deserialize('[BoardColumn]', self._unwrap_collection(response)) def update_board_columns(self, board_columns, team_context, board): """UpdateBoardColumns. Update columns on a board :param [BoardColumn] board_columns: List of board columns to update :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardColumn] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') content = self._serialize.body(board_columns, '[BoardColumn]') response = self._send(http_method='PUT', location_id='c555d7ff-84e1-47df-9923-a3fe0cd8751b', version='5.0', route_values=route_values, content=content) return self._deserialize('[BoardColumn]', self._unwrap_collection(response)) def get_delivery_timeline_data(self, project, id, revision=None, start_date=None, end_date=None): """GetDeliveryTimelineData. Get Delivery View Data :param str project: Project ID or project name :param str id: Identifier for delivery view :param int revision: Revision of the plan for which you want data. If the current plan is a different revision you will get an ViewRevisionMismatchException exception. If you do not supply a revision you will get data for the latest revision. :param datetime start_date: The start date of timeline :param datetime end_date: The end date of timeline :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if revision is not None: query_parameters['revision'] = self._serialize.query('revision', revision, 'int') if start_date is not None: query_parameters['startDate'] = self._serialize.query('start_date', start_date, 'iso-8601') if end_date is not None: query_parameters['endDate'] = self._serialize.query('end_date', end_date, 'iso-8601') response = self._send(http_method='GET', location_id='bdd0834e-101f-49f0-a6ae-509f384a12b4', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('DeliveryViewData', response) def delete_team_iteration(self, team_context, id): """DeleteTeamIteration. Delete a team's iteration by iterationId :param :class:` ` team_context: The team context for the operation :param str id: ID of the iteration """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') self._send(http_method='DELETE', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', version='5.0', route_values=route_values) def get_team_iteration(self, team_context, id): """GetTeamIteration. Get team's iteration by iterationId :param :class:` ` team_context: The team context for the operation :param str id: ID of the iteration :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', version='5.0', route_values=route_values) return self._deserialize('TeamSettingsIteration', response) def get_team_iterations(self, team_context, timeframe=None): """GetTeamIterations. Get a team's iterations using timeframe filter :param :class:` ` team_context: The team context for the operation :param str timeframe: A filter for which iterations are returned based on relative time. Only Current is supported currently. :rtype: [TeamSettingsIteration] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') query_parameters = {} if timeframe is not None: query_parameters['$timeframe'] = self._serialize.query('timeframe', timeframe, 'str') response = self._send(http_method='GET', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[TeamSettingsIteration]', self._unwrap_collection(response)) def post_team_iteration(self, iteration, team_context): """PostTeamIteration. Add an iteration to the team :param :class:` ` iteration: Iteration to add :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(iteration, 'TeamSettingsIteration') response = self._send(http_method='POST', location_id='c9175577-28a1-4b06-9197-8636af9f64ad', version='5.0', route_values=route_values, content=content) return self._deserialize('TeamSettingsIteration', response) def create_plan(self, posted_plan, project): """CreatePlan. Add a new plan for the team :param :class:` ` posted_plan: Plan definition :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(posted_plan, 'CreatePlan') response = self._send(http_method='POST', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.0', route_values=route_values, content=content) return self._deserialize('Plan', response) def delete_plan(self, project, id): """DeletePlan. Delete the specified plan :param str project: Project ID or project name :param str id: Identifier of the plan """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') self._send(http_method='DELETE', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.0', route_values=route_values) def get_plan(self, project, id): """GetPlan. Get the information for the specified plan :param str project: Project ID or project name :param str id: Identifier of the plan :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') response = self._send(http_method='GET', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.0', route_values=route_values) return self._deserialize('Plan', response) def get_plans(self, project): """GetPlans. Get the information for all the plans configured for the given team :param str project: Project ID or project name :rtype: [Plan] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.0', route_values=route_values) return self._deserialize('[Plan]', self._unwrap_collection(response)) def update_plan(self, updated_plan, project, id): """UpdatePlan. Update the information for the specified plan :param :class:` ` updated_plan: Plan definition to be updated :param str project: Project ID or project name :param str id: Identifier of the plan :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') content = self._serialize.body(updated_plan, 'UpdatePlan') response = self._send(http_method='PUT', location_id='0b42cb47-cd73-4810-ac90-19c9ba147453', version='5.0', route_values=route_values, content=content) return self._deserialize('Plan', response) def get_process_configuration(self, project): """GetProcessConfiguration. [Preview API] Get process configuration :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='f901ba42-86d2-4b0c-89c1-3f86d06daa84', version='5.0-preview.1', route_values=route_values) return self._deserialize('ProcessConfiguration', response) def get_board_rows(self, team_context, board): """GetBoardRows. Get rows on a board :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardRow] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') response = self._send(http_method='GET', location_id='0863355d-aefd-4d63-8669-984c9b7b0e78', version='5.0', route_values=route_values) return self._deserialize('[BoardRow]', self._unwrap_collection(response)) def update_board_rows(self, board_rows, team_context, board): """UpdateBoardRows. Update rows on a board :param [BoardRow] board_rows: List of board rows to update :param :class:` ` team_context: The team context for the operation :param str board: Name or ID of the specific board :rtype: [BoardRow] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if board is not None: route_values['board'] = self._serialize.url('board', board, 'str') content = self._serialize.body(board_rows, '[BoardRow]') response = self._send(http_method='PUT', location_id='0863355d-aefd-4d63-8669-984c9b7b0e78', version='5.0', route_values=route_values, content=content) return self._deserialize('[BoardRow]', self._unwrap_collection(response)) def get_team_days_off(self, team_context, iteration_id): """GetTeamDaysOff. Get team's days off for an iteration :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') response = self._send(http_method='GET', location_id='2d4faa2e-9150-4cbf-a47a-932b1b4a0773', version='5.0', route_values=route_values) return self._deserialize('TeamSettingsDaysOff', response) def update_team_days_off(self, days_off_patch, team_context, iteration_id): """UpdateTeamDaysOff. Set a team's days off for an iteration :param :class:` ` days_off_patch: Team's days off patch containting a list of start and end dates :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') content = self._serialize.body(days_off_patch, 'TeamSettingsDaysOffPatch') response = self._send(http_method='PATCH', location_id='2d4faa2e-9150-4cbf-a47a-932b1b4a0773', version='5.0', route_values=route_values, content=content) return self._deserialize('TeamSettingsDaysOff', response) def get_team_field_values(self, team_context): """GetTeamFieldValues. Get a collection of team field values :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='07ced576-58ed-49e6-9c1e-5cb53ab8bf2a', version='5.0', route_values=route_values) return self._deserialize('TeamFieldValues', response) def update_team_field_values(self, patch, team_context): """UpdateTeamFieldValues. Update team field values :param :class:` ` patch: :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(patch, 'TeamFieldValuesPatch') response = self._send(http_method='PATCH', location_id='07ced576-58ed-49e6-9c1e-5cb53ab8bf2a', version='5.0', route_values=route_values, content=content) return self._deserialize('TeamFieldValues', response) def get_team_settings(self, team_context): """GetTeamSettings. Get a team's settings :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') response = self._send(http_method='GET', location_id='c3c1012b-bea7-49d7-b45e-1664e566f84c', version='5.0', route_values=route_values) return self._deserialize('TeamSetting', response) def update_team_settings(self, team_settings_patch, team_context): """UpdateTeamSettings. Update a team's settings :param :class:` ` team_settings_patch: TeamSettings changes :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(team_settings_patch, 'TeamSettingsPatch') response = self._send(http_method='PATCH', location_id='c3c1012b-bea7-49d7-b45e-1664e566f84c', version='5.0', route_values=route_values, content=content) return self._deserialize('TeamSetting', response) def get_iteration_work_items(self, team_context, iteration_id): """GetIterationWorkItems. [Preview API] Get work items for iteration :param :class:` ` team_context: The team context for the operation :param str iteration_id: ID of the iteration :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if iteration_id is not None: route_values['iterationId'] = self._serialize.url('iteration_id', iteration_id, 'str') response = self._send(http_method='GET', location_id='5b3ef1a6-d3ab-44cd-bafd-c7f45db850fa', version='5.0-preview.1', route_values=route_values) return self._deserialize('IterationWorkItems', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking/000077500000000000000000000000001360605530400327375ustar00rootroot00000000000000__init__.py000066400000000000000000000051371360605530400347770ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .work_item_tracking_client import WorkItemTrackingClient __all__ = [ 'AccountMyWorkResult', 'AccountRecentActivityWorkItemModel', 'AccountRecentMentionWorkItemModel', 'AccountWorkWorkItemModel', 'ArtifactUriQuery', 'ArtifactUriQueryResult', 'AttachmentReference', 'FieldDependentRule', 'FieldsToEvaluate', 'GraphSubjectBase', 'IdentityRef', 'IdentityReference', 'JsonPatchOperation', 'Link', 'ProjectWorkItemStateColors', 'ProvisioningResult', 'QueryBatchGetRequest', 'QueryHierarchyItem', 'QueryHierarchyItemsResult', 'ReferenceLinks', 'ReportingWorkItemLinksBatch', 'ReportingWorkItemRevisionsBatch', 'ReportingWorkItemRevisionsFilter', 'StreamedBatch', 'TeamContext', 'Wiql', 'WorkArtifactLink', 'WorkItem', 'WorkItemBatchGetRequest', 'WorkItemClassificationNode', 'WorkItemComment', 'WorkItemComments', 'WorkItemDelete', 'WorkItemDeleteReference', 'WorkItemDeleteShallowReference', 'WorkItemDeleteUpdate', 'WorkItemField', 'WorkItemFieldOperation', 'WorkItemFieldReference', 'WorkItemFieldUpdate', 'WorkItemHistory', 'WorkItemIcon', 'WorkItemLink', 'WorkItemNextStateOnTransition', 'WorkItemQueryClause', 'WorkItemQueryResult', 'WorkItemQuerySortColumn', 'WorkItemReference', 'WorkItemRelation', 'WorkItemRelationType', 'WorkItemRelationUpdates', 'WorkItemStateColor', 'WorkItemStateTransition', 'WorkItemTemplate', 'WorkItemTemplateReference', 'WorkItemTrackingReference', 'WorkItemTrackingResource', 'WorkItemTrackingResourceReference', 'WorkItemType', 'WorkItemTypeCategory', 'WorkItemTypeColor', 'WorkItemTypeColorAndIcon', 'WorkItemTypeFieldInstance', 'WorkItemTypeFieldInstanceBase', 'WorkItemTypeFieldWithReferences', 'WorkItemTypeReference', 'WorkItemTypeStateColors', 'WorkItemTypeTemplate', 'WorkItemTypeTemplateUpdateModel', 'WorkItemUpdate', 'WorkItemTrackingClient' ] models.py000066400000000000000000002522301360605530400345210ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AccountMyWorkResult(Model): """AccountMyWorkResult. :param query_size_limit_exceeded: True, when length of WorkItemDetails is same as the limit :type query_size_limit_exceeded: bool :param work_item_details: WorkItem Details :type work_item_details: list of :class:`AccountWorkWorkItemModel ` """ _attribute_map = { 'query_size_limit_exceeded': {'key': 'querySizeLimitExceeded', 'type': 'bool'}, 'work_item_details': {'key': 'workItemDetails', 'type': '[AccountWorkWorkItemModel]'} } def __init__(self, query_size_limit_exceeded=None, work_item_details=None): super(AccountMyWorkResult, self).__init__() self.query_size_limit_exceeded = query_size_limit_exceeded self.work_item_details = work_item_details class AccountRecentActivityWorkItemModel(Model): """AccountRecentActivityWorkItemModel. :param activity_date: Date of the last Activity by the user :type activity_date: datetime :param activity_type: Type of the activity :type activity_type: object :param assigned_to: Assigned To :type assigned_to: str :param changed_date: Last changed date of the work item :type changed_date: datetime :param id: Work Item Id :type id: int :param identity_id: TeamFoundationId of the user this activity belongs to :type identity_id: str :param state: State of the work item :type state: str :param team_project: Team project the work item belongs to :type team_project: str :param title: Title of the work item :type title: str :param work_item_type: Type of Work Item :type work_item_type: str """ _attribute_map = { 'activity_date': {'key': 'activityDate', 'type': 'iso-8601'}, 'activity_type': {'key': 'activityType', 'type': 'object'}, 'assigned_to': {'key': 'assignedTo', 'type': 'str'}, 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'identity_id': {'key': 'identityId', 'type': 'str'}, 'state': {'key': 'state', 'type': 'str'}, 'team_project': {'key': 'teamProject', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'}, 'work_item_type': {'key': 'workItemType', 'type': 'str'} } def __init__(self, activity_date=None, activity_type=None, assigned_to=None, changed_date=None, id=None, identity_id=None, state=None, team_project=None, title=None, work_item_type=None): super(AccountRecentActivityWorkItemModel, self).__init__() self.activity_date = activity_date self.activity_type = activity_type self.assigned_to = assigned_to self.changed_date = changed_date self.id = id self.identity_id = identity_id self.state = state self.team_project = team_project self.title = title self.work_item_type = work_item_type class AccountRecentMentionWorkItemModel(Model): """AccountRecentMentionWorkItemModel. :param assigned_to: Assigned To :type assigned_to: str :param id: Work Item Id :type id: int :param mentioned_date_field: Lastest date that the user were mentioned :type mentioned_date_field: datetime :param state: State of the work item :type state: str :param team_project: Team project the work item belongs to :type team_project: str :param title: Title of the work item :type title: str :param work_item_type: Type of Work Item :type work_item_type: str """ _attribute_map = { 'assigned_to': {'key': 'assignedTo', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'mentioned_date_field': {'key': 'mentionedDateField', 'type': 'iso-8601'}, 'state': {'key': 'state', 'type': 'str'}, 'team_project': {'key': 'teamProject', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'}, 'work_item_type': {'key': 'workItemType', 'type': 'str'} } def __init__(self, assigned_to=None, id=None, mentioned_date_field=None, state=None, team_project=None, title=None, work_item_type=None): super(AccountRecentMentionWorkItemModel, self).__init__() self.assigned_to = assigned_to self.id = id self.mentioned_date_field = mentioned_date_field self.state = state self.team_project = team_project self.title = title self.work_item_type = work_item_type class AccountWorkWorkItemModel(Model): """AccountWorkWorkItemModel. :param assigned_to: :type assigned_to: str :param changed_date: :type changed_date: datetime :param id: :type id: int :param state: :type state: str :param team_project: :type team_project: str :param title: :type title: str :param work_item_type: :type work_item_type: str """ _attribute_map = { 'assigned_to': {'key': 'assignedTo', 'type': 'str'}, 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'state': {'key': 'state', 'type': 'str'}, 'team_project': {'key': 'teamProject', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'}, 'work_item_type': {'key': 'workItemType', 'type': 'str'} } def __init__(self, assigned_to=None, changed_date=None, id=None, state=None, team_project=None, title=None, work_item_type=None): super(AccountWorkWorkItemModel, self).__init__() self.assigned_to = assigned_to self.changed_date = changed_date self.id = id self.state = state self.team_project = team_project self.title = title self.work_item_type = work_item_type class ArtifactUriQuery(Model): """ArtifactUriQuery. :param artifact_uris: List of artifact URIs to use for querying work items. :type artifact_uris: list of str """ _attribute_map = { 'artifact_uris': {'key': 'artifactUris', 'type': '[str]'} } def __init__(self, artifact_uris=None): super(ArtifactUriQuery, self).__init__() self.artifact_uris = artifact_uris class ArtifactUriQueryResult(Model): """ArtifactUriQueryResult. :param artifact_uris_query_result: A Dictionary that maps a list of work item references to the given list of artifact URI. :type artifact_uris_query_result: dict """ _attribute_map = { 'artifact_uris_query_result': {'key': 'artifactUrisQueryResult', 'type': '{[WorkItemReference]}'} } def __init__(self, artifact_uris_query_result=None): super(ArtifactUriQueryResult, self).__init__() self.artifact_uris_query_result = artifact_uris_query_result class AttachmentReference(Model): """AttachmentReference. :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(AttachmentReference, self).__init__() self.id = id self.url = url class FieldsToEvaluate(Model): """FieldsToEvaluate. :param fields: List of fields to evaluate. :type fields: list of str :param field_updates: Updated field values to evaluate. :type field_updates: dict :param field_values: Initial field values. :type field_values: dict :param rules_from: URL of the work item type for which the rules need to be executed. :type rules_from: list of str """ _attribute_map = { 'fields': {'key': 'fields', 'type': '[str]'}, 'field_updates': {'key': 'fieldUpdates', 'type': '{object}'}, 'field_values': {'key': 'fieldValues', 'type': '{object}'}, 'rules_from': {'key': 'rulesFrom', 'type': '[str]'} } def __init__(self, fields=None, field_updates=None, field_values=None, rules_from=None): super(FieldsToEvaluate, self).__init__() self.fields = fields self.field_updates = field_updates self.field_values = field_values self.rules_from = rules_from class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param id: :type id: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class IdentityReference(IdentityRef): """IdentityReference. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: :type directory_alias: str :param image_url: :type image_url: str :param inactive: :type inactive: bool :param is_aad_identity: :type is_aad_identity: bool :param is_container: :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: :type profile_url: str :param unique_name: :type unique_name: str :param id: :type id: str :param name: Legacy back-compat property. This has been the WIT specific value from Constants. Will be hidden (but exists) on the client unless they are targeting the newest version :type name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None, id=None, name=None): super(IdentityReference, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url, directory_alias=directory_alias, image_url=image_url, inactive=inactive, is_aad_identity=is_aad_identity, is_container=is_container, is_deleted_in_origin=is_deleted_in_origin, profile_url=profile_url, unique_name=unique_name) self.id = id self.name = name class JsonPatchOperation(Model): """JsonPatchOperation. :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class Link(Model): """Link. :param attributes: Collection of link attributes. :type attributes: dict :param rel: Relation type. :type rel: str :param url: Link url. :type url: str """ _attribute_map = { 'attributes': {'key': 'attributes', 'type': '{object}'}, 'rel': {'key': 'rel', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, attributes=None, rel=None, url=None): super(Link, self).__init__() self.attributes = attributes self.rel = rel self.url = url class ProjectWorkItemStateColors(Model): """ProjectWorkItemStateColors. :param project_name: Project name :type project_name: str :param work_item_type_state_colors: State colors for all work item type in a project :type work_item_type_state_colors: list of :class:`WorkItemTypeStateColors ` """ _attribute_map = { 'project_name': {'key': 'projectName', 'type': 'str'}, 'work_item_type_state_colors': {'key': 'workItemTypeStateColors', 'type': '[WorkItemTypeStateColors]'} } def __init__(self, project_name=None, work_item_type_state_colors=None): super(ProjectWorkItemStateColors, self).__init__() self.project_name = project_name self.work_item_type_state_colors = work_item_type_state_colors class ProvisioningResult(Model): """ProvisioningResult. :param provisioning_import_events: Details about of the provisioning import events. :type provisioning_import_events: list of str """ _attribute_map = { 'provisioning_import_events': {'key': 'provisioningImportEvents', 'type': '[str]'} } def __init__(self, provisioning_import_events=None): super(ProvisioningResult, self).__init__() self.provisioning_import_events = provisioning_import_events class QueryBatchGetRequest(Model): """QueryBatchGetRequest. :param expand: The expand parameters for queries. Possible options are { None, Wiql, Clauses, All, Minimal } :type expand: object :param error_policy: The flag to control error policy in a query batch request. Possible options are { Fail, Omit }. :type error_policy: object :param ids: The requested query ids :type ids: list of str """ _attribute_map = { 'expand': {'key': '$expand', 'type': 'object'}, 'error_policy': {'key': 'errorPolicy', 'type': 'object'}, 'ids': {'key': 'ids', 'type': '[str]'} } def __init__(self, expand=None, error_policy=None, ids=None): super(QueryBatchGetRequest, self).__init__() self.expand = expand self.error_policy = error_policy self.ids = ids class QueryHierarchyItemsResult(Model): """QueryHierarchyItemsResult. :param count: The count of items. :type count: int :param has_more: Indicates if the max return limit was hit but there are still more items :type has_more: bool :param value: The list of items :type value: list of :class:`QueryHierarchyItem ` """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'has_more': {'key': 'hasMore', 'type': 'bool'}, 'value': {'key': 'value', 'type': '[QueryHierarchyItem]'} } def __init__(self, count=None, has_more=None, value=None): super(QueryHierarchyItemsResult, self).__init__() self.count = count self.has_more = has_more self.value = value class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class ReportingWorkItemRevisionsFilter(Model): """ReportingWorkItemRevisionsFilter. :param fields: A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. :type fields: list of str :param include_deleted: Include deleted work item in the result. :type include_deleted: bool :param include_identity_ref: Return an identity reference instead of a string value for identity fields. :type include_identity_ref: bool :param include_latest_only: Include only the latest version of a work item, skipping over all previous revisions of the work item. :type include_latest_only: bool :param include_tag_ref: Include tag reference instead of string value for System.Tags field :type include_tag_ref: bool :param types: A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. :type types: list of str """ _attribute_map = { 'fields': {'key': 'fields', 'type': '[str]'}, 'include_deleted': {'key': 'includeDeleted', 'type': 'bool'}, 'include_identity_ref': {'key': 'includeIdentityRef', 'type': 'bool'}, 'include_latest_only': {'key': 'includeLatestOnly', 'type': 'bool'}, 'include_tag_ref': {'key': 'includeTagRef', 'type': 'bool'}, 'types': {'key': 'types', 'type': '[str]'} } def __init__(self, fields=None, include_deleted=None, include_identity_ref=None, include_latest_only=None, include_tag_ref=None, types=None): super(ReportingWorkItemRevisionsFilter, self).__init__() self.fields = fields self.include_deleted = include_deleted self.include_identity_ref = include_identity_ref self.include_latest_only = include_latest_only self.include_tag_ref = include_tag_ref self.types = types class StreamedBatch(Model): """StreamedBatch. :param continuation_token: :type continuation_token: str :param is_last_batch: :type is_last_batch: bool :param next_link: :type next_link: str :param values: :type values: list of object """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, 'is_last_batch': {'key': 'isLastBatch', 'type': 'bool'}, 'next_link': {'key': 'nextLink', 'type': 'str'}, 'values': {'key': 'values', 'type': '[object]'} } def __init__(self, continuation_token=None, is_last_batch=None, next_link=None, values=None): super(StreamedBatch, self).__init__() self.continuation_token = continuation_token self.is_last_batch = is_last_batch self.next_link = next_link self.values = values class TeamContext(Model): """TeamContext. :param project: The team project Id or name. Ignored if ProjectId is set. :type project: str :param project_id: The Team Project ID. Required if Project is not set. :type project_id: str :param team: The Team Id or name. Ignored if TeamId is set. :type team: str :param team_id: The Team Id :type team_id: str """ _attribute_map = { 'project': {'key': 'project', 'type': 'str'}, 'project_id': {'key': 'projectId', 'type': 'str'}, 'team': {'key': 'team', 'type': 'str'}, 'team_id': {'key': 'teamId', 'type': 'str'} } def __init__(self, project=None, project_id=None, team=None, team_id=None): super(TeamContext, self).__init__() self.project = project self.project_id = project_id self.team = team self.team_id = team_id class Wiql(Model): """Wiql. :param query: The text of the WIQL query :type query: str """ _attribute_map = { 'query': {'key': 'query', 'type': 'str'} } def __init__(self, query=None): super(Wiql, self).__init__() self.query = query class WorkArtifactLink(Model): """WorkArtifactLink. :param artifact_type: Target artifact type. :type artifact_type: str :param link_type: Outbound link type. :type link_type: str :param tool_type: Target tool type. :type tool_type: str """ _attribute_map = { 'artifact_type': {'key': 'artifactType', 'type': 'str'}, 'link_type': {'key': 'linkType', 'type': 'str'}, 'tool_type': {'key': 'toolType', 'type': 'str'} } def __init__(self, artifact_type=None, link_type=None, tool_type=None): super(WorkArtifactLink, self).__init__() self.artifact_type = artifact_type self.link_type = link_type self.tool_type = tool_type class WorkItemBatchGetRequest(Model): """WorkItemBatchGetRequest. :param expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All } :type expand: object :param as_of: AsOf UTC date time string :type as_of: datetime :param error_policy: The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}. :type error_policy: object :param fields: The requested fields :type fields: list of str :param ids: The requested work item ids :type ids: list of int """ _attribute_map = { 'expand': {'key': '$expand', 'type': 'object'}, 'as_of': {'key': 'asOf', 'type': 'iso-8601'}, 'error_policy': {'key': 'errorPolicy', 'type': 'object'}, 'fields': {'key': 'fields', 'type': '[str]'}, 'ids': {'key': 'ids', 'type': '[int]'} } def __init__(self, expand=None, as_of=None, error_policy=None, fields=None, ids=None): super(WorkItemBatchGetRequest, self).__init__() self.expand = expand self.as_of = as_of self.error_policy = error_policy self.fields = fields self.ids = ids class WorkItemDeleteReference(Model): """WorkItemDeleteReference. :param code: The HTTP status code for work item operation in a batch request. :type code: int :param deleted_by: The user who deleted the work item type. :type deleted_by: str :param deleted_date: The work item deletion date. :type deleted_date: str :param id: Work item ID. :type id: int :param message: The exception message for work item operation in a batch request. :type message: str :param name: Name or title of the work item. :type name: str :param project: Parent project of the deleted work item. :type project: str :param type: Type of work item. :type type: str :param url: REST API URL of the resource :type url: str """ _attribute_map = { 'code': {'key': 'code', 'type': 'int'}, 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, 'deleted_date': {'key': 'deletedDate', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'message': {'key': 'message', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'project': {'key': 'project', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, code=None, deleted_by=None, deleted_date=None, id=None, message=None, name=None, project=None, type=None, url=None): super(WorkItemDeleteReference, self).__init__() self.code = code self.deleted_by = deleted_by self.deleted_date = deleted_date self.id = id self.message = message self.name = name self.project = project self.type = type self.url = url class WorkItemDeleteShallowReference(Model): """WorkItemDeleteShallowReference. :param id: Work item ID. :type id: int :param url: REST API URL of the resource :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(WorkItemDeleteShallowReference, self).__init__() self.id = id self.url = url class WorkItemDeleteUpdate(Model): """WorkItemDeleteUpdate. :param is_deleted: Sets a value indicating whether this work item is deleted. :type is_deleted: bool """ _attribute_map = { 'is_deleted': {'key': 'isDeleted', 'type': 'bool'} } def __init__(self, is_deleted=None): super(WorkItemDeleteUpdate, self).__init__() self.is_deleted = is_deleted class WorkItemFieldOperation(Model): """WorkItemFieldOperation. :param name: Name of the operation. :type name: str :param reference_name: Reference name of the operation. :type reference_name: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'} } def __init__(self, name=None, reference_name=None): super(WorkItemFieldOperation, self).__init__() self.name = name self.reference_name = reference_name class WorkItemFieldReference(Model): """WorkItemFieldReference. :param name: The name of the field. :type name: str :param reference_name: The reference name of the field. :type reference_name: str :param url: The REST URL of the resource. :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, reference_name=None, url=None): super(WorkItemFieldReference, self).__init__() self.name = name self.reference_name = reference_name self.url = url class WorkItemFieldUpdate(Model): """WorkItemFieldUpdate. :param new_value: The new value of the field. :type new_value: object :param old_value: The old value of the field. :type old_value: object """ _attribute_map = { 'new_value': {'key': 'newValue', 'type': 'object'}, 'old_value': {'key': 'oldValue', 'type': 'object'} } def __init__(self, new_value=None, old_value=None): super(WorkItemFieldUpdate, self).__init__() self.new_value = new_value self.old_value = old_value class WorkItemIcon(Model): """WorkItemIcon. :param id: The identifier of the icon. :type id: str :param url: The REST URL of the resource. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(WorkItemIcon, self).__init__() self.id = id self.url = url class WorkItemLink(Model): """WorkItemLink. :param rel: The type of link. :type rel: str :param source: The source work item. :type source: :class:`WorkItemReference ` :param target: The target work item. :type target: :class:`WorkItemReference ` """ _attribute_map = { 'rel': {'key': 'rel', 'type': 'str'}, 'source': {'key': 'source', 'type': 'WorkItemReference'}, 'target': {'key': 'target', 'type': 'WorkItemReference'} } def __init__(self, rel=None, source=None, target=None): super(WorkItemLink, self).__init__() self.rel = rel self.source = source self.target = target class WorkItemNextStateOnTransition(Model): """WorkItemNextStateOnTransition. :param error_code: Error code if there is no next state transition possible. :type error_code: str :param id: Work item ID. :type id: int :param message: Error message if there is no next state transition possible. :type message: str :param state_on_transition: Name of the next state on transition. :type state_on_transition: str """ _attribute_map = { 'error_code': {'key': 'errorCode', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'message': {'key': 'message', 'type': 'str'}, 'state_on_transition': {'key': 'stateOnTransition', 'type': 'str'} } def __init__(self, error_code=None, id=None, message=None, state_on_transition=None): super(WorkItemNextStateOnTransition, self).__init__() self.error_code = error_code self.id = id self.message = message self.state_on_transition = state_on_transition class WorkItemQueryClause(Model): """WorkItemQueryClause. :param clauses: Child clauses if the current clause is a logical operator :type clauses: list of :class:`WorkItemQueryClause ` :param field: Field associated with condition :type field: :class:`WorkItemFieldReference ` :param field_value: Right side of the condition when a field to field comparison :type field_value: :class:`WorkItemFieldReference ` :param is_field_value: Determines if this is a field to field comparison :type is_field_value: bool :param logical_operator: Logical operator separating the condition clause :type logical_operator: object :param operator: The field operator :type operator: :class:`WorkItemFieldOperation ` :param value: Right side of the condition when a field to value comparison :type value: str """ _attribute_map = { 'clauses': {'key': 'clauses', 'type': '[WorkItemQueryClause]'}, 'field': {'key': 'field', 'type': 'WorkItemFieldReference'}, 'field_value': {'key': 'fieldValue', 'type': 'WorkItemFieldReference'}, 'is_field_value': {'key': 'isFieldValue', 'type': 'bool'}, 'logical_operator': {'key': 'logicalOperator', 'type': 'object'}, 'operator': {'key': 'operator', 'type': 'WorkItemFieldOperation'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, clauses=None, field=None, field_value=None, is_field_value=None, logical_operator=None, operator=None, value=None): super(WorkItemQueryClause, self).__init__() self.clauses = clauses self.field = field self.field_value = field_value self.is_field_value = is_field_value self.logical_operator = logical_operator self.operator = operator self.value = value class WorkItemQueryResult(Model): """WorkItemQueryResult. :param as_of: The date the query was run in the context of. :type as_of: datetime :param columns: The columns of the query. :type columns: list of :class:`WorkItemFieldReference ` :param query_result_type: The result type :type query_result_type: object :param query_type: The type of the query :type query_type: object :param sort_columns: The sort columns of the query. :type sort_columns: list of :class:`WorkItemQuerySortColumn ` :param work_item_relations: The work item links returned by the query. :type work_item_relations: list of :class:`WorkItemLink ` :param work_items: The work items returned by the query. :type work_items: list of :class:`WorkItemReference ` """ _attribute_map = { 'as_of': {'key': 'asOf', 'type': 'iso-8601'}, 'columns': {'key': 'columns', 'type': '[WorkItemFieldReference]'}, 'query_result_type': {'key': 'queryResultType', 'type': 'object'}, 'query_type': {'key': 'queryType', 'type': 'object'}, 'sort_columns': {'key': 'sortColumns', 'type': '[WorkItemQuerySortColumn]'}, 'work_item_relations': {'key': 'workItemRelations', 'type': '[WorkItemLink]'}, 'work_items': {'key': 'workItems', 'type': '[WorkItemReference]'} } def __init__(self, as_of=None, columns=None, query_result_type=None, query_type=None, sort_columns=None, work_item_relations=None, work_items=None): super(WorkItemQueryResult, self).__init__() self.as_of = as_of self.columns = columns self.query_result_type = query_result_type self.query_type = query_type self.sort_columns = sort_columns self.work_item_relations = work_item_relations self.work_items = work_items class WorkItemQuerySortColumn(Model): """WorkItemQuerySortColumn. :param descending: The direction to sort by. :type descending: bool :param field: A work item field. :type field: :class:`WorkItemFieldReference ` """ _attribute_map = { 'descending': {'key': 'descending', 'type': 'bool'}, 'field': {'key': 'field', 'type': 'WorkItemFieldReference'} } def __init__(self, descending=None, field=None): super(WorkItemQuerySortColumn, self).__init__() self.descending = descending self.field = field class WorkItemReference(Model): """WorkItemReference. :param id: Work item ID. :type id: int :param url: REST API URL of the resource :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(WorkItemReference, self).__init__() self.id = id self.url = url class WorkItemRelation(Link): """WorkItemRelation. :param attributes: Collection of link attributes. :type attributes: dict :param rel: Relation type. :type rel: str :param url: Link url. :type url: str """ _attribute_map = { 'attributes': {'key': 'attributes', 'type': '{object}'}, 'rel': {'key': 'rel', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, } def __init__(self, attributes=None, rel=None, url=None): super(WorkItemRelation, self).__init__(attributes=attributes, rel=rel, url=url) class WorkItemRelationUpdates(Model): """WorkItemRelationUpdates. :param added: List of newly added relations. :type added: list of :class:`WorkItemRelation ` :param removed: List of removed relations. :type removed: list of :class:`WorkItemRelation ` :param updated: List of updated relations. :type updated: list of :class:`WorkItemRelation ` """ _attribute_map = { 'added': {'key': 'added', 'type': '[WorkItemRelation]'}, 'removed': {'key': 'removed', 'type': '[WorkItemRelation]'}, 'updated': {'key': 'updated', 'type': '[WorkItemRelation]'} } def __init__(self, added=None, removed=None, updated=None): super(WorkItemRelationUpdates, self).__init__() self.added = added self.removed = removed self.updated = updated class WorkItemStateColor(Model): """WorkItemStateColor. :param category: Category of state :type category: str :param color: Color value :type color: str :param name: Work item type state name :type name: str """ _attribute_map = { 'category': {'key': 'category', 'type': 'str'}, 'color': {'key': 'color', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, category=None, color=None, name=None): super(WorkItemStateColor, self).__init__() self.category = category self.color = color self.name = name class WorkItemStateTransition(Model): """WorkItemStateTransition. :param actions: Gets a list of actions needed to transition to that state. :type actions: list of str :param to: Name of the next state. :type to: str """ _attribute_map = { 'actions': {'key': 'actions', 'type': '[str]'}, 'to': {'key': 'to', 'type': 'str'} } def __init__(self, actions=None, to=None): super(WorkItemStateTransition, self).__init__() self.actions = actions self.to = to class WorkItemTrackingResourceReference(Model): """WorkItemTrackingResourceReference. :param url: :type url: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'} } def __init__(self, url=None): super(WorkItemTrackingResourceReference, self).__init__() self.url = url class WorkItemTypeColor(Model): """WorkItemTypeColor. :param primary_color: Gets or sets the color of the primary. :type primary_color: str :param secondary_color: Gets or sets the color of the secondary. :type secondary_color: str :param work_item_type_name: The name of the work item type. :type work_item_type_name: str """ _attribute_map = { 'primary_color': {'key': 'primaryColor', 'type': 'str'}, 'secondary_color': {'key': 'secondaryColor', 'type': 'str'}, 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'} } def __init__(self, primary_color=None, secondary_color=None, work_item_type_name=None): super(WorkItemTypeColor, self).__init__() self.primary_color = primary_color self.secondary_color = secondary_color self.work_item_type_name = work_item_type_name class WorkItemTypeColorAndIcon(Model): """WorkItemTypeColorAndIcon. :param color: The color of the work item type in hex format. :type color: str :param icon: Tthe work item type icon. :type icon: str :param work_item_type_name: The name of the work item type. :type work_item_type_name: str """ _attribute_map = { 'color': {'key': 'color', 'type': 'str'}, 'icon': {'key': 'icon', 'type': 'str'}, 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'} } def __init__(self, color=None, icon=None, work_item_type_name=None): super(WorkItemTypeColorAndIcon, self).__init__() self.color = color self.icon = icon self.work_item_type_name = work_item_type_name class WorkItemTypeFieldInstanceBase(WorkItemFieldReference): """WorkItemTypeFieldInstanceBase. :param name: The name of the field. :type name: str :param reference_name: The reference name of the field. :type reference_name: str :param url: The REST URL of the resource. :type url: str :param always_required: Indicates whether field value is always required. :type always_required: bool :param dependent_fields: The list of dependent fields. :type dependent_fields: list of :class:`WorkItemFieldReference ` :param help_text: Gets the help text for the field. :type help_text: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'always_required': {'key': 'alwaysRequired', 'type': 'bool'}, 'dependent_fields': {'key': 'dependentFields', 'type': '[WorkItemFieldReference]'}, 'help_text': {'key': 'helpText', 'type': 'str'} } def __init__(self, name=None, reference_name=None, url=None, always_required=None, dependent_fields=None, help_text=None): super(WorkItemTypeFieldInstanceBase, self).__init__(name=name, reference_name=reference_name, url=url) self.always_required = always_required self.dependent_fields = dependent_fields self.help_text = help_text class WorkItemTypeFieldWithReferences(WorkItemTypeFieldInstanceBase): """WorkItemTypeFieldWithReferences. :param name: The name of the field. :type name: str :param reference_name: The reference name of the field. :type reference_name: str :param url: The REST URL of the resource. :type url: str :param always_required: Indicates whether field value is always required. :type always_required: bool :param dependent_fields: The list of dependent fields. :type dependent_fields: list of :class:`WorkItemFieldReference ` :param help_text: Gets the help text for the field. :type help_text: str :param allowed_values: The list of field allowed values. :type allowed_values: list of object :param default_value: Represents the default value of the field. :type default_value: object """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'always_required': {'key': 'alwaysRequired', 'type': 'bool'}, 'dependent_fields': {'key': 'dependentFields', 'type': '[WorkItemFieldReference]'}, 'help_text': {'key': 'helpText', 'type': 'str'}, 'allowed_values': {'key': 'allowedValues', 'type': '[object]'}, 'default_value': {'key': 'defaultValue', 'type': 'object'} } def __init__(self, name=None, reference_name=None, url=None, always_required=None, dependent_fields=None, help_text=None, allowed_values=None, default_value=None): super(WorkItemTypeFieldWithReferences, self).__init__(name=name, reference_name=reference_name, url=url, always_required=always_required, dependent_fields=dependent_fields, help_text=help_text) self.allowed_values = allowed_values self.default_value = default_value class WorkItemTypeReference(WorkItemTrackingResourceReference): """WorkItemTypeReference. :param url: :type url: str :param name: Name of the work item type. :type name: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, url=None, name=None): super(WorkItemTypeReference, self).__init__(url=url) self.name = name class WorkItemTypeStateColors(Model): """WorkItemTypeStateColors. :param state_colors: Work item type state colors :type state_colors: list of :class:`WorkItemStateColor ` :param work_item_type_name: Work item type name :type work_item_type_name: str """ _attribute_map = { 'state_colors': {'key': 'stateColors', 'type': '[WorkItemStateColor]'}, 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'} } def __init__(self, state_colors=None, work_item_type_name=None): super(WorkItemTypeStateColors, self).__init__() self.state_colors = state_colors self.work_item_type_name = work_item_type_name class WorkItemTypeTemplate(Model): """WorkItemTypeTemplate. :param template: XML template in string format. :type template: str """ _attribute_map = { 'template': {'key': 'template', 'type': 'str'} } def __init__(self, template=None): super(WorkItemTypeTemplate, self).__init__() self.template = template class WorkItemTypeTemplateUpdateModel(Model): """WorkItemTypeTemplateUpdateModel. :param action_type: Describes the type of the action for the update request. :type action_type: object :param methodology: Methodology to which the template belongs, eg. Agile, Scrum, CMMI. :type methodology: str :param template: String representation of the work item type template. :type template: str :param template_type: The type of the template described in the request body. :type template_type: object """ _attribute_map = { 'action_type': {'key': 'actionType', 'type': 'object'}, 'methodology': {'key': 'methodology', 'type': 'str'}, 'template': {'key': 'template', 'type': 'str'}, 'template_type': {'key': 'templateType', 'type': 'object'} } def __init__(self, action_type=None, methodology=None, template=None, template_type=None): super(WorkItemTypeTemplateUpdateModel, self).__init__() self.action_type = action_type self.methodology = methodology self.template = template self.template_type = template_type class ReportingWorkItemLinksBatch(StreamedBatch): """ReportingWorkItemLinksBatch. """ _attribute_map = { } def __init__(self): super(ReportingWorkItemLinksBatch, self).__init__() class ReportingWorkItemRevisionsBatch(StreamedBatch): """ReportingWorkItemRevisionsBatch. """ _attribute_map = { } def __init__(self): super(ReportingWorkItemRevisionsBatch, self).__init__() class WorkItemDelete(WorkItemDeleteReference): """WorkItemDelete. :param code: The HTTP status code for work item operation in a batch request. :type code: int :param deleted_by: The user who deleted the work item type. :type deleted_by: str :param deleted_date: The work item deletion date. :type deleted_date: str :param id: Work item ID. :type id: int :param message: The exception message for work item operation in a batch request. :type message: str :param name: Name or title of the work item. :type name: str :param project: Parent project of the deleted work item. :type project: str :param type: Type of work item. :type type: str :param url: REST API URL of the resource :type url: str :param resource: The work item object that was deleted. :type resource: :class:`WorkItem ` """ _attribute_map = { 'code': {'key': 'code', 'type': 'int'}, 'deleted_by': {'key': 'deletedBy', 'type': 'str'}, 'deleted_date': {'key': 'deletedDate', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'message': {'key': 'message', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'project': {'key': 'project', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'WorkItem'} } def __init__(self, code=None, deleted_by=None, deleted_date=None, id=None, message=None, name=None, project=None, type=None, url=None, resource=None): super(WorkItemDelete, self).__init__(code=code, deleted_by=deleted_by, deleted_date=deleted_date, id=id, message=message, name=name, project=project, type=type, url=url) self.resource = resource class WorkItemTrackingResource(WorkItemTrackingResourceReference): """WorkItemTrackingResource. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'} } def __init__(self, url=None, _links=None): super(WorkItemTrackingResource, self).__init__(url=url) self._links = _links class WorkItemType(WorkItemTrackingResource): """WorkItemType. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param color: The color. :type color: str :param description: The description of the work item type. :type description: str :param field_instances: The fields that exist on the work item type. :type field_instances: list of :class:`WorkItemTypeFieldInstance ` :param fields: The fields that exist on the work item type. :type fields: list of :class:`WorkItemTypeFieldInstance ` :param icon: The icon of the work item type. :type icon: :class:`WorkItemIcon ` :param is_disabled: True if work item type is disabled :type is_disabled: bool :param name: Gets the name of the work item type. :type name: str :param reference_name: The reference name of the work item type. :type reference_name: str :param states: Gets state information for the work item type. :type states: list of :class:`WorkItemStateColor ` :param transitions: Gets the various state transition mappings in the work item type. :type transitions: dict :param xml_form: The XML form. :type xml_form: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'color': {'key': 'color', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'field_instances': {'key': 'fieldInstances', 'type': '[WorkItemTypeFieldInstance]'}, 'fields': {'key': 'fields', 'type': '[WorkItemTypeFieldInstance]'}, 'icon': {'key': 'icon', 'type': 'WorkItemIcon'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'states': {'key': 'states', 'type': '[WorkItemStateColor]'}, 'transitions': {'key': 'transitions', 'type': '{[WorkItemStateTransition]}'}, 'xml_form': {'key': 'xmlForm', 'type': 'str'} } def __init__(self, url=None, _links=None, color=None, description=None, field_instances=None, fields=None, icon=None, is_disabled=None, name=None, reference_name=None, states=None, transitions=None, xml_form=None): super(WorkItemType, self).__init__(url=url, _links=_links) self.color = color self.description = description self.field_instances = field_instances self.fields = fields self.icon = icon self.is_disabled = is_disabled self.name = name self.reference_name = reference_name self.states = states self.transitions = transitions self.xml_form = xml_form class WorkItemTypeCategory(WorkItemTrackingResource): """WorkItemTypeCategory. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param default_work_item_type: Gets or sets the default type of the work item. :type default_work_item_type: :class:`WorkItemTypeReference ` :param name: The name of the category. :type name: str :param reference_name: The reference name of the category. :type reference_name: str :param work_item_types: The work item types that belond to the category. :type work_item_types: list of :class:`WorkItemTypeReference ` """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'default_work_item_type': {'key': 'defaultWorkItemType', 'type': 'WorkItemTypeReference'}, 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'work_item_types': {'key': 'workItemTypes', 'type': '[WorkItemTypeReference]'} } def __init__(self, url=None, _links=None, default_work_item_type=None, name=None, reference_name=None, work_item_types=None): super(WorkItemTypeCategory, self).__init__(url=url, _links=_links) self.default_work_item_type = default_work_item_type self.name = name self.reference_name = reference_name self.work_item_types = work_item_types class WorkItemTypeFieldInstance(WorkItemTypeFieldInstanceBase): """WorkItemTypeFieldInstance. :param name: The name of the field. :type name: str :param reference_name: The reference name of the field. :type reference_name: str :param url: The REST URL of the resource. :type url: str :param always_required: Indicates whether field value is always required. :type always_required: bool :param dependent_fields: The list of dependent fields. :type dependent_fields: list of :class:`WorkItemFieldReference ` :param help_text: Gets the help text for the field. :type help_text: str :param allowed_values: The list of field allowed values. :type allowed_values: list of str :param default_value: Represents the default value of the field. :type default_value: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'always_required': {'key': 'alwaysRequired', 'type': 'bool'}, 'dependent_fields': {'key': 'dependentFields', 'type': '[WorkItemFieldReference]'}, 'help_text': {'key': 'helpText', 'type': 'str'}, 'allowed_values': {'key': 'allowedValues', 'type': '[str]'}, 'default_value': {'key': 'defaultValue', 'type': 'str'} } def __init__(self, name=None, reference_name=None, url=None, always_required=None, dependent_fields=None, help_text=None, allowed_values=None, default_value=None): super(WorkItemTypeFieldInstance, self).__init__(name=name, reference_name=reference_name, url=url, always_required=always_required, dependent_fields=dependent_fields, help_text=help_text) self.allowed_values = allowed_values self.default_value = default_value class WorkItemUpdate(WorkItemTrackingResource): """WorkItemUpdate. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param fields: List of updates to fields. :type fields: dict :param id: ID of update. :type id: int :param relations: List of updates to relations. :type relations: :class:`WorkItemRelationUpdates ` :param rev: The revision number of work item update. :type rev: int :param revised_by: Identity for the work item update. :type revised_by: :class:`IdentityReference ` :param revised_date: The work item updates revision date. :type revised_date: datetime :param work_item_id: The work item ID. :type work_item_id: int """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'fields': {'key': 'fields', 'type': '{WorkItemFieldUpdate}'}, 'id': {'key': 'id', 'type': 'int'}, 'relations': {'key': 'relations', 'type': 'WorkItemRelationUpdates'}, 'rev': {'key': 'rev', 'type': 'int'}, 'revised_by': {'key': 'revisedBy', 'type': 'IdentityReference'}, 'revised_date': {'key': 'revisedDate', 'type': 'iso-8601'}, 'work_item_id': {'key': 'workItemId', 'type': 'int'} } def __init__(self, url=None, _links=None, fields=None, id=None, relations=None, rev=None, revised_by=None, revised_date=None, work_item_id=None): super(WorkItemUpdate, self).__init__(url=url, _links=_links) self.fields = fields self.id = id self.relations = relations self.rev = rev self.revised_by = revised_by self.revised_date = revised_date self.work_item_id = work_item_id class FieldDependentRule(WorkItemTrackingResource): """FieldDependentRule. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param dependent_fields: The dependent fields. :type dependent_fields: list of :class:`WorkItemFieldReference ` """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'dependent_fields': {'key': 'dependentFields', 'type': '[WorkItemFieldReference]'} } def __init__(self, url=None, _links=None, dependent_fields=None): super(FieldDependentRule, self).__init__(url=url, _links=_links) self.dependent_fields = dependent_fields class QueryHierarchyItem(WorkItemTrackingResource): """QueryHierarchyItem. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param children: The child query items inside a query folder. :type children: list of :class:`QueryHierarchyItem ` :param clauses: The clauses for a flat query. :type clauses: :class:`WorkItemQueryClause ` :param columns: The columns of the query. :type columns: list of :class:`WorkItemFieldReference ` :param created_by: The identity who created the query item. :type created_by: :class:`IdentityReference ` :param created_date: When the query item was created. :type created_date: datetime :param filter_options: The link query mode. :type filter_options: object :param has_children: If this is a query folder, indicates if it contains any children. :type has_children: bool :param id: The id of the query item. :type id: str :param is_deleted: Indicates if this query item is deleted. Setting this to false on a deleted query item will undelete it. Undeleting a query or folder will not bring back the permission changes that were previously applied to it. :type is_deleted: bool :param is_folder: Indicates if this is a query folder or a query. :type is_folder: bool :param is_invalid_syntax: Indicates if the WIQL of this query is invalid. This could be due to invalid syntax or a no longer valid area/iteration path. :type is_invalid_syntax: bool :param is_public: Indicates if this query item is public or private. :type is_public: bool :param last_executed_by: The identity who last ran the query. :type last_executed_by: :class:`IdentityReference ` :param last_executed_date: When the query was last run. :type last_executed_date: datetime :param last_modified_by: The identity who last modified the query item. :type last_modified_by: :class:`IdentityReference ` :param last_modified_date: When the query item was last modified. :type last_modified_date: datetime :param link_clauses: The link query clause. :type link_clauses: :class:`WorkItemQueryClause ` :param name: The name of the query item. :type name: str :param path: The path of the query item. :type path: str :param query_recursion_option: The recursion option for use in a tree query. :type query_recursion_option: object :param query_type: The type of query. :type query_type: object :param sort_columns: The sort columns of the query. :type sort_columns: list of :class:`WorkItemQuerySortColumn ` :param source_clauses: The source clauses in a tree or one-hop link query. :type source_clauses: :class:`WorkItemQueryClause ` :param target_clauses: The target clauses in a tree or one-hop link query. :type target_clauses: :class:`WorkItemQueryClause ` :param wiql: The WIQL text of the query :type wiql: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'children': {'key': 'children', 'type': '[QueryHierarchyItem]'}, 'clauses': {'key': 'clauses', 'type': 'WorkItemQueryClause'}, 'columns': {'key': 'columns', 'type': '[WorkItemFieldReference]'}, 'created_by': {'key': 'createdBy', 'type': 'IdentityReference'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'filter_options': {'key': 'filterOptions', 'type': 'object'}, 'has_children': {'key': 'hasChildren', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'is_deleted': {'key': 'isDeleted', 'type': 'bool'}, 'is_folder': {'key': 'isFolder', 'type': 'bool'}, 'is_invalid_syntax': {'key': 'isInvalidSyntax', 'type': 'bool'}, 'is_public': {'key': 'isPublic', 'type': 'bool'}, 'last_executed_by': {'key': 'lastExecutedBy', 'type': 'IdentityReference'}, 'last_executed_date': {'key': 'lastExecutedDate', 'type': 'iso-8601'}, 'last_modified_by': {'key': 'lastModifiedBy', 'type': 'IdentityReference'}, 'last_modified_date': {'key': 'lastModifiedDate', 'type': 'iso-8601'}, 'link_clauses': {'key': 'linkClauses', 'type': 'WorkItemQueryClause'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'query_recursion_option': {'key': 'queryRecursionOption', 'type': 'object'}, 'query_type': {'key': 'queryType', 'type': 'object'}, 'sort_columns': {'key': 'sortColumns', 'type': '[WorkItemQuerySortColumn]'}, 'source_clauses': {'key': 'sourceClauses', 'type': 'WorkItemQueryClause'}, 'target_clauses': {'key': 'targetClauses', 'type': 'WorkItemQueryClause'}, 'wiql': {'key': 'wiql', 'type': 'str'} } def __init__(self, url=None, _links=None, children=None, clauses=None, columns=None, created_by=None, created_date=None, filter_options=None, has_children=None, id=None, is_deleted=None, is_folder=None, is_invalid_syntax=None, is_public=None, last_executed_by=None, last_executed_date=None, last_modified_by=None, last_modified_date=None, link_clauses=None, name=None, path=None, query_recursion_option=None, query_type=None, sort_columns=None, source_clauses=None, target_clauses=None, wiql=None): super(QueryHierarchyItem, self).__init__(url=url, _links=_links) self.children = children self.clauses = clauses self.columns = columns self.created_by = created_by self.created_date = created_date self.filter_options = filter_options self.has_children = has_children self.id = id self.is_deleted = is_deleted self.is_folder = is_folder self.is_invalid_syntax = is_invalid_syntax self.is_public = is_public self.last_executed_by = last_executed_by self.last_executed_date = last_executed_date self.last_modified_by = last_modified_by self.last_modified_date = last_modified_date self.link_clauses = link_clauses self.name = name self.path = path self.query_recursion_option = query_recursion_option self.query_type = query_type self.sort_columns = sort_columns self.source_clauses = source_clauses self.target_clauses = target_clauses self.wiql = wiql class WorkItem(WorkItemTrackingResource): """WorkItem. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param fields: Map of field and values for the work item. :type fields: dict :param id: The work item ID. :type id: int :param relations: Relations of the work item. :type relations: list of :class:`WorkItemRelation ` :param rev: Revision number of the work item. :type rev: int """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'fields': {'key': 'fields', 'type': '{object}'}, 'id': {'key': 'id', 'type': 'int'}, 'relations': {'key': 'relations', 'type': '[WorkItemRelation]'}, 'rev': {'key': 'rev', 'type': 'int'} } def __init__(self, url=None, _links=None, fields=None, id=None, relations=None, rev=None): super(WorkItem, self).__init__(url=url, _links=_links) self.fields = fields self.id = id self.relations = relations self.rev = rev class WorkItemClassificationNode(WorkItemTrackingResource): """WorkItemClassificationNode. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param attributes: Dictionary that has node attributes like start/finish date for iteration nodes. :type attributes: dict :param children: List of child nodes fetched. :type children: list of :class:`WorkItemClassificationNode ` :param has_children: Flag that indicates if the classification node has any child nodes. :type has_children: bool :param id: Integer ID of the classification node. :type id: int :param identifier: GUID ID of the classification node. :type identifier: str :param name: Name of the classification node. :type name: str :param structure_type: Node structure type. :type structure_type: object """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'attributes': {'key': 'attributes', 'type': '{object}'}, 'children': {'key': 'children', 'type': '[WorkItemClassificationNode]'}, 'has_children': {'key': 'hasChildren', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'int'}, 'identifier': {'key': 'identifier', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'structure_type': {'key': 'structureType', 'type': 'object'} } def __init__(self, url=None, _links=None, attributes=None, children=None, has_children=None, id=None, identifier=None, name=None, structure_type=None): super(WorkItemClassificationNode, self).__init__(url=url, _links=_links) self.attributes = attributes self.children = children self.has_children = has_children self.id = id self.identifier = identifier self.name = name self.structure_type = structure_type class WorkItemComment(WorkItemTrackingResource): """WorkItemComment. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param revised_by: Identity of user who added the comment. :type revised_by: :class:`IdentityReference ` :param revised_date: The date of comment. :type revised_date: datetime :param revision: The work item revision number. :type revision: int :param text: The text of the comment. :type text: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'revised_by': {'key': 'revisedBy', 'type': 'IdentityReference'}, 'revised_date': {'key': 'revisedDate', 'type': 'iso-8601'}, 'revision': {'key': 'revision', 'type': 'int'}, 'text': {'key': 'text', 'type': 'str'} } def __init__(self, url=None, _links=None, revised_by=None, revised_date=None, revision=None, text=None): super(WorkItemComment, self).__init__(url=url, _links=_links) self.revised_by = revised_by self.revised_date = revised_date self.revision = revision self.text = text class WorkItemComments(WorkItemTrackingResource): """WorkItemComments. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param comments: Comments collection. :type comments: list of :class:`WorkItemComment ` :param count: The count of comments. :type count: int :param from_revision_count: Count of comments from the revision. :type from_revision_count: int :param total_count: Total count of comments. :type total_count: int """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'comments': {'key': 'comments', 'type': '[WorkItemComment]'}, 'count': {'key': 'count', 'type': 'int'}, 'from_revision_count': {'key': 'fromRevisionCount', 'type': 'int'}, 'total_count': {'key': 'totalCount', 'type': 'int'} } def __init__(self, url=None, _links=None, comments=None, count=None, from_revision_count=None, total_count=None): super(WorkItemComments, self).__init__(url=url, _links=_links) self.comments = comments self.count = count self.from_revision_count = from_revision_count self.total_count = total_count class WorkItemField(WorkItemTrackingResource): """WorkItemField. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param can_sort_by: Indicates whether the field is sortable in server queries. :type can_sort_by: bool :param description: The description of the field. :type description: str :param is_identity: Indicates whether this field is an identity field. :type is_identity: bool :param is_picklist: Indicates whether this instance is picklist. :type is_picklist: bool :param is_picklist_suggested: Indicates whether this instance is a suggested picklist . :type is_picklist_suggested: bool :param is_queryable: Indicates whether the field can be queried in the server. :type is_queryable: bool :param name: The name of the field. :type name: str :param picklist_id: If this field is picklist, the identifier of the picklist associated, otherwise null :type picklist_id: str :param read_only: Indicates whether the field is [read only]. :type read_only: bool :param reference_name: The reference name of the field. :type reference_name: str :param supported_operations: The supported operations on this field. :type supported_operations: list of :class:`WorkItemFieldOperation ` :param type: The type of the field. :type type: object :param usage: The usage of the field. :type usage: object """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'can_sort_by': {'key': 'canSortBy', 'type': 'bool'}, 'description': {'key': 'description', 'type': 'str'}, 'is_identity': {'key': 'isIdentity', 'type': 'bool'}, 'is_picklist': {'key': 'isPicklist', 'type': 'bool'}, 'is_picklist_suggested': {'key': 'isPicklistSuggested', 'type': 'bool'}, 'is_queryable': {'key': 'isQueryable', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'picklist_id': {'key': 'picklistId', 'type': 'str'}, 'read_only': {'key': 'readOnly', 'type': 'bool'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'supported_operations': {'key': 'supportedOperations', 'type': '[WorkItemFieldOperation]'}, 'type': {'key': 'type', 'type': 'object'}, 'usage': {'key': 'usage', 'type': 'object'} } def __init__(self, url=None, _links=None, can_sort_by=None, description=None, is_identity=None, is_picklist=None, is_picklist_suggested=None, is_queryable=None, name=None, picklist_id=None, read_only=None, reference_name=None, supported_operations=None, type=None, usage=None): super(WorkItemField, self).__init__(url=url, _links=_links) self.can_sort_by = can_sort_by self.description = description self.is_identity = is_identity self.is_picklist = is_picklist self.is_picklist_suggested = is_picklist_suggested self.is_queryable = is_queryable self.name = name self.picklist_id = picklist_id self.read_only = read_only self.reference_name = reference_name self.supported_operations = supported_operations self.type = type self.usage = usage class WorkItemHistory(WorkItemTrackingResource): """WorkItemHistory. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param rev: :type rev: int :param revised_by: :type revised_by: :class:`IdentityReference ` :param revised_date: :type revised_date: datetime :param value: :type value: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'rev': {'key': 'rev', 'type': 'int'}, 'revised_by': {'key': 'revisedBy', 'type': 'IdentityReference'}, 'revised_date': {'key': 'revisedDate', 'type': 'iso-8601'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, url=None, _links=None, rev=None, revised_by=None, revised_date=None, value=None): super(WorkItemHistory, self).__init__(url=url, _links=_links) self.rev = rev self.revised_by = revised_by self.revised_date = revised_date self.value = value class WorkItemTemplateReference(WorkItemTrackingResource): """WorkItemTemplateReference. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param description: The description of the work item template. :type description: str :param id: The identifier of the work item template. :type id: str :param name: The name of the work item template. :type name: str :param work_item_type_name: The name of the work item type. :type work_item_type_name: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'} } def __init__(self, url=None, _links=None, description=None, id=None, name=None, work_item_type_name=None): super(WorkItemTemplateReference, self).__init__(url=url, _links=_links) self.description = description self.id = id self.name = name self.work_item_type_name = work_item_type_name class WorkItemTrackingReference(WorkItemTrackingResource): """WorkItemTrackingReference. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param name: The name. :type name: str :param reference_name: The reference name. :type reference_name: str """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'} } def __init__(self, url=None, _links=None, name=None, reference_name=None): super(WorkItemTrackingReference, self).__init__(url=url, _links=_links) self.name = name self.reference_name = reference_name class WorkItemRelationType(WorkItemTrackingReference): """WorkItemRelationType. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param name: The name. :type name: str :param reference_name: The reference name. :type reference_name: str :param attributes: The collection of relation type attributes. :type attributes: dict """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'attributes': {'key': 'attributes', 'type': '{object}'} } def __init__(self, url=None, _links=None, name=None, reference_name=None, attributes=None): super(WorkItemRelationType, self).__init__(url=url, _links=_links, name=name, reference_name=reference_name) self.attributes = attributes class WorkItemTemplate(WorkItemTemplateReference): """WorkItemTemplate. :param url: :type url: str :param _links: Link references to related REST resources. :type _links: :class:`ReferenceLinks ` :param description: The description of the work item template. :type description: str :param id: The identifier of the work item template. :type id: str :param name: The name of the work item template. :type name: str :param work_item_type_name: The name of the work item type. :type work_item_type_name: str :param fields: Mapping of field and its templated value. :type fields: dict """ _attribute_map = { 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'work_item_type_name': {'key': 'workItemTypeName', 'type': 'str'}, 'fields': {'key': 'fields', 'type': '{str}'} } def __init__(self, url=None, _links=None, description=None, id=None, name=None, work_item_type_name=None, fields=None): super(WorkItemTemplate, self).__init__(url=url, _links=_links, description=description, id=id, name=name, work_item_type_name=work_item_type_name) self.fields = fields __all__ = [ 'AccountMyWorkResult', 'AccountRecentActivityWorkItemModel', 'AccountRecentMentionWorkItemModel', 'AccountWorkWorkItemModel', 'ArtifactUriQuery', 'ArtifactUriQueryResult', 'AttachmentReference', 'FieldsToEvaluate', 'GraphSubjectBase', 'IdentityRef', 'IdentityReference', 'JsonPatchOperation', 'Link', 'ProjectWorkItemStateColors', 'ProvisioningResult', 'QueryBatchGetRequest', 'QueryHierarchyItemsResult', 'ReferenceLinks', 'ReportingWorkItemRevisionsFilter', 'StreamedBatch', 'TeamContext', 'Wiql', 'WorkArtifactLink', 'WorkItemBatchGetRequest', 'WorkItemDeleteReference', 'WorkItemDeleteShallowReference', 'WorkItemDeleteUpdate', 'WorkItemFieldOperation', 'WorkItemFieldReference', 'WorkItemFieldUpdate', 'WorkItemIcon', 'WorkItemLink', 'WorkItemNextStateOnTransition', 'WorkItemQueryClause', 'WorkItemQueryResult', 'WorkItemQuerySortColumn', 'WorkItemReference', 'WorkItemRelation', 'WorkItemRelationUpdates', 'WorkItemStateColor', 'WorkItemStateTransition', 'WorkItemTrackingResourceReference', 'WorkItemTypeColor', 'WorkItemTypeColorAndIcon', 'WorkItemTypeFieldInstanceBase', 'WorkItemTypeFieldWithReferences', 'WorkItemTypeReference', 'WorkItemTypeStateColors', 'WorkItemTypeTemplate', 'WorkItemTypeTemplateUpdateModel', 'ReportingWorkItemLinksBatch', 'ReportingWorkItemRevisionsBatch', 'WorkItemDelete', 'WorkItemTrackingResource', 'WorkItemType', 'WorkItemTypeCategory', 'WorkItemTypeFieldInstance', 'WorkItemUpdate', 'FieldDependentRule', 'QueryHierarchyItem', 'WorkItem', 'WorkItemClassificationNode', 'WorkItemComment', 'WorkItemComments', 'WorkItemField', 'WorkItemHistory', 'WorkItemTemplateReference', 'WorkItemTrackingReference', 'WorkItemRelationType', 'WorkItemTemplate', ] work_item_tracking_client.py000066400000000000000000002615211360605530400404610ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class WorkItemTrackingClient(Client): """WorkItemTracking :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(WorkItemTrackingClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '5264459e-e5e0-4bd8-b118-0985e68a4ec5' def get_work_artifact_link_types(self): """GetWorkArtifactLinkTypes. [Preview API] Get the list of work item tracking outbound artifact link types. :rtype: [WorkArtifactLink] """ response = self._send(http_method='GET', location_id='1a31de40-e318-41cd-a6c6-881077df52e3', version='5.0-preview.1') return self._deserialize('[WorkArtifactLink]', self._unwrap_collection(response)) def query_work_items_for_artifact_uris(self, artifact_uri_query, project=None): """QueryWorkItemsForArtifactUris. [Preview API] Queries work items linked to a given list of artifact URI. :param :class:` ` artifact_uri_query: Defines a list of artifact URI for querying work items. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(artifact_uri_query, 'ArtifactUriQuery') response = self._send(http_method='POST', location_id='a9a9aa7a-8c09-44d3-ad1b-46e855c1e3d3', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('ArtifactUriQueryResult', response) def create_attachment(self, upload_stream, project=None, file_name=None, upload_type=None, area_path=None, **kwargs): """CreateAttachment. Uploads an attachment. :param object upload_stream: Stream to upload :param str project: Project ID or project name :param str file_name: The name of the file :param str upload_type: Attachment upload type: Simple or Chunked :param str area_path: Target project Area Path :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if upload_type is not None: query_parameters['uploadType'] = self._serialize.query('upload_type', upload_type, 'str') if area_path is not None: query_parameters['areaPath'] = self._serialize.query('area_path', area_path, 'str') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/octet-stream') return self._deserialize('AttachmentReference', response) def get_attachment_content(self, id, project=None, file_name=None, download=None, **kwargs): """GetAttachmentContent. Downloads an attachment. :param str id: Attachment ID :param str project: Project ID or project name :param str file_name: Name of the file :param bool download: If set to true always download attachment :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') response = self._send(http_method='GET', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_attachment_zip(self, id, project=None, file_name=None, download=None, **kwargs): """GetAttachmentZip. Downloads an attachment. :param str id: Attachment ID :param str project: Project ID or project name :param str file_name: Name of the file :param bool download: If set to true always download attachment :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') if download is not None: query_parameters['download'] = self._serialize.query('download', download, 'bool') response = self._send(http_method='GET', location_id='e07b5fa4-1499-494d-a496-64b860fd64ff', version='5.0', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_classification_nodes(self, project, ids, depth=None, error_policy=None): """GetClassificationNodes. Gets root classification nodes or list of classification nodes for a given list of nodes ids, for a given project. In case ids parameter is supplied you will get list of classification nodes for those ids. Otherwise you will get root classification nodes for this project. :param str project: Project ID or project name :param [int] ids: Comma seperated integer classification nodes ids. It's not required, if you want root nodes. :param int depth: Depth of children to fetch. :param str error_policy: Flag to handle errors in getting some nodes. Possible options are Fail and Omit. :rtype: [WorkItemClassificationNode] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if ids is not None: ids = ",".join(map(str, ids)) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') if error_policy is not None: query_parameters['errorPolicy'] = self._serialize.query('error_policy', error_policy, 'str') response = self._send(http_method='GET', location_id='a70579d1-f53a-48ee-a5be-7be8659023b9', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemClassificationNode]', self._unwrap_collection(response)) def get_root_nodes(self, project, depth=None): """GetRootNodes. Gets root classification nodes under the project. :param str project: Project ID or project name :param int depth: Depth of children to fetch. :rtype: [WorkItemClassificationNode] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') response = self._send(http_method='GET', location_id='a70579d1-f53a-48ee-a5be-7be8659023b9', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemClassificationNode]', self._unwrap_collection(response)) def create_or_update_classification_node(self, posted_node, project, structure_group, path=None): """CreateOrUpdateClassificationNode. Create new or update an existing classification node. :param :class:` ` posted_node: Node to create or update. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if structure_group is not None: route_values['structureGroup'] = self._serialize.url('structure_group', structure_group, 'TreeStructureGroup') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') content = self._serialize.body(posted_node, 'WorkItemClassificationNode') response = self._send(http_method='POST', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', version='5.0', route_values=route_values, content=content) return self._deserialize('WorkItemClassificationNode', response) def delete_classification_node(self, project, structure_group, path=None, reclassify_id=None): """DeleteClassificationNode. Delete an existing classification node. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. :param int reclassify_id: Id of the target classification node for reclassification. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if structure_group is not None: route_values['structureGroup'] = self._serialize.url('structure_group', structure_group, 'TreeStructureGroup') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') query_parameters = {} if reclassify_id is not None: query_parameters['$reclassifyId'] = self._serialize.query('reclassify_id', reclassify_id, 'int') self._send(http_method='DELETE', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', version='5.0', route_values=route_values, query_parameters=query_parameters) def get_classification_node(self, project, structure_group, path=None, depth=None): """GetClassificationNode. Gets the classification node for a given node path. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. :param int depth: Depth of children to fetch. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if structure_group is not None: route_values['structureGroup'] = self._serialize.url('structure_group', structure_group, 'TreeStructureGroup') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') query_parameters = {} if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') response = self._send(http_method='GET', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemClassificationNode', response) def update_classification_node(self, posted_node, project, structure_group, path=None): """UpdateClassificationNode. Update an existing classification node. :param :class:` ` posted_node: Node to create or update. :param str project: Project ID or project name :param TreeStructureGroup structure_group: Structure group of the classification node, area or iteration. :param str path: Path of the classification node. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if structure_group is not None: route_values['structureGroup'] = self._serialize.url('structure_group', structure_group, 'TreeStructureGroup') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') content = self._serialize.body(posted_node, 'WorkItemClassificationNode') response = self._send(http_method='PATCH', location_id='5a172953-1b41-49d3-840a-33f79c3ce89f', version='5.0', route_values=route_values, content=content) return self._deserialize('WorkItemClassificationNode', response) def get_comment(self, id, revision, project=None): """GetComment. [Preview API] Gets a comment for a work item at the specified revision. :param int id: Work item id :param int revision: Revision for which the comment need to be fetched :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') if revision is not None: route_values['revision'] = self._serialize.url('revision', revision, 'int') response = self._send(http_method='GET', location_id='19335ae7-22f7-4308-93d8-261f9384b7cf', version='5.0-preview.2', route_values=route_values) return self._deserialize('WorkItemComment', response) def get_comments(self, id, project=None, from_revision=None, top=None, order=None): """GetComments. [Preview API] Gets the specified number of comments for a work item from the specified revision. :param int id: Work item id :param str project: Project ID or project name :param int from_revision: Revision from which comments are to be fetched (default is 1) :param int top: The number of comments to return (default is 200) :param str order: Ascending or descending by revision id (default is ascending) :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if from_revision is not None: query_parameters['fromRevision'] = self._serialize.query('from_revision', from_revision, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if order is not None: query_parameters['order'] = self._serialize.query('order', order, 'str') response = self._send(http_method='GET', location_id='19335ae7-22f7-4308-93d8-261f9384b7cf', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemComments', response) def create_field(self, work_item_field, project=None): """CreateField. Create a new field. :param :class:` ` work_item_field: New field definition :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(work_item_field, 'WorkItemField') response = self._send(http_method='POST', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', version='5.0', route_values=route_values, content=content) return self._deserialize('WorkItemField', response) def delete_field(self, field_name_or_ref_name, project=None): """DeleteField. Deletes the field. :param str field_name_or_ref_name: Field simple name or reference name :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if field_name_or_ref_name is not None: route_values['fieldNameOrRefName'] = self._serialize.url('field_name_or_ref_name', field_name_or_ref_name, 'str') self._send(http_method='DELETE', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', version='5.0', route_values=route_values) def get_field(self, field_name_or_ref_name, project=None): """GetField. Gets information on a specific field. :param str field_name_or_ref_name: Field simple name or reference name :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if field_name_or_ref_name is not None: route_values['fieldNameOrRefName'] = self._serialize.url('field_name_or_ref_name', field_name_or_ref_name, 'str') response = self._send(http_method='GET', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', version='5.0', route_values=route_values) return self._deserialize('WorkItemField', response) def get_fields(self, project=None, expand=None): """GetFields. Returns information for all fields. :param str project: Project ID or project name :param str expand: Use ExtensionFields to include extension fields, otherwise exclude them. Unless the feature flag for this parameter is enabled, extension fields are always included. :rtype: [WorkItemField] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='b51fd764-e5c2-4b9b-aaf7-3395cf4bdd94', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemField]', self._unwrap_collection(response)) def create_query(self, posted_query, project, query): """CreateQuery. Creates a query, or moves a query. :param :class:` ` posted_query: The query to create. :param str project: Project ID or project name :param str query: The parent id or path under which the query is to be created. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if query is not None: route_values['query'] = self._serialize.url('query', query, 'str') content = self._serialize.body(posted_query, 'QueryHierarchyItem') response = self._send(http_method='POST', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.0', route_values=route_values, content=content) return self._deserialize('QueryHierarchyItem', response) def delete_query(self, project, query): """DeleteQuery. Delete a query or a folder. This deletes any permission change on the deleted query or folder and any of its descendants if it is a folder. It is important to note that the deleted permission changes cannot be recovered upon undeleting the query or folder. :param str project: Project ID or project name :param str query: ID or path of the query or folder to delete. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if query is not None: route_values['query'] = self._serialize.url('query', query, 'str') self._send(http_method='DELETE', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.0', route_values=route_values) def get_queries(self, project, expand=None, depth=None, include_deleted=None): """GetQueries. Gets the root queries and their children :param str project: Project ID or project name :param str expand: Include the query string (wiql), clauses, query result columns, and sort options in the results. :param int depth: In the folder of queries, return child queries and folders to this depth. :param bool include_deleted: Include deleted queries and folders :rtype: [QueryHierarchyItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') if include_deleted is not None: query_parameters['$includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') response = self._send(http_method='GET', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[QueryHierarchyItem]', self._unwrap_collection(response)) def get_query(self, project, query, expand=None, depth=None, include_deleted=None): """GetQuery. Retrieves an individual query and its children :param str project: Project ID or project name :param str query: ID or path of the query. :param str expand: Include the query string (wiql), clauses, query result columns, and sort options in the results. :param int depth: In the folder of queries, return child queries and folders to this depth. :param bool include_deleted: Include deleted queries and folders :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if query is not None: route_values['query'] = self._serialize.url('query', query, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if depth is not None: query_parameters['$depth'] = self._serialize.query('depth', depth, 'int') if include_deleted is not None: query_parameters['$includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') response = self._send(http_method='GET', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('QueryHierarchyItem', response) def search_queries(self, project, filter, top=None, expand=None, include_deleted=None): """SearchQueries. Searches all queries the user has access to in the current project :param str project: Project ID or project name :param str filter: The text to filter the queries with. :param int top: The number of queries to return (Default is 50 and maximum is 200). :param str expand: :param bool include_deleted: Include deleted queries and folders :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if filter is not None: query_parameters['$filter'] = self._serialize.query('filter', filter, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if include_deleted is not None: query_parameters['$includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') response = self._send(http_method='GET', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('QueryHierarchyItemsResult', response) def update_query(self, query_update, project, query, undelete_descendants=None): """UpdateQuery. Update a query or a folder. This allows you to update, rename and move queries and folders. :param :class:` ` query_update: The query to update. :param str project: Project ID or project name :param str query: The ID or path for the query to update. :param bool undelete_descendants: Undelete the children of this folder. It is important to note that this will not bring back the permission changes that were previously applied to the descendants. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if query is not None: route_values['query'] = self._serialize.url('query', query, 'str') query_parameters = {} if undelete_descendants is not None: query_parameters['$undeleteDescendants'] = self._serialize.query('undelete_descendants', undelete_descendants, 'bool') content = self._serialize.body(query_update, 'QueryHierarchyItem') response = self._send(http_method='PATCH', location_id='a67d190c-c41f-424b-814d-0e906f659301', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('QueryHierarchyItem', response) def get_queries_batch(self, query_get_request, project): """GetQueriesBatch. Gets a list of queries by ids (Maximum 1000) :param :class:` ` query_get_request: :param str project: Project ID or project name :rtype: [QueryHierarchyItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(query_get_request, 'QueryBatchGetRequest') response = self._send(http_method='POST', location_id='549816f9-09b0-4e75-9e81-01fbfcd07426', version='5.0', route_values=route_values, content=content) return self._deserialize('[QueryHierarchyItem]', self._unwrap_collection(response)) def destroy_work_item(self, id, project=None): """DestroyWorkItem. Destroys the specified work item permanently from the Recycle Bin. This action can not be undone. :param int id: ID of the work item to be destroyed permanently :param str project: Project ID or project name """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') self._send(http_method='DELETE', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.0', route_values=route_values) def get_deleted_work_item(self, id, project=None): """GetDeletedWorkItem. Gets a deleted work item from Recycle Bin. :param int id: ID of the work item to be returned :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') response = self._send(http_method='GET', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.0', route_values=route_values) return self._deserialize('WorkItemDelete', response) def get_deleted_work_items(self, ids, project=None): """GetDeletedWorkItems. Gets the work items from the recycle bin, whose IDs have been specified in the parameters :param [int] ids: Comma separated list of IDs of the deleted work items to be returned :param str project: Project ID or project name :rtype: [WorkItemDeleteReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if ids is not None: ids = ",".join(map(str, ids)) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') response = self._send(http_method='GET', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemDeleteReference]', self._unwrap_collection(response)) def get_deleted_work_item_shallow_references(self, project=None): """GetDeletedWorkItemShallowReferences. Gets a list of the IDs and the URLs of the deleted the work items in the Recycle Bin. :param str project: Project ID or project name :rtype: [WorkItemDeleteShallowReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.0', route_values=route_values) return self._deserialize('[WorkItemDeleteShallowReference]', self._unwrap_collection(response)) def restore_work_item(self, payload, id, project=None): """RestoreWorkItem. Restores the deleted work item from Recycle Bin. :param :class:` ` payload: Paylod with instructions to update the IsDeleted flag to false :param int id: ID of the work item to be restored :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') content = self._serialize.body(payload, 'WorkItemDeleteUpdate') response = self._send(http_method='PATCH', location_id='b70d8d39-926c-465e-b927-b1bf0e5ca0e0', version='5.0', route_values=route_values, content=content) return self._deserialize('WorkItemDelete', response) def get_revision(self, id, revision_number, project=None, expand=None): """GetRevision. Returns a fully hydrated work item for the requested revision :param int id: :param int revision_number: :param str project: Project ID or project name :param str expand: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') if revision_number is not None: route_values['revisionNumber'] = self._serialize.url('revision_number', revision_number, 'int') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) def get_revisions(self, id, project=None, top=None, skip=None, expand=None): """GetRevisions. Returns the list of fully hydrated work item revisions, paged. :param int id: :param str project: Project ID or project name :param int top: :param int skip: :param str expand: :rtype: [WorkItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='a00c85a5-80fa-4565-99c3-bcd2181434bb', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItem]', self._unwrap_collection(response)) def create_template(self, template, team_context): """CreateTemplate. [Preview API] Creates a template :param :class:` ` template: Template contents :param :class:` ` team_context: The team context for the operation :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') content = self._serialize.body(template, 'WorkItemTemplate') response = self._send(http_method='POST', location_id='6a90345f-a676-4969-afce-8e163e1d5642', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WorkItemTemplate', response) def get_templates(self, team_context, workitemtypename=None): """GetTemplates. [Preview API] Gets template :param :class:` ` team_context: The team context for the operation :param str workitemtypename: Optional, When specified returns templates for given Work item type. :rtype: [WorkItemTemplateReference] """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') query_parameters = {} if workitemtypename is not None: query_parameters['workitemtypename'] = self._serialize.query('workitemtypename', workitemtypename, 'str') response = self._send(http_method='GET', location_id='6a90345f-a676-4969-afce-8e163e1d5642', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemTemplateReference]', self._unwrap_collection(response)) def delete_template(self, team_context, template_id): """DeleteTemplate. [Preview API] Deletes the template with given id :param :class:` ` team_context: The team context for the operation :param str template_id: Template id """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') self._send(http_method='DELETE', location_id='fb10264a-8836-48a0-8033-1b0ccd2748d5', version='5.0-preview.1', route_values=route_values) def get_template(self, team_context, template_id): """GetTemplate. [Preview API] Gets the template with specified id :param :class:` ` team_context: The team context for the operation :param str template_id: Template Id :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') response = self._send(http_method='GET', location_id='fb10264a-8836-48a0-8033-1b0ccd2748d5', version='5.0-preview.1', route_values=route_values) return self._deserialize('WorkItemTemplate', response) def replace_template(self, template_content, team_context, template_id): """ReplaceTemplate. [Preview API] Replace template contents :param :class:` ` template_content: Template contents to replace with :param :class:` ` team_context: The team context for the operation :param str template_id: Template id :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') content = self._serialize.body(template_content, 'WorkItemTemplate') response = self._send(http_method='PUT', location_id='fb10264a-8836-48a0-8033-1b0ccd2748d5', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WorkItemTemplate', response) def get_update(self, id, update_number, project=None): """GetUpdate. Returns a single update for a work item :param int id: :param int update_number: :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') if update_number is not None: route_values['updateNumber'] = self._serialize.url('update_number', update_number, 'int') response = self._send(http_method='GET', location_id='6570bf97-d02c-4a91-8d93-3abe9895b1a9', version='5.0', route_values=route_values) return self._deserialize('WorkItemUpdate', response) def get_updates(self, id, project=None, top=None, skip=None): """GetUpdates. Returns a the deltas between work item revisions :param int id: :param str project: Project ID or project name :param int top: :param int skip: :rtype: [WorkItemUpdate] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if skip is not None: query_parameters['$skip'] = self._serialize.query('skip', skip, 'int') response = self._send(http_method='GET', location_id='6570bf97-d02c-4a91-8d93-3abe9895b1a9', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemUpdate]', self._unwrap_collection(response)) def query_by_wiql(self, wiql, team_context=None, time_precision=None, top=None): """QueryByWiql. Gets the results of the query given its WIQL. :param :class:` ` wiql: The query containing the WIQL. :param :class:` ` team_context: The team context for the operation :param bool time_precision: Whether or not to use time precision. :param int top: The max number of results to return. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') query_parameters = {} if time_precision is not None: query_parameters['timePrecision'] = self._serialize.query('time_precision', time_precision, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') content = self._serialize.body(wiql, 'Wiql') response = self._send(http_method='POST', location_id='1a9c53f7-f243-4447-b110-35ef023636e4', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('WorkItemQueryResult', response) def get_query_result_count(self, id, team_context=None, time_precision=None, top=None): """GetQueryResultCount. Gets the results of the query given the query ID. :param str id: The query ID. :param :class:` ` team_context: The team context for the operation :param bool time_precision: Whether or not to use time precision. :param int top: The max number of results to return. :rtype: int """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if time_precision is not None: query_parameters['timePrecision'] = self._serialize.query('time_precision', time_precision, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='HEAD', location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('int', response) def query_by_id(self, id, team_context=None, time_precision=None, top=None): """QueryById. Gets the results of the query given the query ID. :param str id: The query ID. :param :class:` ` team_context: The team context for the operation :param bool time_precision: Whether or not to use time precision. :param int top: The max number of results to return. :rtype: :class:` ` """ project = None team = None if team_context is not None: if team_context.project_id: project = team_context.project_id else: project = team_context.project if team_context.team_id: team = team_context.team_id else: team = team_context.team route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'string') if team is not None: route_values['team'] = self._serialize.url('team', team, 'string') if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') query_parameters = {} if time_precision is not None: query_parameters['timePrecision'] = self._serialize.query('time_precision', time_precision, 'bool') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='a02355f5-5f8a-4671-8e32-369d23aac83d', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemQueryResult', response) def get_work_item_icon_json(self, icon, color=None, v=None): """GetWorkItemIconJson. [Preview API] Get a work item icon given the friendly name and icon color. :param str icon: The name of the icon :param str color: The 6-digit hex color for the icon :param int v: The version of the icon (used only for cache invalidation) :rtype: :class:` ` """ route_values = {} if icon is not None: route_values['icon'] = self._serialize.url('icon', icon, 'str') query_parameters = {} if color is not None: query_parameters['color'] = self._serialize.query('color', color, 'str') if v is not None: query_parameters['v'] = self._serialize.query('v', v, 'int') response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemIcon', response) def get_work_item_icons(self): """GetWorkItemIcons. [Preview API] Get a list of all work item icons. :rtype: [WorkItemIcon] """ response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', version='5.0-preview.1') return self._deserialize('[WorkItemIcon]', self._unwrap_collection(response)) def get_work_item_icon_svg(self, icon, color=None, v=None, **kwargs): """GetWorkItemIconSvg. [Preview API] Get a work item icon given the friendly name and icon color. :param str icon: The name of the icon :param str color: The 6-digit hex color for the icon :param int v: The version of the icon (used only for cache invalidation) :rtype: object """ route_values = {} if icon is not None: route_values['icon'] = self._serialize.url('icon', icon, 'str') query_parameters = {} if color is not None: query_parameters['color'] = self._serialize.query('color', color, 'str') if v is not None: query_parameters['v'] = self._serialize.query('v', v, 'int') response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='image/svg+xml') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_work_item_icon_xaml(self, icon, color=None, v=None, **kwargs): """GetWorkItemIconXaml. [Preview API] Get a work item icon given the friendly name and icon color. :param str icon: The name of the icon :param str color: The 6-digit hex color for the icon :param int v: The version of the icon (used only for cache invalidation) :rtype: object """ route_values = {} if icon is not None: route_values['icon'] = self._serialize.url('icon', icon, 'str') query_parameters = {} if color is not None: query_parameters['color'] = self._serialize.query('color', color, 'str') if v is not None: query_parameters['v'] = self._serialize.query('v', v, 'int') response = self._send(http_method='GET', location_id='4e1eb4a5-1970-4228-a682-ec48eb2dca30', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='image/xaml+xml') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_reporting_links_by_link_type(self, project=None, link_types=None, types=None, continuation_token=None, start_date_time=None): """GetReportingLinksByLinkType. Get a batch of work item links :param str project: Project ID or project name :param [str] link_types: A list of types to filter the results to specific link types. Omit this parameter to get work item links of all link types. :param [str] types: A list of types to filter the results to specific work item types. Omit this parameter to get work item links of all work item types. :param str continuation_token: Specifies the continuationToken to start the batch from. Omit this parameter to get the first batch of links. :param datetime start_date_time: Date/time to use as a starting point for link changes. Only link changes that occurred after that date/time will be returned. Cannot be used in conjunction with 'watermark' parameter. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if link_types is not None: link_types = ",".join(link_types) query_parameters['linkTypes'] = self._serialize.query('link_types', link_types, 'str') if types is not None: types = ",".join(types) query_parameters['types'] = self._serialize.query('types', types, 'str') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if start_date_time is not None: query_parameters['startDateTime'] = self._serialize.query('start_date_time', start_date_time, 'iso-8601') response = self._send(http_method='GET', location_id='b5b5b6d0-0308-40a1-b3f4-b9bb3c66878f', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReportingWorkItemLinksBatch', response) def get_relation_type(self, relation): """GetRelationType. Gets the work item relation type definition. :param str relation: The relation name :rtype: :class:` ` """ route_values = {} if relation is not None: route_values['relation'] = self._serialize.url('relation', relation, 'str') response = self._send(http_method='GET', location_id='f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165', version='5.0', route_values=route_values) return self._deserialize('WorkItemRelationType', response) def get_relation_types(self): """GetRelationTypes. Gets the work item relation types. :rtype: [WorkItemRelationType] """ response = self._send(http_method='GET', location_id='f5d33bc9-5b49-4a3c-a9bd-f3cd46dd2165', version='5.0') return self._deserialize('[WorkItemRelationType]', self._unwrap_collection(response)) def read_reporting_revisions_get(self, project=None, fields=None, types=None, continuation_token=None, start_date_time=None, include_identity_ref=None, include_deleted=None, include_tag_ref=None, include_latest_only=None, expand=None, include_discussion_changes_only=None, max_page_size=None): """ReadReportingRevisionsGet. Get a batch of work item revisions with the option of including deleted items :param str project: Project ID or project name :param [str] fields: A list of fields to return in work item revisions. Omit this parameter to get all reportable fields. :param [str] types: A list of types to filter the results to specific work item types. Omit this parameter to get work item revisions of all work item types. :param str continuation_token: Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. :param datetime start_date_time: Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. :param bool include_identity_ref: Return an identity reference instead of a string value for identity fields. :param bool include_deleted: Specify if the deleted item should be returned. :param bool include_tag_ref: Specify if the tag objects should be returned for System.Tags field. :param bool include_latest_only: Return only the latest revisions of work items, skipping all historical revisions :param str expand: Return all the fields in work item revisions, including long text fields which are not returned by default :param bool include_discussion_changes_only: Return only the those revisions of work items, where only history field was changed :param int max_page_size: The maximum number of results to return in this batch :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if fields is not None: fields = ",".join(fields) query_parameters['fields'] = self._serialize.query('fields', fields, 'str') if types is not None: types = ",".join(types) query_parameters['types'] = self._serialize.query('types', types, 'str') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if start_date_time is not None: query_parameters['startDateTime'] = self._serialize.query('start_date_time', start_date_time, 'iso-8601') if include_identity_ref is not None: query_parameters['includeIdentityRef'] = self._serialize.query('include_identity_ref', include_identity_ref, 'bool') if include_deleted is not None: query_parameters['includeDeleted'] = self._serialize.query('include_deleted', include_deleted, 'bool') if include_tag_ref is not None: query_parameters['includeTagRef'] = self._serialize.query('include_tag_ref', include_tag_ref, 'bool') if include_latest_only is not None: query_parameters['includeLatestOnly'] = self._serialize.query('include_latest_only', include_latest_only, 'bool') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if include_discussion_changes_only is not None: query_parameters['includeDiscussionChangesOnly'] = self._serialize.query('include_discussion_changes_only', include_discussion_changes_only, 'bool') if max_page_size is not None: query_parameters['$maxPageSize'] = self._serialize.query('max_page_size', max_page_size, 'int') response = self._send(http_method='GET', location_id='f828fe59-dd87-495d-a17c-7a8d6211ca6c', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ReportingWorkItemRevisionsBatch', response) def read_reporting_revisions_post(self, filter, project=None, continuation_token=None, start_date_time=None, expand=None): """ReadReportingRevisionsPost. Get a batch of work item revisions. This request may be used if your list of fields is large enough that it may run the URL over the length limit. :param :class:` ` filter: An object that contains request settings: field filter, type filter, identity format :param str project: Project ID or project name :param str continuation_token: Specifies the watermark to start the batch from. Omit this parameter to get the first batch of revisions. :param datetime start_date_time: Date/time to use as a starting point for revisions, all revisions will occur after this date/time. Cannot be used in conjunction with 'watermark' parameter. :param str expand: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if start_date_time is not None: query_parameters['startDateTime'] = self._serialize.query('start_date_time', start_date_time, 'iso-8601') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') content = self._serialize.body(filter, 'ReportingWorkItemRevisionsFilter') response = self._send(http_method='POST', location_id='f828fe59-dd87-495d-a17c-7a8d6211ca6c', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('ReportingWorkItemRevisionsBatch', response) def create_work_item(self, document, project, type, validate_only=None, bypass_rules=None, suppress_notifications=None): """CreateWorkItem. Creates a single work item. :param :class:`<[JsonPatchOperation]> ` document: The JSON Patch document representing the work item :param str project: Project ID or project name :param str type: The work item type of the work item to create :param bool validate_only: Indicate if you only want to validate the changes without saving the work item :param bool bypass_rules: Do not enforce the work item type rules on this update :param bool suppress_notifications: Do not fire any notifications for this change :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') query_parameters = {} if validate_only is not None: query_parameters['validateOnly'] = self._serialize.query('validate_only', validate_only, 'bool') if bypass_rules is not None: query_parameters['bypassRules'] = self._serialize.query('bypass_rules', bypass_rules, 'bool') if suppress_notifications is not None: query_parameters['suppressNotifications'] = self._serialize.query('suppress_notifications', suppress_notifications, 'bool') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='POST', location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/json-patch+json') return self._deserialize('WorkItem', response) def get_work_item_template(self, project, type, fields=None, as_of=None, expand=None): """GetWorkItemTemplate. Returns a single work item from a template. :param str project: Project ID or project name :param str type: The work item type name :param str fields: Comma-separated list of requested fields :param datetime as_of: AsOf UTC date time string :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') query_parameters = {} if fields is not None: query_parameters['fields'] = self._serialize.query('fields', fields, 'str') if as_of is not None: query_parameters['asOf'] = self._serialize.query('as_of', as_of, 'iso-8601') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='62d3d110-0047-428c-ad3c-4fe872c91c74', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) def delete_work_item(self, id, project=None, destroy=None): """DeleteWorkItem. Deletes the specified work item and sends it to the Recycle Bin, so that it can be restored back, if required. Optionally, if the destroy parameter has been set to true, it destroys the work item permanently. :param int id: ID of the work item to be deleted :param str project: Project ID or project name :param bool destroy: Optional parameter, if set to true, the work item is deleted permanently :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if destroy is not None: query_parameters['destroy'] = self._serialize.query('destroy', destroy, 'bool') response = self._send(http_method='DELETE', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemDelete', response) def get_work_item(self, id, project=None, fields=None, as_of=None, expand=None): """GetWorkItem. Returns a single work item. :param int id: The work item id :param str project: Project ID or project name :param [str] fields: Comma-separated list of requested fields :param datetime as_of: AsOf UTC date time string :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if fields is not None: fields = ",".join(fields) query_parameters['fields'] = self._serialize.query('fields', fields, 'str') if as_of is not None: query_parameters['asOf'] = self._serialize.query('as_of', as_of, 'iso-8601') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItem', response) def get_work_items(self, ids, project=None, fields=None, as_of=None, expand=None, error_policy=None): """GetWorkItems. Returns a list of work items (Maximum 200) :param [int] ids: The comma-separated list of requested work item ids. (Maximum 200 ids allowed). :param str project: Project ID or project name :param [str] fields: Comma-separated list of requested fields :param datetime as_of: AsOf UTC date time string :param str expand: The expand parameters for work item attributes. Possible options are { None, Relations, Fields, Links, All }. :param str error_policy: The flag to control error policy in a bulk get work items request. Possible options are {Fail, Omit}. :rtype: [WorkItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if ids is not None: ids = ",".join(map(str, ids)) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') if fields is not None: fields = ",".join(fields) query_parameters['fields'] = self._serialize.query('fields', fields, 'str') if as_of is not None: query_parameters['asOf'] = self._serialize.query('as_of', as_of, 'iso-8601') if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') if error_policy is not None: query_parameters['errorPolicy'] = self._serialize.query('error_policy', error_policy, 'str') response = self._send(http_method='GET', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItem]', self._unwrap_collection(response)) def update_work_item(self, document, id, project=None, validate_only=None, bypass_rules=None, suppress_notifications=None): """UpdateWorkItem. Updates a single work item. :param :class:`<[JsonPatchOperation]> ` document: The JSON Patch document representing the update :param int id: The id of the work item to update :param str project: Project ID or project name :param bool validate_only: Indicate if you only want to validate the changes without saving the work item :param bool bypass_rules: Do not enforce the work item type rules on this update :param bool suppress_notifications: Do not fire any notifications for this change :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if id is not None: route_values['id'] = self._serialize.url('id', id, 'int') query_parameters = {} if validate_only is not None: query_parameters['validateOnly'] = self._serialize.query('validate_only', validate_only, 'bool') if bypass_rules is not None: query_parameters['bypassRules'] = self._serialize.query('bypass_rules', bypass_rules, 'bool') if suppress_notifications is not None: query_parameters['suppressNotifications'] = self._serialize.query('suppress_notifications', suppress_notifications, 'bool') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='72c7ddf8-2cdc-4f60-90cd-ab71c14a399b', version='5.0', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/json-patch+json') return self._deserialize('WorkItem', response) def get_work_items_batch(self, work_item_get_request, project=None): """GetWorkItemsBatch. Gets work items for a list of work item ids (Maximum 200) :param :class:` ` work_item_get_request: :param str project: Project ID or project name :rtype: [WorkItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(work_item_get_request, 'WorkItemBatchGetRequest') response = self._send(http_method='POST', location_id='908509b6-4248-4475-a1cd-829139ba419f', version='5.0', route_values=route_values, content=content) return self._deserialize('[WorkItem]', self._unwrap_collection(response)) def get_work_item_next_states_on_checkin_action(self, ids, action=None): """GetWorkItemNextStatesOnCheckinAction. [Preview API] Returns the next state on the given work item IDs. :param [int] ids: list of work item ids :param str action: possible actions. Currently only supports checkin :rtype: [WorkItemNextStateOnTransition] """ query_parameters = {} if ids is not None: ids = ",".join(map(str, ids)) query_parameters['ids'] = self._serialize.query('ids', ids, 'str') if action is not None: query_parameters['action'] = self._serialize.query('action', action, 'str') response = self._send(http_method='GET', location_id='afae844b-e2f6-44c2-8053-17b3bb936a40', version='5.0-preview.1', query_parameters=query_parameters) return self._deserialize('[WorkItemNextStateOnTransition]', self._unwrap_collection(response)) def get_work_item_type_categories(self, project): """GetWorkItemTypeCategories. Get all work item type categories. :param str project: Project ID or project name :rtype: [WorkItemTypeCategory] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='9b9f5734-36c8-415e-ba67-f83b45c31408', version='5.0', route_values=route_values) return self._deserialize('[WorkItemTypeCategory]', self._unwrap_collection(response)) def get_work_item_type_category(self, project, category): """GetWorkItemTypeCategory. Get specific work item type category by name. :param str project: Project ID or project name :param str category: The category name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if category is not None: route_values['category'] = self._serialize.url('category', category, 'str') response = self._send(http_method='GET', location_id='9b9f5734-36c8-415e-ba67-f83b45c31408', version='5.0', route_values=route_values) return self._deserialize('WorkItemTypeCategory', response) def get_work_item_type(self, project, type): """GetWorkItemType. Returns a work item type definition. :param str project: Project ID or project name :param str type: Work item type name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa', version='5.0', route_values=route_values) return self._deserialize('WorkItemType', response) def get_work_item_types(self, project): """GetWorkItemTypes. Returns the list of work item types :param str project: Project ID or project name :rtype: [WorkItemType] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='7c8d7a76-4a09-43e8-b5df-bd792f4ac6aa', version='5.0', route_values=route_values) return self._deserialize('[WorkItemType]', self._unwrap_collection(response)) def get_work_item_type_fields_with_references(self, project, type, expand=None): """GetWorkItemTypeFieldsWithReferences. Get a list of fields for a work item type with detailed references. :param str project: Project ID or project name :param str type: Work item type. :param str expand: Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties. :rtype: [WorkItemTypeFieldWithReferences] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='bd293ce5-3d25-4192-8e67-e8092e879efb', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[WorkItemTypeFieldWithReferences]', self._unwrap_collection(response)) def get_work_item_type_field_with_references(self, project, type, field, expand=None): """GetWorkItemTypeFieldWithReferences. Get a field for a work item type with detailed references. :param str project: Project ID or project name :param str type: Work item type. :param str field: :param str expand: Expand level for the API response. Properties: to include allowedvalues, default value, isRequired etc. as a part of response; None: to skip these properties. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') if field is not None: route_values['field'] = self._serialize.url('field', field, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='bd293ce5-3d25-4192-8e67-e8092e879efb', version='5.0', route_values=route_values, query_parameters=query_parameters) return self._deserialize('WorkItemTypeFieldWithReferences', response) def get_work_item_type_states(self, project, type): """GetWorkItemTypeStates. [Preview API] Returns the state names and colors for a work item type. :param str project: Project ID or project name :param str type: The state name :rtype: [WorkItemStateColor] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='7c9d7a76-4a09-43e8-b5df-bd792f4ac6aa', version='5.0-preview.1', route_values=route_values) return self._deserialize('[WorkItemStateColor]', self._unwrap_collection(response)) work_item_tracking_process/000077500000000000000000000000001360605530400344165ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0__init__.py000066400000000000000000000034311360605530400365300ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking_process# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .work_item_tracking_process_client import WorkItemTrackingProcessClient __all__ = [ 'AddProcessWorkItemTypeFieldRequest', 'Control', 'CreateProcessModel', 'CreateProcessRuleRequest', 'CreateProcessWorkItemTypeRequest', 'Extension', 'FieldModel', 'FieldRuleModel', 'FormLayout', 'Group', 'HideStateModel', 'Page', 'PickList', 'PickListMetadata', 'ProcessBehavior', 'ProcessBehaviorCreateRequest', 'ProcessBehaviorField', 'ProcessBehaviorReference', 'ProcessBehaviorUpdateRequest', 'ProcessInfo', 'ProcessModel', 'ProcessProperties', 'ProcessRule', 'ProcessWorkItemType', 'ProcessWorkItemTypeField', 'ProjectReference', 'RuleAction', 'RuleActionModel', 'RuleCondition', 'RuleConditionModel', 'Section', 'UpdateProcessModel', 'UpdateProcessRuleRequest', 'UpdateProcessWorkItemTypeFieldRequest', 'UpdateProcessWorkItemTypeRequest', 'WitContribution', 'WorkItemBehavior', 'WorkItemBehaviorField', 'WorkItemBehaviorReference', 'WorkItemStateInputModel', 'WorkItemStateResultModel', 'WorkItemTypeBehavior', 'WorkItemTypeModel', 'WorkItemTrackingProcessClient' ] models.py000066400000000000000000001531211360605530400362560ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking_process# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AddProcessWorkItemTypeFieldRequest(Model): """AddProcessWorkItemTypeFieldRequest. :param allow_groups: Allow setting field value to a group identity. Only applies to identity fields. :type allow_groups: bool :param default_value: The default value of the field. :type default_value: object :param read_only: If true the field cannot be edited. :type read_only: bool :param reference_name: Reference name of the field. :type reference_name: str :param required: If true the field cannot be empty. :type required: bool """ _attribute_map = { 'allow_groups': {'key': 'allowGroups', 'type': 'bool'}, 'default_value': {'key': 'defaultValue', 'type': 'object'}, 'read_only': {'key': 'readOnly', 'type': 'bool'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'required': {'key': 'required', 'type': 'bool'} } def __init__(self, allow_groups=None, default_value=None, read_only=None, reference_name=None, required=None): super(AddProcessWorkItemTypeFieldRequest, self).__init__() self.allow_groups = allow_groups self.default_value = default_value self.read_only = read_only self.reference_name = reference_name self.required = required class Control(Model): """Control. :param contribution: Contribution for the control. :type contribution: :class:`WitContribution ` :param control_type: Type of the control. :type control_type: str :param height: Height of the control, for html controls. :type height: int :param id: The id for the layout node. :type id: str :param inherited: A value indicating whether this layout node has been inherited. from a parent layout. This is expected to only be only set by the combiner. :type inherited: bool :param is_contribution: A value indicating if the layout node is contribution or not. :type is_contribution: bool :param label: Label for the field. :type label: str :param metadata: Inner text of the control. :type metadata: str :param order: Order in which the control should appear in its group. :type order: int :param overridden: A value indicating whether this layout node has been overridden . by a child layout. :type overridden: bool :param read_only: A value indicating if the control is readonly. :type read_only: bool :param visible: A value indicating if the control should be hidden or not. :type visible: bool :param watermark: Watermark text for the textbox. :type watermark: str """ _attribute_map = { 'contribution': {'key': 'contribution', 'type': 'WitContribution'}, 'control_type': {'key': 'controlType', 'type': 'str'}, 'height': {'key': 'height', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'inherited': {'key': 'inherited', 'type': 'bool'}, 'is_contribution': {'key': 'isContribution', 'type': 'bool'}, 'label': {'key': 'label', 'type': 'str'}, 'metadata': {'key': 'metadata', 'type': 'str'}, 'order': {'key': 'order', 'type': 'int'}, 'overridden': {'key': 'overridden', 'type': 'bool'}, 'read_only': {'key': 'readOnly', 'type': 'bool'}, 'visible': {'key': 'visible', 'type': 'bool'}, 'watermark': {'key': 'watermark', 'type': 'str'} } def __init__(self, contribution=None, control_type=None, height=None, id=None, inherited=None, is_contribution=None, label=None, metadata=None, order=None, overridden=None, read_only=None, visible=None, watermark=None): super(Control, self).__init__() self.contribution = contribution self.control_type = control_type self.height = height self.id = id self.inherited = inherited self.is_contribution = is_contribution self.label = label self.metadata = metadata self.order = order self.overridden = overridden self.read_only = read_only self.visible = visible self.watermark = watermark class CreateProcessModel(Model): """CreateProcessModel. :param description: Description of the process :type description: str :param name: Name of the process :type name: str :param parent_process_type_id: The ID of the parent process :type parent_process_type_id: str :param reference_name: Reference name of the process :type reference_name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'parent_process_type_id': {'key': 'parentProcessTypeId', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'} } def __init__(self, description=None, name=None, parent_process_type_id=None, reference_name=None): super(CreateProcessModel, self).__init__() self.description = description self.name = name self.parent_process_type_id = parent_process_type_id self.reference_name = reference_name class CreateProcessRuleRequest(Model): """CreateProcessRuleRequest. :param actions: List of actions to take when the rule is triggered. :type actions: list of :class:`RuleAction ` :param conditions: List of conditions when the rule should be triggered. :type conditions: list of :class:`RuleCondition ` :param is_disabled: Indicates if the rule is disabled. :type is_disabled: bool :param name: Name for the rule. :type name: str """ _attribute_map = { 'actions': {'key': 'actions', 'type': '[RuleAction]'}, 'conditions': {'key': 'conditions', 'type': '[RuleCondition]'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, actions=None, conditions=None, is_disabled=None, name=None): super(CreateProcessRuleRequest, self).__init__() self.actions = actions self.conditions = conditions self.is_disabled = is_disabled self.name = name class CreateProcessWorkItemTypeRequest(Model): """CreateProcessWorkItemTypeRequest. :param color: Color hexadecimal code to represent the work item type :type color: str :param description: Description of the work item type :type description: str :param icon: Icon to represent the work item type :type icon: str :param inherits_from: Parent work item type for work item type :type inherits_from: str :param is_disabled: True if the work item type need to be disabled :type is_disabled: bool :param name: Name of work item type :type name: str """ _attribute_map = { 'color': {'key': 'color', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'icon': {'key': 'icon', 'type': 'str'}, 'inherits_from': {'key': 'inheritsFrom', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, color=None, description=None, icon=None, inherits_from=None, is_disabled=None, name=None): super(CreateProcessWorkItemTypeRequest, self).__init__() self.color = color self.description = description self.icon = icon self.inherits_from = inherits_from self.is_disabled = is_disabled self.name = name class Extension(Model): """Extension. :param id: Id of the extension :type id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'} } def __init__(self, id=None): super(Extension, self).__init__() self.id = id class FieldModel(Model): """FieldModel. :param description: :type description: str :param id: :type id: str :param is_identity: :type is_identity: bool :param name: :type name: str :param type: :type type: object :param url: :type url: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_identity': {'key': 'isIdentity', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, description=None, id=None, is_identity=None, name=None, type=None, url=None): super(FieldModel, self).__init__() self.description = description self.id = id self.is_identity = is_identity self.name = name self.type = type self.url = url class FieldRuleModel(Model): """FieldRuleModel. :param actions: :type actions: list of :class:`RuleActionModel ` :param conditions: :type conditions: list of :class:`RuleConditionModel ` :param friendly_name: :type friendly_name: str :param id: :type id: str :param is_disabled: :type is_disabled: bool :param is_system: :type is_system: bool """ _attribute_map = { 'actions': {'key': 'actions', 'type': '[RuleActionModel]'}, 'conditions': {'key': 'conditions', 'type': '[RuleConditionModel]'}, 'friendly_name': {'key': 'friendlyName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'is_system': {'key': 'isSystem', 'type': 'bool'} } def __init__(self, actions=None, conditions=None, friendly_name=None, id=None, is_disabled=None, is_system=None): super(FieldRuleModel, self).__init__() self.actions = actions self.conditions = conditions self.friendly_name = friendly_name self.id = id self.is_disabled = is_disabled self.is_system = is_system class FormLayout(Model): """FormLayout. :param extensions: Gets and sets extensions list. :type extensions: list of :class:`Extension ` :param pages: Top level tabs of the layout. :type pages: list of :class:`Page ` :param system_controls: Headers controls of the layout. :type system_controls: list of :class:`Control ` """ _attribute_map = { 'extensions': {'key': 'extensions', 'type': '[Extension]'}, 'pages': {'key': 'pages', 'type': '[Page]'}, 'system_controls': {'key': 'systemControls', 'type': '[Control]'} } def __init__(self, extensions=None, pages=None, system_controls=None): super(FormLayout, self).__init__() self.extensions = extensions self.pages = pages self.system_controls = system_controls class Group(Model): """Group. :param contribution: Contribution for the group. :type contribution: :class:`WitContribution ` :param controls: Controls to be put in the group. :type controls: list of :class:`Control ` :param height: The height for the contribution. :type height: int :param id: The id for the layout node. :type id: str :param inherited: A value indicating whether this layout node has been inherited from a parent layout. This is expected to only be only set by the combiner. :type inherited: bool :param is_contribution: A value indicating if the layout node is contribution are not. :type is_contribution: bool :param label: Label for the group. :type label: str :param order: Order in which the group should appear in the section. :type order: int :param overridden: A value indicating whether this layout node has been overridden by a child layout. :type overridden: bool :param visible: A value indicating if the group should be hidden or not. :type visible: bool """ _attribute_map = { 'contribution': {'key': 'contribution', 'type': 'WitContribution'}, 'controls': {'key': 'controls', 'type': '[Control]'}, 'height': {'key': 'height', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'inherited': {'key': 'inherited', 'type': 'bool'}, 'is_contribution': {'key': 'isContribution', 'type': 'bool'}, 'label': {'key': 'label', 'type': 'str'}, 'order': {'key': 'order', 'type': 'int'}, 'overridden': {'key': 'overridden', 'type': 'bool'}, 'visible': {'key': 'visible', 'type': 'bool'} } def __init__(self, contribution=None, controls=None, height=None, id=None, inherited=None, is_contribution=None, label=None, order=None, overridden=None, visible=None): super(Group, self).__init__() self.contribution = contribution self.controls = controls self.height = height self.id = id self.inherited = inherited self.is_contribution = is_contribution self.label = label self.order = order self.overridden = overridden self.visible = visible class HideStateModel(Model): """HideStateModel. :param hidden: :type hidden: bool """ _attribute_map = { 'hidden': {'key': 'hidden', 'type': 'bool'} } def __init__(self, hidden=None): super(HideStateModel, self).__init__() self.hidden = hidden class Page(Model): """Page. :param contribution: Contribution for the page. :type contribution: :class:`WitContribution ` :param id: The id for the layout node. :type id: str :param inherited: A value indicating whether this layout node has been inherited from a parent layout. This is expected to only be only set by the combiner. :type inherited: bool :param is_contribution: A value indicating if the layout node is contribution are not. :type is_contribution: bool :param label: The label for the page. :type label: str :param locked: A value indicating whether any user operations are permitted on this page and the contents of this page :type locked: bool :param order: Order in which the page should appear in the layout. :type order: int :param overridden: A value indicating whether this layout node has been overridden by a child layout. :type overridden: bool :param page_type: The icon for the page. :type page_type: object :param sections: The sections of the page. :type sections: list of :class:`Section ` :param visible: A value indicating if the page should be hidden or not. :type visible: bool """ _attribute_map = { 'contribution': {'key': 'contribution', 'type': 'WitContribution'}, 'id': {'key': 'id', 'type': 'str'}, 'inherited': {'key': 'inherited', 'type': 'bool'}, 'is_contribution': {'key': 'isContribution', 'type': 'bool'}, 'label': {'key': 'label', 'type': 'str'}, 'locked': {'key': 'locked', 'type': 'bool'}, 'order': {'key': 'order', 'type': 'int'}, 'overridden': {'key': 'overridden', 'type': 'bool'}, 'page_type': {'key': 'pageType', 'type': 'object'}, 'sections': {'key': 'sections', 'type': '[Section]'}, 'visible': {'key': 'visible', 'type': 'bool'} } def __init__(self, contribution=None, id=None, inherited=None, is_contribution=None, label=None, locked=None, order=None, overridden=None, page_type=None, sections=None, visible=None): super(Page, self).__init__() self.contribution = contribution self.id = id self.inherited = inherited self.is_contribution = is_contribution self.label = label self.locked = locked self.order = order self.overridden = overridden self.page_type = page_type self.sections = sections self.visible = visible class PickListMetadata(Model): """PickListMetadata. :param id: ID of the picklist :type id: str :param is_suggested: Indicates whether items outside of suggested list are allowed :type is_suggested: bool :param name: Name of the picklist :type name: str :param type: DataType of picklist :type type: str :param url: Url of the picklist :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'is_suggested': {'key': 'isSuggested', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, is_suggested=None, name=None, type=None, url=None): super(PickListMetadata, self).__init__() self.id = id self.is_suggested = is_suggested self.name = name self.type = type self.url = url class ProcessBehavior(Model): """ProcessBehavior. :param color: Color. :type color: str :param customization: Indicates the type of customization on this work item. System behaviors are inherited from parent process but not modified. Inherited behaviors are modified modified behaviors that were inherited from parent process. Custom behaviors are behaviors created by user in current process. :type customization: object :param description: . Description :type description: str :param fields: Process Behavior Fields. :type fields: list of :class:`ProcessBehaviorField ` :param inherits: Parent behavior reference. :type inherits: :class:`ProcessBehaviorReference ` :param name: Behavior Name. :type name: str :param rank: Rank of the behavior :type rank: int :param reference_name: Behavior Id :type reference_name: str :param url: Url of the behavior. :type url: str """ _attribute_map = { 'color': {'key': 'color', 'type': 'str'}, 'customization': {'key': 'customization', 'type': 'object'}, 'description': {'key': 'description', 'type': 'str'}, 'fields': {'key': 'fields', 'type': '[ProcessBehaviorField]'}, 'inherits': {'key': 'inherits', 'type': 'ProcessBehaviorReference'}, 'name': {'key': 'name', 'type': 'str'}, 'rank': {'key': 'rank', 'type': 'int'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, color=None, customization=None, description=None, fields=None, inherits=None, name=None, rank=None, reference_name=None, url=None): super(ProcessBehavior, self).__init__() self.color = color self.customization = customization self.description = description self.fields = fields self.inherits = inherits self.name = name self.rank = rank self.reference_name = reference_name self.url = url class ProcessBehaviorCreateRequest(Model): """ProcessBehaviorCreateRequest. :param color: Color. :type color: str :param inherits: Parent behavior id. :type inherits: str :param name: Name of the behavior. :type name: str :param reference_name: ReferenceName is optional, if not specified will be auto-generated. :type reference_name: str """ _attribute_map = { 'color': {'key': 'color', 'type': 'str'}, 'inherits': {'key': 'inherits', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'} } def __init__(self, color=None, inherits=None, name=None, reference_name=None): super(ProcessBehaviorCreateRequest, self).__init__() self.color = color self.inherits = inherits self.name = name self.reference_name = reference_name class ProcessBehaviorField(Model): """ProcessBehaviorField. :param name: Name of the field. :type name: str :param reference_name: Reference name of the field. :type reference_name: str :param url: Url to field. :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, reference_name=None, url=None): super(ProcessBehaviorField, self).__init__() self.name = name self.reference_name = reference_name self.url = url class ProcessBehaviorReference(Model): """ProcessBehaviorReference. :param behavior_ref_name: Id of a Behavior. :type behavior_ref_name: str :param url: Url to behavior. :type url: str """ _attribute_map = { 'behavior_ref_name': {'key': 'behaviorRefName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, behavior_ref_name=None, url=None): super(ProcessBehaviorReference, self).__init__() self.behavior_ref_name = behavior_ref_name self.url = url class ProcessBehaviorUpdateRequest(Model): """ProcessBehaviorUpdateRequest. :param color: Color. :type color: str :param name: Behavior Name. :type name: str """ _attribute_map = { 'color': {'key': 'color', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, color=None, name=None): super(ProcessBehaviorUpdateRequest, self).__init__() self.color = color self.name = name class ProcessInfo(Model): """ProcessInfo. :param customization_type: Indicates the type of customization on this process. System Process is default process. Inherited Process is modified process that was System process before. :type customization_type: object :param description: Description of the process. :type description: str :param is_default: Is the process default. :type is_default: bool :param is_enabled: Is the process enabled. :type is_enabled: bool :param name: Name of the process. :type name: str :param parent_process_type_id: ID of the parent process. :type parent_process_type_id: str :param projects: Projects in this process to which the user is subscribed to. :type projects: list of :class:`ProjectReference ` :param reference_name: Reference name of the process. :type reference_name: str :param type_id: The ID of the process. :type type_id: str """ _attribute_map = { 'customization_type': {'key': 'customizationType', 'type': 'object'}, 'description': {'key': 'description', 'type': 'str'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'parent_process_type_id': {'key': 'parentProcessTypeId', 'type': 'str'}, 'projects': {'key': 'projects', 'type': '[ProjectReference]'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'type_id': {'key': 'typeId', 'type': 'str'} } def __init__(self, customization_type=None, description=None, is_default=None, is_enabled=None, name=None, parent_process_type_id=None, projects=None, reference_name=None, type_id=None): super(ProcessInfo, self).__init__() self.customization_type = customization_type self.description = description self.is_default = is_default self.is_enabled = is_enabled self.name = name self.parent_process_type_id = parent_process_type_id self.projects = projects self.reference_name = reference_name self.type_id = type_id class ProcessModel(Model): """ProcessModel. :param description: Description of the process :type description: str :param name: Name of the process :type name: str :param projects: Projects in this process :type projects: list of :class:`ProjectReference ` :param properties: Properties of the process :type properties: :class:`ProcessProperties ` :param reference_name: Reference name of the process :type reference_name: str :param type_id: The ID of the process :type type_id: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'projects': {'key': 'projects', 'type': '[ProjectReference]'}, 'properties': {'key': 'properties', 'type': 'ProcessProperties'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'type_id': {'key': 'typeId', 'type': 'str'} } def __init__(self, description=None, name=None, projects=None, properties=None, reference_name=None, type_id=None): super(ProcessModel, self).__init__() self.description = description self.name = name self.projects = projects self.properties = properties self.reference_name = reference_name self.type_id = type_id class ProcessProperties(Model): """ProcessProperties. :param class_: Class of the process. :type class_: object :param is_default: Is the process default process. :type is_default: bool :param is_enabled: Is the process enabled. :type is_enabled: bool :param parent_process_type_id: ID of the parent process. :type parent_process_type_id: str :param version: Version of the process. :type version: str """ _attribute_map = { 'class_': {'key': 'class', 'type': 'object'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'parent_process_type_id': {'key': 'parentProcessTypeId', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, class_=None, is_default=None, is_enabled=None, parent_process_type_id=None, version=None): super(ProcessProperties, self).__init__() self.class_ = class_ self.is_default = is_default self.is_enabled = is_enabled self.parent_process_type_id = parent_process_type_id self.version = version class ProcessRule(CreateProcessRuleRequest): """ProcessRule. :param actions: List of actions to take when the rule is triggered. :type actions: list of :class:`RuleAction ` :param conditions: List of conditions when the rule should be triggered. :type conditions: list of :class:`RuleCondition ` :param is_disabled: Indicates if the rule is disabled. :type is_disabled: bool :param name: Name for the rule. :type name: str :param customization_type: Indicates if the rule is system generated or created by user. :type customization_type: object :param id: Id to uniquely identify the rule. :type id: str :param url: Resource Url. :type url: str """ _attribute_map = { 'actions': {'key': 'actions', 'type': '[RuleAction]'}, 'conditions': {'key': 'conditions', 'type': '[RuleCondition]'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'customization_type': {'key': 'customizationType', 'type': 'object'}, 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, actions=None, conditions=None, is_disabled=None, name=None, customization_type=None, id=None, url=None): super(ProcessRule, self).__init__(actions=actions, conditions=conditions, is_disabled=is_disabled, name=name) self.customization_type = customization_type self.id = id self.url = url class ProcessWorkItemType(Model): """ProcessWorkItemType. :param behaviors: :type behaviors: list of :class:`WorkItemTypeBehavior ` :param color: Color hexadecimal code to represent the work item type :type color: str :param customization: Indicates the type of customization on this work item System work item types are inherited from parent process but not modified Inherited work item types are modified work item that were inherited from parent process Custom work item types are work item types that were created in the current process :type customization: object :param description: Description of the work item type :type description: str :param icon: Icon to represent the work item typ :type icon: str :param inherits: Reference name of the parent work item type :type inherits: str :param is_disabled: Indicates if a work item type is disabled :type is_disabled: bool :param layout: :type layout: :class:`FormLayout ` :param name: Name of the work item type :type name: str :param reference_name: Reference name of work item type :type reference_name: str :param states: :type states: list of :class:`WorkItemStateResultModel ` :param url: Url of the work item type :type url: str """ _attribute_map = { 'behaviors': {'key': 'behaviors', 'type': '[WorkItemTypeBehavior]'}, 'color': {'key': 'color', 'type': 'str'}, 'customization': {'key': 'customization', 'type': 'object'}, 'description': {'key': 'description', 'type': 'str'}, 'icon': {'key': 'icon', 'type': 'str'}, 'inherits': {'key': 'inherits', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'layout': {'key': 'layout', 'type': 'FormLayout'}, 'name': {'key': 'name', 'type': 'str'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'states': {'key': 'states', 'type': '[WorkItemStateResultModel]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, behaviors=None, color=None, customization=None, description=None, icon=None, inherits=None, is_disabled=None, layout=None, name=None, reference_name=None, states=None, url=None): super(ProcessWorkItemType, self).__init__() self.behaviors = behaviors self.color = color self.customization = customization self.description = description self.icon = icon self.inherits = inherits self.is_disabled = is_disabled self.layout = layout self.name = name self.reference_name = reference_name self.states = states self.url = url class ProcessWorkItemTypeField(Model): """ProcessWorkItemTypeField. :param allow_groups: Allow setting field value to a group identity. Only applies to identity fields. :type allow_groups: bool :param customization: :type customization: object :param default_value: The default value of the field. :type default_value: object :param description: Description of the field. :type description: str :param name: Name of the field. :type name: str :param read_only: If true the field cannot be edited. :type read_only: bool :param reference_name: Reference name of the field. :type reference_name: str :param required: If true the field cannot be empty. :type required: bool :param type: Type of the field. :type type: object :param url: Resource URL of the field. :type url: str """ _attribute_map = { 'allow_groups': {'key': 'allowGroups', 'type': 'bool'}, 'customization': {'key': 'customization', 'type': 'object'}, 'default_value': {'key': 'defaultValue', 'type': 'object'}, 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'read_only': {'key': 'readOnly', 'type': 'bool'}, 'reference_name': {'key': 'referenceName', 'type': 'str'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, allow_groups=None, customization=None, default_value=None, description=None, name=None, read_only=None, reference_name=None, required=None, type=None, url=None): super(ProcessWorkItemTypeField, self).__init__() self.allow_groups = allow_groups self.customization = customization self.default_value = default_value self.description = description self.name = name self.read_only = read_only self.reference_name = reference_name self.required = required self.type = type self.url = url class ProjectReference(Model): """ProjectReference. :param description: Description of the project :type description: str :param id: The ID of the project :type id: str :param name: Name of the project :type name: str :param url: Url of the project :type url: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, description=None, id=None, name=None, url=None): super(ProjectReference, self).__init__() self.description = description self.id = id self.name = name self.url = url class RuleAction(Model): """RuleAction. :param action_type: Type of action to take when the rule is triggered. :type action_type: object :param target_field: Field on which the action should be taken. :type target_field: str :param value: Value to apply on target field, once the action is taken. :type value: str """ _attribute_map = { 'action_type': {'key': 'actionType', 'type': 'object'}, 'target_field': {'key': 'targetField', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, action_type=None, target_field=None, value=None): super(RuleAction, self).__init__() self.action_type = action_type self.target_field = target_field self.value = value class RuleActionModel(Model): """RuleActionModel. :param action_type: :type action_type: str :param target_field: :type target_field: str :param value: :type value: str """ _attribute_map = { 'action_type': {'key': 'actionType', 'type': 'str'}, 'target_field': {'key': 'targetField', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, action_type=None, target_field=None, value=None): super(RuleActionModel, self).__init__() self.action_type = action_type self.target_field = target_field self.value = value class RuleCondition(Model): """RuleCondition. :param condition_type: Type of condition. $When. This condition limits the execution of its children to cases when another field has a particular value, i.e. when the Is value of the referenced field is equal to the given literal value. $WhenNot.This condition limits the execution of its children to cases when another field does not have a particular value, i.e.when the Is value of the referenced field is not equal to the given literal value. $WhenChanged.This condition limits the execution of its children to cases when another field has changed, i.e.when the Is value of the referenced field is not equal to the Was value of that field. $WhenNotChanged.This condition limits the execution of its children to cases when another field has not changed, i.e.when the Is value of the referenced field is equal to the Was value of that field. :type condition_type: object :param field: Field that defines condition. :type field: str :param value: Value of field to define the condition for rule. :type value: str """ _attribute_map = { 'condition_type': {'key': 'conditionType', 'type': 'object'}, 'field': {'key': 'field', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, condition_type=None, field=None, value=None): super(RuleCondition, self).__init__() self.condition_type = condition_type self.field = field self.value = value class RuleConditionModel(Model): """RuleConditionModel. :param condition_type: :type condition_type: str :param field: :type field: str :param value: :type value: str """ _attribute_map = { 'condition_type': {'key': 'conditionType', 'type': 'str'}, 'field': {'key': 'field', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, condition_type=None, field=None, value=None): super(RuleConditionModel, self).__init__() self.condition_type = condition_type self.field = field self.value = value class Section(Model): """Section. :param groups: List of child groups in this section :type groups: list of :class:`Group ` :param id: The id for the layout node. :type id: str :param overridden: A value indicating whether this layout node has been overridden by a child layout. :type overridden: bool """ _attribute_map = { 'groups': {'key': 'groups', 'type': '[Group]'}, 'id': {'key': 'id', 'type': 'str'}, 'overridden': {'key': 'overridden', 'type': 'bool'} } def __init__(self, groups=None, id=None, overridden=None): super(Section, self).__init__() self.groups = groups self.id = id self.overridden = overridden class UpdateProcessModel(Model): """UpdateProcessModel. :param description: New description of the process :type description: str :param is_default: If true new projects will use this process by default :type is_default: bool :param is_enabled: If false the process will be disabled and cannot be used to create projects :type is_enabled: bool :param name: New name of the process :type name: str """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'is_enabled': {'key': 'isEnabled', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, description=None, is_default=None, is_enabled=None, name=None): super(UpdateProcessModel, self).__init__() self.description = description self.is_default = is_default self.is_enabled = is_enabled self.name = name class UpdateProcessRuleRequest(CreateProcessRuleRequest): """UpdateProcessRuleRequest. :param actions: List of actions to take when the rule is triggered. :type actions: list of :class:`RuleAction ` :param conditions: List of conditions when the rule should be triggered. :type conditions: list of :class:`RuleCondition ` :param is_disabled: Indicates if the rule is disabled. :type is_disabled: bool :param name: Name for the rule. :type name: str :param id: Id to uniquely identify the rule. :type id: str """ _attribute_map = { 'actions': {'key': 'actions', 'type': '[RuleAction]'}, 'conditions': {'key': 'conditions', 'type': '[RuleCondition]'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'} } def __init__(self, actions=None, conditions=None, is_disabled=None, name=None, id=None): super(UpdateProcessRuleRequest, self).__init__(actions=actions, conditions=conditions, is_disabled=is_disabled, name=name) self.id = id class UpdateProcessWorkItemTypeFieldRequest(Model): """UpdateProcessWorkItemTypeFieldRequest. :param allow_groups: Allow setting field value to a group identity. Only applies to identity fields. :type allow_groups: bool :param default_value: The default value of the field. :type default_value: object :param read_only: If true the field cannot be edited. :type read_only: bool :param required: The default value of the field. :type required: bool """ _attribute_map = { 'allow_groups': {'key': 'allowGroups', 'type': 'bool'}, 'default_value': {'key': 'defaultValue', 'type': 'object'}, 'read_only': {'key': 'readOnly', 'type': 'bool'}, 'required': {'key': 'required', 'type': 'bool'} } def __init__(self, allow_groups=None, default_value=None, read_only=None, required=None): super(UpdateProcessWorkItemTypeFieldRequest, self).__init__() self.allow_groups = allow_groups self.default_value = default_value self.read_only = read_only self.required = required class UpdateProcessWorkItemTypeRequest(Model): """UpdateProcessWorkItemTypeRequest. :param color: Color of the work item type :type color: str :param description: Description of the work item type :type description: str :param icon: Icon of the work item type :type icon: str :param is_disabled: If set will disable the work item type :type is_disabled: bool """ _attribute_map = { 'color': {'key': 'color', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'icon': {'key': 'icon', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'} } def __init__(self, color=None, description=None, icon=None, is_disabled=None): super(UpdateProcessWorkItemTypeRequest, self).__init__() self.color = color self.description = description self.icon = icon self.is_disabled = is_disabled class WitContribution(Model): """WitContribution. :param contribution_id: The id for the contribution. :type contribution_id: str :param height: The height for the contribution. :type height: int :param inputs: A dictionary holding key value pairs for contribution inputs. :type inputs: dict :param show_on_deleted_work_item: A value indicating if the contribution should be show on deleted workItem. :type show_on_deleted_work_item: bool """ _attribute_map = { 'contribution_id': {'key': 'contributionId', 'type': 'str'}, 'height': {'key': 'height', 'type': 'int'}, 'inputs': {'key': 'inputs', 'type': '{object}'}, 'show_on_deleted_work_item': {'key': 'showOnDeletedWorkItem', 'type': 'bool'} } def __init__(self, contribution_id=None, height=None, inputs=None, show_on_deleted_work_item=None): super(WitContribution, self).__init__() self.contribution_id = contribution_id self.height = height self.inputs = inputs self.show_on_deleted_work_item = show_on_deleted_work_item class WorkItemBehavior(Model): """WorkItemBehavior. :param abstract: :type abstract: bool :param color: :type color: str :param description: :type description: str :param fields: :type fields: list of :class:`WorkItemBehaviorField ` :param id: :type id: str :param inherits: :type inherits: :class:`WorkItemBehaviorReference ` :param name: :type name: str :param overriden: :type overriden: bool :param rank: :type rank: int :param url: :type url: str """ _attribute_map = { 'abstract': {'key': 'abstract', 'type': 'bool'}, 'color': {'key': 'color', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'fields': {'key': 'fields', 'type': '[WorkItemBehaviorField]'}, 'id': {'key': 'id', 'type': 'str'}, 'inherits': {'key': 'inherits', 'type': 'WorkItemBehaviorReference'}, 'name': {'key': 'name', 'type': 'str'}, 'overriden': {'key': 'overriden', 'type': 'bool'}, 'rank': {'key': 'rank', 'type': 'int'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, abstract=None, color=None, description=None, fields=None, id=None, inherits=None, name=None, overriden=None, rank=None, url=None): super(WorkItemBehavior, self).__init__() self.abstract = abstract self.color = color self.description = description self.fields = fields self.id = id self.inherits = inherits self.name = name self.overriden = overriden self.rank = rank self.url = url class WorkItemBehaviorField(Model): """WorkItemBehaviorField. :param behavior_field_id: :type behavior_field_id: str :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'behavior_field_id': {'key': 'behaviorFieldId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, behavior_field_id=None, id=None, url=None): super(WorkItemBehaviorField, self).__init__() self.behavior_field_id = behavior_field_id self.id = id self.url = url class WorkItemBehaviorReference(Model): """WorkItemBehaviorReference. :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(WorkItemBehaviorReference, self).__init__() self.id = id self.url = url class WorkItemStateInputModel(Model): """WorkItemStateInputModel. :param color: Color of the state :type color: str :param name: Name of the state :type name: str :param order: Order in which state should appear :type order: int :param state_category: Category of the state :type state_category: str """ _attribute_map = { 'color': {'key': 'color', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'order': {'key': 'order', 'type': 'int'}, 'state_category': {'key': 'stateCategory', 'type': 'str'} } def __init__(self, color=None, name=None, order=None, state_category=None): super(WorkItemStateInputModel, self).__init__() self.color = color self.name = name self.order = order self.state_category = state_category class WorkItemStateResultModel(Model): """WorkItemStateResultModel. :param color: :type color: str :param customization_type: :type customization_type: object :param hidden: :type hidden: bool :param id: :type id: str :param name: :type name: str :param order: :type order: int :param state_category: :type state_category: str :param url: :type url: str """ _attribute_map = { 'color': {'key': 'color', 'type': 'str'}, 'customization_type': {'key': 'customizationType', 'type': 'object'}, 'hidden': {'key': 'hidden', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'order': {'key': 'order', 'type': 'int'}, 'state_category': {'key': 'stateCategory', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, color=None, customization_type=None, hidden=None, id=None, name=None, order=None, state_category=None, url=None): super(WorkItemStateResultModel, self).__init__() self.color = color self.customization_type = customization_type self.hidden = hidden self.id = id self.name = name self.order = order self.state_category = state_category self.url = url class WorkItemTypeBehavior(Model): """WorkItemTypeBehavior. :param behavior: Reference to the behavior of a work item type :type behavior: :class:`WorkItemBehaviorReference ` :param is_default: If true the work item type is the default work item type in the behavior :type is_default: bool :param url: URL of the work item type behavior :type url: str """ _attribute_map = { 'behavior': {'key': 'behavior', 'type': 'WorkItemBehaviorReference'}, 'is_default': {'key': 'isDefault', 'type': 'bool'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, behavior=None, is_default=None, url=None): super(WorkItemTypeBehavior, self).__init__() self.behavior = behavior self.is_default = is_default self.url = url class WorkItemTypeModel(Model): """WorkItemTypeModel. :param behaviors: :type behaviors: list of :class:`WorkItemTypeBehavior ` :param class_: :type class_: object :param color: :type color: str :param description: :type description: str :param icon: :type icon: str :param id: :type id: str :param inherits: Parent WIT Id/Internal ReferenceName that it inherits from :type inherits: str :param is_disabled: :type is_disabled: bool :param layout: :type layout: :class:`FormLayout ` :param name: :type name: str :param states: :type states: list of :class:`WorkItemStateResultModel ` :param url: :type url: str """ _attribute_map = { 'behaviors': {'key': 'behaviors', 'type': '[WorkItemTypeBehavior]'}, 'class_': {'key': 'class', 'type': 'object'}, 'color': {'key': 'color', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'icon': {'key': 'icon', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'inherits': {'key': 'inherits', 'type': 'str'}, 'is_disabled': {'key': 'isDisabled', 'type': 'bool'}, 'layout': {'key': 'layout', 'type': 'FormLayout'}, 'name': {'key': 'name', 'type': 'str'}, 'states': {'key': 'states', 'type': '[WorkItemStateResultModel]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, behaviors=None, class_=None, color=None, description=None, icon=None, id=None, inherits=None, is_disabled=None, layout=None, name=None, states=None, url=None): super(WorkItemTypeModel, self).__init__() self.behaviors = behaviors self.class_ = class_ self.color = color self.description = description self.icon = icon self.id = id self.inherits = inherits self.is_disabled = is_disabled self.layout = layout self.name = name self.states = states self.url = url class PickList(PickListMetadata): """PickList. :param id: ID of the picklist :type id: str :param is_suggested: Indicates whether items outside of suggested list are allowed :type is_suggested: bool :param name: Name of the picklist :type name: str :param type: DataType of picklist :type type: str :param url: Url of the picklist :type url: str :param items: A list of PicklistItemModel. :type items: list of str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'is_suggested': {'key': 'isSuggested', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'items': {'key': 'items', 'type': '[str]'} } def __init__(self, id=None, is_suggested=None, name=None, type=None, url=None, items=None): super(PickList, self).__init__(id=id, is_suggested=is_suggested, name=name, type=type, url=url) self.items = items __all__ = [ 'AddProcessWorkItemTypeFieldRequest', 'Control', 'CreateProcessModel', 'CreateProcessRuleRequest', 'CreateProcessWorkItemTypeRequest', 'Extension', 'FieldModel', 'FieldRuleModel', 'FormLayout', 'Group', 'HideStateModel', 'Page', 'PickListMetadata', 'ProcessBehavior', 'ProcessBehaviorCreateRequest', 'ProcessBehaviorField', 'ProcessBehaviorReference', 'ProcessBehaviorUpdateRequest', 'ProcessInfo', 'ProcessModel', 'ProcessProperties', 'ProcessRule', 'ProcessWorkItemType', 'ProcessWorkItemTypeField', 'ProjectReference', 'RuleAction', 'RuleActionModel', 'RuleCondition', 'RuleConditionModel', 'Section', 'UpdateProcessModel', 'UpdateProcessRuleRequest', 'UpdateProcessWorkItemTypeFieldRequest', 'UpdateProcessWorkItemTypeRequest', 'WitContribution', 'WorkItemBehavior', 'WorkItemBehaviorField', 'WorkItemBehaviorReference', 'WorkItemStateInputModel', 'WorkItemStateResultModel', 'WorkItemTypeBehavior', 'WorkItemTypeModel', 'PickList', ] work_item_tracking_process_client.py000066400000000000000000002004651360605530400437550ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking_process# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class WorkItemTrackingProcessClient(Client): """WorkItemTrackingProcess :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(WorkItemTrackingProcessClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '5264459e-e5e0-4bd8-b118-0985e68a4ec5' def create_process_behavior(self, behavior, process_id): """CreateProcessBehavior. [Preview API] Creates a single behavior in the given process. :param :class:` ` behavior: :param str process_id: The ID of the process :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') content = self._serialize.body(behavior, 'ProcessBehaviorCreateRequest') response = self._send(http_method='POST', location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ProcessBehavior', response) def delete_process_behavior(self, process_id, behavior_ref_name): """DeleteProcessBehavior. [Preview API] Removes a behavior in the process. :param str process_id: The ID of the process :param str behavior_ref_name: The reference name of the behavior """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if behavior_ref_name is not None: route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') self._send(http_method='DELETE', location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', version='5.0-preview.2', route_values=route_values) def get_process_behavior(self, process_id, behavior_ref_name, expand=None): """GetProcessBehavior. [Preview API] Returns a behavior of the process. :param str process_id: The ID of the process :param str behavior_ref_name: The reference name of the behavior :param str expand: :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if behavior_ref_name is not None: route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ProcessBehavior', response) def get_process_behaviors(self, process_id, expand=None): """GetProcessBehaviors. [Preview API] Returns a list of all behaviors in the process. :param str process_id: The ID of the process :param str expand: :rtype: [ProcessBehavior] """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ProcessBehavior]', self._unwrap_collection(response)) def update_process_behavior(self, behavior_data, process_id, behavior_ref_name): """UpdateProcessBehavior. [Preview API] Replaces a behavior in the process. :param :class:` ` behavior_data: :param str process_id: The ID of the process :param str behavior_ref_name: The reference name of the behavior :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if behavior_ref_name is not None: route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') content = self._serialize.body(behavior_data, 'ProcessBehaviorUpdateRequest') response = self._send(http_method='PUT', location_id='d1800200-f184-4e75-a5f2-ad0b04b4373e', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ProcessBehavior', response) def create_control_in_group(self, control, process_id, wit_ref_name, group_id): """CreateControlInGroup. [Preview API] Creates a control in a group. :param :class:` ` control: The control. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str group_id: The ID of the group to add the control to. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') content = self._serialize.body(control, 'Control') response = self._send(http_method='POST', location_id='1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Control', response) def move_control_to_group(self, control, process_id, wit_ref_name, group_id, control_id, remove_from_group_id=None): """MoveControlToGroup. [Preview API] Moves a control to a specified group. :param :class:` ` control: The control. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str group_id: The ID of the group to move the control to. :param str control_id: The ID of the control. :param str remove_from_group_id: The group ID to remove the control from. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if control_id is not None: route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') query_parameters = {} if remove_from_group_id is not None: query_parameters['removeFromGroupId'] = self._serialize.query('remove_from_group_id', remove_from_group_id, 'str') content = self._serialize.body(control, 'Control') response = self._send(http_method='PUT', location_id='1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Control', response) def remove_control_from_group(self, process_id, wit_ref_name, group_id, control_id): """RemoveControlFromGroup. [Preview API] Removes a control from the work item form. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str group_id: The ID of the group. :param str control_id: The ID of the control to remove. """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if control_id is not None: route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') self._send(http_method='DELETE', location_id='1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58', version='5.0-preview.1', route_values=route_values) def update_control(self, control, process_id, wit_ref_name, group_id, control_id): """UpdateControl. [Preview API] Updates a control on the work item form. :param :class:` ` control: The updated control. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str group_id: The ID of the group. :param str control_id: The ID of the control. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') if control_id is not None: route_values['controlId'] = self._serialize.url('control_id', control_id, 'str') content = self._serialize.body(control, 'Control') response = self._send(http_method='PATCH', location_id='1f59b363-a2d0-4b7e-9bc6-eb9f5f3f0e58', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Control', response) def add_field_to_work_item_type(self, field, process_id, wit_ref_name): """AddFieldToWorkItemType. [Preview API] Adds a field to a work item type. :param :class:` ` field: :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') content = self._serialize.body(field, 'AddProcessWorkItemTypeFieldRequest') response = self._send(http_method='POST', location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ProcessWorkItemTypeField', response) def get_all_work_item_type_fields(self, process_id, wit_ref_name): """GetAllWorkItemTypeFields. [Preview API] Returns a list of all fields in a work item type. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :rtype: [ProcessWorkItemTypeField] """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') response = self._send(http_method='GET', location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', version='5.0-preview.2', route_values=route_values) return self._deserialize('[ProcessWorkItemTypeField]', self._unwrap_collection(response)) def get_work_item_type_field(self, process_id, wit_ref_name, field_ref_name): """GetWorkItemTypeField. [Preview API] Returns a field in a work item type. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str field_ref_name: The reference name of the field. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if field_ref_name is not None: route_values['fieldRefName'] = self._serialize.url('field_ref_name', field_ref_name, 'str') response = self._send(http_method='GET', location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', version='5.0-preview.2', route_values=route_values) return self._deserialize('ProcessWorkItemTypeField', response) def remove_work_item_type_field(self, process_id, wit_ref_name, field_ref_name): """RemoveWorkItemTypeField. [Preview API] Removes a field from a work item type. Does not permanently delete the field. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str field_ref_name: The reference name of the field. """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if field_ref_name is not None: route_values['fieldRefName'] = self._serialize.url('field_ref_name', field_ref_name, 'str') self._send(http_method='DELETE', location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', version='5.0-preview.2', route_values=route_values) def update_work_item_type_field(self, field, process_id, wit_ref_name, field_ref_name): """UpdateWorkItemTypeField. [Preview API] Updates a field in a work item type. :param :class:` ` field: :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str field_ref_name: The reference name of the field. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if field_ref_name is not None: route_values['fieldRefName'] = self._serialize.url('field_ref_name', field_ref_name, 'str') content = self._serialize.body(field, 'UpdateProcessWorkItemTypeFieldRequest') response = self._send(http_method='PATCH', location_id='bc0ad8dc-e3f3-46b0-b06c-5bf861793196', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ProcessWorkItemTypeField', response) def add_group(self, group, process_id, wit_ref_name, page_id, section_id): """AddGroup. [Preview API] Adds a group to the work item form. :param :class:` ` group: The group. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str page_id: The ID of the page to add the group to. :param str section_id: The ID of the section to add the group to. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if page_id is not None: route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') if section_id is not None: route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') content = self._serialize.body(group, 'Group') response = self._send(http_method='POST', location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Group', response) def move_group_to_page(self, group, process_id, wit_ref_name, page_id, section_id, group_id, remove_from_page_id, remove_from_section_id): """MoveGroupToPage. [Preview API] Moves a group to a different page and section. :param :class:` ` group: The updated group. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str page_id: The ID of the page the group is in. :param str section_id: The ID of the section the group is i.n :param str group_id: The ID of the group. :param str remove_from_page_id: ID of the page to remove the group from. :param str remove_from_section_id: ID of the section to remove the group from. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if page_id is not None: route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') if section_id is not None: route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') query_parameters = {} if remove_from_page_id is not None: query_parameters['removeFromPageId'] = self._serialize.query('remove_from_page_id', remove_from_page_id, 'str') if remove_from_section_id is not None: query_parameters['removeFromSectionId'] = self._serialize.query('remove_from_section_id', remove_from_section_id, 'str') content = self._serialize.body(group, 'Group') response = self._send(http_method='PUT', location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Group', response) def move_group_to_section(self, group, process_id, wit_ref_name, page_id, section_id, group_id, remove_from_section_id): """MoveGroupToSection. [Preview API] Moves a group to a different section. :param :class:` ` group: The updated group. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str page_id: The ID of the page the group is in. :param str section_id: The ID of the section the group is in. :param str group_id: The ID of the group. :param str remove_from_section_id: ID of the section to remove the group from. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if page_id is not None: route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') if section_id is not None: route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') query_parameters = {} if remove_from_section_id is not None: query_parameters['removeFromSectionId'] = self._serialize.query('remove_from_section_id', remove_from_section_id, 'str') content = self._serialize.body(group, 'Group') response = self._send(http_method='PUT', location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Group', response) def remove_group(self, process_id, wit_ref_name, page_id, section_id, group_id): """RemoveGroup. [Preview API] Removes a group from the work item form. :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :param str page_id: The ID of the page the group is in :param str section_id: The ID of the section to the group is in :param str group_id: The ID of the group """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if page_id is not None: route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') if section_id is not None: route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') self._send(http_method='DELETE', location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', version='5.0-preview.1', route_values=route_values) def update_group(self, group, process_id, wit_ref_name, page_id, section_id, group_id): """UpdateGroup. [Preview API] Updates a group in the work item form. :param :class:` ` group: The updated group. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :param str page_id: The ID of the page the group is in. :param str section_id: The ID of the section the group is in. :param str group_id: The ID of the group. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if page_id is not None: route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') if section_id is not None: route_values['sectionId'] = self._serialize.url('section_id', section_id, 'str') if group_id is not None: route_values['groupId'] = self._serialize.url('group_id', group_id, 'str') content = self._serialize.body(group, 'Group') response = self._send(http_method='PATCH', location_id='766e44e1-36a8-41d7-9050-c343ff02f7a5', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Group', response) def get_form_layout(self, process_id, wit_ref_name): """GetFormLayout. [Preview API] Gets the form layout. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') response = self._send(http_method='GET', location_id='fa8646eb-43cd-4b71-9564-40106fd63e40', version='5.0-preview.1', route_values=route_values) return self._deserialize('FormLayout', response) def create_list(self, picklist): """CreateList. [Preview API] Creates a picklist. :param :class:` ` picklist: Picklist :rtype: :class:` ` """ content = self._serialize.body(picklist, 'PickList') response = self._send(http_method='POST', location_id='01e15468-e27c-4e20-a974-bd957dcccebc', version='5.0-preview.1', content=content) return self._deserialize('PickList', response) def delete_list(self, list_id): """DeleteList. [Preview API] Removes a picklist. :param str list_id: The ID of the list """ route_values = {} if list_id is not None: route_values['listId'] = self._serialize.url('list_id', list_id, 'str') self._send(http_method='DELETE', location_id='01e15468-e27c-4e20-a974-bd957dcccebc', version='5.0-preview.1', route_values=route_values) def get_list(self, list_id): """GetList. [Preview API] Returns a picklist. :param str list_id: The ID of the list :rtype: :class:` ` """ route_values = {} if list_id is not None: route_values['listId'] = self._serialize.url('list_id', list_id, 'str') response = self._send(http_method='GET', location_id='01e15468-e27c-4e20-a974-bd957dcccebc', version='5.0-preview.1', route_values=route_values) return self._deserialize('PickList', response) def get_lists_metadata(self): """GetListsMetadata. [Preview API] Returns meta data of the picklist. :rtype: [PickListMetadata] """ response = self._send(http_method='GET', location_id='01e15468-e27c-4e20-a974-bd957dcccebc', version='5.0-preview.1') return self._deserialize('[PickListMetadata]', self._unwrap_collection(response)) def update_list(self, picklist, list_id): """UpdateList. [Preview API] Updates a list. :param :class:` ` picklist: :param str list_id: The ID of the list :rtype: :class:` ` """ route_values = {} if list_id is not None: route_values['listId'] = self._serialize.url('list_id', list_id, 'str') content = self._serialize.body(picklist, 'PickList') response = self._send(http_method='PUT', location_id='01e15468-e27c-4e20-a974-bd957dcccebc', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('PickList', response) def add_page(self, page, process_id, wit_ref_name): """AddPage. [Preview API] Adds a page to the work item form. :param :class:` ` page: The page. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') content = self._serialize.body(page, 'Page') response = self._send(http_method='POST', location_id='1cc7b29f-6697-4d9d-b0a1-2650d3e1d584', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Page', response) def remove_page(self, process_id, wit_ref_name, page_id): """RemovePage. [Preview API] Removes a page from the work item form :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :param str page_id: The ID of the page """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if page_id is not None: route_values['pageId'] = self._serialize.url('page_id', page_id, 'str') self._send(http_method='DELETE', location_id='1cc7b29f-6697-4d9d-b0a1-2650d3e1d584', version='5.0-preview.1', route_values=route_values) def update_page(self, page, process_id, wit_ref_name): """UpdatePage. [Preview API] Updates a page on the work item form :param :class:` ` page: The page :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') content = self._serialize.body(page, 'Page') response = self._send(http_method='PATCH', location_id='1cc7b29f-6697-4d9d-b0a1-2650d3e1d584', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('Page', response) def create_new_process(self, create_request): """CreateNewProcess. [Preview API] Creates a process. :param :class:` ` create_request: CreateProcessModel. :rtype: :class:` ` """ content = self._serialize.body(create_request, 'CreateProcessModel') response = self._send(http_method='POST', location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', version='5.0-preview.2', content=content) return self._deserialize('ProcessInfo', response) def delete_process_by_id(self, process_type_id): """DeleteProcessById. [Preview API] Removes a process of a specific ID. :param str process_type_id: """ route_values = {} if process_type_id is not None: route_values['processTypeId'] = self._serialize.url('process_type_id', process_type_id, 'str') self._send(http_method='DELETE', location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', version='5.0-preview.2', route_values=route_values) def edit_process(self, update_request, process_type_id): """EditProcess. [Preview API] Edit a process of a specific ID. :param :class:` ` update_request: :param str process_type_id: :rtype: :class:` ` """ route_values = {} if process_type_id is not None: route_values['processTypeId'] = self._serialize.url('process_type_id', process_type_id, 'str') content = self._serialize.body(update_request, 'UpdateProcessModel') response = self._send(http_method='PATCH', location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ProcessInfo', response) def get_list_of_processes(self, expand=None): """GetListOfProcesses. [Preview API] Get list of all processes including system and inherited. :param str expand: :rtype: [ProcessInfo] """ query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', version='5.0-preview.2', query_parameters=query_parameters) return self._deserialize('[ProcessInfo]', self._unwrap_collection(response)) def get_process_by_its_id(self, process_type_id, expand=None): """GetProcessByItsId. [Preview API] Get a single process of a specified ID. :param str process_type_id: :param str expand: :rtype: :class:` ` """ route_values = {} if process_type_id is not None: route_values['processTypeId'] = self._serialize.url('process_type_id', process_type_id, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='02cc6a73-5cfb-427d-8c8e-b49fb086e8af', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ProcessInfo', response) def add_process_work_item_type_rule(self, process_rule_create, process_id, wit_ref_name): """AddProcessWorkItemTypeRule. [Preview API] Adds a rule to work item type in the process. :param :class:` ` process_rule_create: :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') content = self._serialize.body(process_rule_create, 'CreateProcessRuleRequest') response = self._send(http_method='POST', location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ProcessRule', response) def delete_process_work_item_type_rule(self, process_id, wit_ref_name, rule_id): """DeleteProcessWorkItemTypeRule. [Preview API] Removes a rule from the work item type in the process. :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :param str rule_id: The ID of the rule """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if rule_id is not None: route_values['ruleId'] = self._serialize.url('rule_id', rule_id, 'str') self._send(http_method='DELETE', location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', version='5.0-preview.2', route_values=route_values) def get_process_work_item_type_rule(self, process_id, wit_ref_name, rule_id): """GetProcessWorkItemTypeRule. [Preview API] Returns a single rule in the work item type of the process. :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :param str rule_id: The ID of the rule :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if rule_id is not None: route_values['ruleId'] = self._serialize.url('rule_id', rule_id, 'str') response = self._send(http_method='GET', location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', version='5.0-preview.2', route_values=route_values) return self._deserialize('ProcessRule', response) def get_process_work_item_type_rules(self, process_id, wit_ref_name): """GetProcessWorkItemTypeRules. [Preview API] Returns a list of all rules in the work item type of the process. :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :rtype: [ProcessRule] """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') response = self._send(http_method='GET', location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', version='5.0-preview.2', route_values=route_values) return self._deserialize('[ProcessRule]', self._unwrap_collection(response)) def update_process_work_item_type_rule(self, process_rule, process_id, wit_ref_name, rule_id): """UpdateProcessWorkItemTypeRule. [Preview API] Updates a rule in the work item type of the process. :param :class:` ` process_rule: :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :param str rule_id: The ID of the rule :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if rule_id is not None: route_values['ruleId'] = self._serialize.url('rule_id', rule_id, 'str') content = self._serialize.body(process_rule, 'UpdateProcessRuleRequest') response = self._send(http_method='PUT', location_id='76fe3432-d825-479d-a5f6-983bbb78b4f3', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ProcessRule', response) def create_state_definition(self, state_model, process_id, wit_ref_name): """CreateStateDefinition. [Preview API] Creates a state definition in the work item type of the process. :param :class:` ` state_model: :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') content = self._serialize.body(state_model, 'WorkItemStateInputModel') response = self._send(http_method='POST', location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WorkItemStateResultModel', response) def delete_state_definition(self, process_id, wit_ref_name, state_id): """DeleteStateDefinition. [Preview API] Removes a state definition in the work item type of the process. :param str process_id: ID of the process :param str wit_ref_name: The reference name of the work item type :param str state_id: ID of the state """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if state_id is not None: route_values['stateId'] = self._serialize.url('state_id', state_id, 'str') self._send(http_method='DELETE', location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', version='5.0-preview.1', route_values=route_values) def get_state_definition(self, process_id, wit_ref_name, state_id): """GetStateDefinition. [Preview API] Returns a single state definition in a work item type of the process. :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :param str state_id: The ID of the state :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if state_id is not None: route_values['stateId'] = self._serialize.url('state_id', state_id, 'str') response = self._send(http_method='GET', location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', version='5.0-preview.1', route_values=route_values) return self._deserialize('WorkItemStateResultModel', response) def get_state_definitions(self, process_id, wit_ref_name): """GetStateDefinitions. [Preview API] Returns a list of all state definitions in a work item type of the process. :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :rtype: [WorkItemStateResultModel] """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') response = self._send(http_method='GET', location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', version='5.0-preview.1', route_values=route_values) return self._deserialize('[WorkItemStateResultModel]', self._unwrap_collection(response)) def hide_state_definition(self, hide_state_model, process_id, wit_ref_name, state_id): """HideStateDefinition. [Preview API] Hides a state definition in the work item type of the process.Only states with customizationType:System can be hidden. :param :class:` ` hide_state_model: :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :param str state_id: The ID of the state :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if state_id is not None: route_values['stateId'] = self._serialize.url('state_id', state_id, 'str') content = self._serialize.body(hide_state_model, 'HideStateModel') response = self._send(http_method='PUT', location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WorkItemStateResultModel', response) def update_state_definition(self, state_model, process_id, wit_ref_name, state_id): """UpdateStateDefinition. [Preview API] Updates a given state definition in the work item type of the process. :param :class:` ` state_model: :param str process_id: ID of the process :param str wit_ref_name: The reference name of the work item type :param str state_id: ID of the state :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') if state_id is not None: route_values['stateId'] = self._serialize.url('state_id', state_id, 'str') content = self._serialize.body(state_model, 'WorkItemStateInputModel') response = self._send(http_method='PATCH', location_id='31015d57-2dff-4a46-adb3-2fb4ee3dcec9', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WorkItemStateResultModel', response) def create_process_work_item_type(self, work_item_type, process_id): """CreateProcessWorkItemType. [Preview API] Creates a work item type in the process. :param :class:` ` work_item_type: :param str process_id: The ID of the process on which to create work item type. :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') content = self._serialize.body(work_item_type, 'CreateProcessWorkItemTypeRequest') response = self._send(http_method='POST', location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ProcessWorkItemType', response) def delete_process_work_item_type(self, process_id, wit_ref_name): """DeleteProcessWorkItemType. [Preview API] Removes a work itewm type in the process. :param str process_id: The ID of the process. :param str wit_ref_name: The reference name of the work item type. """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') self._send(http_method='DELETE', location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', version='5.0-preview.2', route_values=route_values) def get_process_work_item_type(self, process_id, wit_ref_name, expand=None): """GetProcessWorkItemType. [Preview API] Returns a single work item type in a process. :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :param str expand: Flag to determine what properties of work item type to return :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('ProcessWorkItemType', response) def get_process_work_item_types(self, process_id, expand=None): """GetProcessWorkItemTypes. [Preview API] Returns a list of all work item types in a process. :param str process_id: The ID of the process :param str expand: Flag to determine what properties of work item type to return :rtype: [ProcessWorkItemType] """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') query_parameters = {} if expand is not None: query_parameters['$expand'] = self._serialize.query('expand', expand, 'str') response = self._send(http_method='GET', location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', version='5.0-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ProcessWorkItemType]', self._unwrap_collection(response)) def update_process_work_item_type(self, work_item_type_update, process_id, wit_ref_name): """UpdateProcessWorkItemType. [Preview API] Updates a work item type of the process. :param :class:` ` work_item_type_update: :param str process_id: The ID of the process :param str wit_ref_name: The reference name of the work item type :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name is not None: route_values['witRefName'] = self._serialize.url('wit_ref_name', wit_ref_name, 'str') content = self._serialize.body(work_item_type_update, 'UpdateProcessWorkItemTypeRequest') response = self._send(http_method='PATCH', location_id='e2e9d1a6-432d-4062-8870-bfcb8c324ad7', version='5.0-preview.2', route_values=route_values, content=content) return self._deserialize('ProcessWorkItemType', response) def add_behavior_to_work_item_type(self, behavior, process_id, wit_ref_name_for_behaviors): """AddBehaviorToWorkItemType. [Preview API] Adds a behavior to the work item type of the process. :param :class:` ` behavior: :param str process_id: The ID of the process :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name_for_behaviors is not None: route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') content = self._serialize.body(behavior, 'WorkItemTypeBehavior') response = self._send(http_method='POST', location_id='6d765a2e-4e1b-4b11-be93-f953be676024', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WorkItemTypeBehavior', response) def get_behavior_for_work_item_type(self, process_id, wit_ref_name_for_behaviors, behavior_ref_name): """GetBehaviorForWorkItemType. [Preview API] Returns a behavior for the work item type of the process. :param str process_id: The ID of the process :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior :param str behavior_ref_name: The reference name of the behavior :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name_for_behaviors is not None: route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') if behavior_ref_name is not None: route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') response = self._send(http_method='GET', location_id='6d765a2e-4e1b-4b11-be93-f953be676024', version='5.0-preview.1', route_values=route_values) return self._deserialize('WorkItemTypeBehavior', response) def get_behaviors_for_work_item_type(self, process_id, wit_ref_name_for_behaviors): """GetBehaviorsForWorkItemType. [Preview API] Returns a list of all behaviors for the work item type of the process. :param str process_id: The ID of the process :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior :rtype: [WorkItemTypeBehavior] """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name_for_behaviors is not None: route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') response = self._send(http_method='GET', location_id='6d765a2e-4e1b-4b11-be93-f953be676024', version='5.0-preview.1', route_values=route_values) return self._deserialize('[WorkItemTypeBehavior]', self._unwrap_collection(response)) def remove_behavior_from_work_item_type(self, process_id, wit_ref_name_for_behaviors, behavior_ref_name): """RemoveBehaviorFromWorkItemType. [Preview API] Removes a behavior for the work item type of the process. :param str process_id: The ID of the process :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior :param str behavior_ref_name: The reference name of the behavior """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name_for_behaviors is not None: route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') if behavior_ref_name is not None: route_values['behaviorRefName'] = self._serialize.url('behavior_ref_name', behavior_ref_name, 'str') self._send(http_method='DELETE', location_id='6d765a2e-4e1b-4b11-be93-f953be676024', version='5.0-preview.1', route_values=route_values) def update_behavior_to_work_item_type(self, behavior, process_id, wit_ref_name_for_behaviors): """UpdateBehaviorToWorkItemType. [Preview API] Updates a behavior for the work item type of the process. :param :class:` ` behavior: :param str process_id: The ID of the process :param str wit_ref_name_for_behaviors: Work item type reference name for the behavior :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') if wit_ref_name_for_behaviors is not None: route_values['witRefNameForBehaviors'] = self._serialize.url('wit_ref_name_for_behaviors', wit_ref_name_for_behaviors, 'str') content = self._serialize.body(behavior, 'WorkItemTypeBehavior') response = self._send(http_method='PATCH', location_id='6d765a2e-4e1b-4b11-be93-f953be676024', version='5.0-preview.1', route_values=route_values, content=content) return self._deserialize('WorkItemTypeBehavior', response) work_item_tracking_process_template/000077500000000000000000000000001360605530400363115ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0__init__.py000066400000000000000000000015761360605530400404330ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking_process_template# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .work_item_tracking_process_template_client import WorkItemTrackingProcessTemplateClient __all__ = [ 'AdminBehavior', 'AdminBehaviorField', 'CheckTemplateExistenceResult', 'ProcessImportResult', 'ProcessPromoteStatus', 'ValidationIssue', 'WorkItemTrackingProcessTemplateClient' ] models.py000066400000000000000000000203331360605530400401470ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking_process_template# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AdminBehavior(Model): """AdminBehavior. :param abstract: Is the behavior abstract (i.e. can not be associated with any work item type). :type abstract: bool :param color: The color associated with the behavior. :type color: str :param custom: Indicates if the behavior is custom. :type custom: bool :param description: The description of the behavior. :type description: str :param fields: List of behavior fields. :type fields: list of :class:`AdminBehaviorField ` :param id: Behavior ID. :type id: str :param inherits: Parent behavior reference. :type inherits: str :param name: The behavior name. :type name: str :param overriden: Is the behavior overrides a behavior from system process. :type overriden: bool :param rank: The rank. :type rank: int """ _attribute_map = { 'abstract': {'key': 'abstract', 'type': 'bool'}, 'color': {'key': 'color', 'type': 'str'}, 'custom': {'key': 'custom', 'type': 'bool'}, 'description': {'key': 'description', 'type': 'str'}, 'fields': {'key': 'fields', 'type': '[AdminBehaviorField]'}, 'id': {'key': 'id', 'type': 'str'}, 'inherits': {'key': 'inherits', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'overriden': {'key': 'overriden', 'type': 'bool'}, 'rank': {'key': 'rank', 'type': 'int'} } def __init__(self, abstract=None, color=None, custom=None, description=None, fields=None, id=None, inherits=None, name=None, overriden=None, rank=None): super(AdminBehavior, self).__init__() self.abstract = abstract self.color = color self.custom = custom self.description = description self.fields = fields self.id = id self.inherits = inherits self.name = name self.overriden = overriden self.rank = rank class AdminBehaviorField(Model): """AdminBehaviorField. :param behavior_field_id: The behavior field identifier. :type behavior_field_id: str :param id: The behavior ID. :type id: str :param name: The behavior name. :type name: str """ _attribute_map = { 'behavior_field_id': {'key': 'behaviorFieldId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, behavior_field_id=None, id=None, name=None): super(AdminBehaviorField, self).__init__() self.behavior_field_id = behavior_field_id self.id = id self.name = name class CheckTemplateExistenceResult(Model): """CheckTemplateExistenceResult. :param does_template_exist: Indicates whether a template exists. :type does_template_exist: bool :param existing_template_name: The name of the existing template. :type existing_template_name: str :param existing_template_type_id: The existing template type identifier. :type existing_template_type_id: str :param requested_template_name: The name of the requested template. :type requested_template_name: str """ _attribute_map = { 'does_template_exist': {'key': 'doesTemplateExist', 'type': 'bool'}, 'existing_template_name': {'key': 'existingTemplateName', 'type': 'str'}, 'existing_template_type_id': {'key': 'existingTemplateTypeId', 'type': 'str'}, 'requested_template_name': {'key': 'requestedTemplateName', 'type': 'str'} } def __init__(self, does_template_exist=None, existing_template_name=None, existing_template_type_id=None, requested_template_name=None): super(CheckTemplateExistenceResult, self).__init__() self.does_template_exist = does_template_exist self.existing_template_name = existing_template_name self.existing_template_type_id = existing_template_type_id self.requested_template_name = requested_template_name class ProcessImportResult(Model): """ProcessImportResult. :param help_url: Help URL. :type help_url: str :param id: ID of the import operation. :type id: str :param is_new: Whether this imported process is new. :type is_new: bool :param promote_job_id: The promote job identifier. :type promote_job_id: str :param validation_results: The list of validation results. :type validation_results: list of :class:`ValidationIssue ` """ _attribute_map = { 'help_url': {'key': 'helpUrl', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'is_new': {'key': 'isNew', 'type': 'bool'}, 'promote_job_id': {'key': 'promoteJobId', 'type': 'str'}, 'validation_results': {'key': 'validationResults', 'type': '[ValidationIssue]'} } def __init__(self, help_url=None, id=None, is_new=None, promote_job_id=None, validation_results=None): super(ProcessImportResult, self).__init__() self.help_url = help_url self.id = id self.is_new = is_new self.promote_job_id = promote_job_id self.validation_results = validation_results class ProcessPromoteStatus(Model): """ProcessPromoteStatus. :param complete: Number of projects for which promote is complete. :type complete: int :param id: ID of the promote operation. :type id: str :param message: The error message assoicated with the promote operation. The string will be empty if there are no errors. :type message: str :param pending: Number of projects for which promote is pending. :type pending: int :param remaining_retries: The remaining retries. :type remaining_retries: int :param successful: True if promote finished all the projects successfully. False if still inprogress or any project promote failed. :type successful: bool """ _attribute_map = { 'complete': {'key': 'complete', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'pending': {'key': 'pending', 'type': 'int'}, 'remaining_retries': {'key': 'remainingRetries', 'type': 'int'}, 'successful': {'key': 'successful', 'type': 'bool'} } def __init__(self, complete=None, id=None, message=None, pending=None, remaining_retries=None, successful=None): super(ProcessPromoteStatus, self).__init__() self.complete = complete self.id = id self.message = message self.pending = pending self.remaining_retries = remaining_retries self.successful = successful class ValidationIssue(Model): """ValidationIssue. :param description: :type description: str :param file: :type file: str :param help_link: :type help_link: str :param issue_type: :type issue_type: object :param line: :type line: int """ _attribute_map = { 'description': {'key': 'description', 'type': 'str'}, 'file': {'key': 'file', 'type': 'str'}, 'help_link': {'key': 'helpLink', 'type': 'str'}, 'issue_type': {'key': 'issueType', 'type': 'object'}, 'line': {'key': 'line', 'type': 'int'} } def __init__(self, description=None, file=None, help_link=None, issue_type=None, line=None): super(ValidationIssue, self).__init__() self.description = description self.file = file self.help_link = help_link self.issue_type = issue_type self.line = line __all__ = [ 'AdminBehavior', 'AdminBehaviorField', 'CheckTemplateExistenceResult', 'ProcessImportResult', 'ProcessPromoteStatus', 'ValidationIssue', ] work_item_tracking_process_template_client.py000066400000000000000000000141001360605530400475300ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_0/work_item_tracking_process_template# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class WorkItemTrackingProcessTemplateClient(Client): """WorkItemTrackingProcessTemplate :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(WorkItemTrackingProcessTemplateClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '5264459e-e5e0-4bd8-b118-0985e68a4ec5' def get_behavior(self, process_id, behavior_ref_name): """GetBehavior. [Preview API] Returns a behavior for the process. :param str process_id: The ID of the process :param str behavior_ref_name: The reference name of the behavior :rtype: :class:` ` """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') query_parameters = {} if behavior_ref_name is not None: query_parameters['behaviorRefName'] = self._serialize.query('behavior_ref_name', behavior_ref_name, 'str') response = self._send(http_method='GET', location_id='90bf9317-3571-487b-bc8c-a523ba0e05d7', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('AdminBehavior', response) def get_behaviors(self, process_id): """GetBehaviors. [Preview API] Returns a list of behaviors for the process. :param str process_id: The ID of the process :rtype: [AdminBehavior] """ route_values = {} if process_id is not None: route_values['processId'] = self._serialize.url('process_id', process_id, 'str') response = self._send(http_method='GET', location_id='90bf9317-3571-487b-bc8c-a523ba0e05d7', version='5.0-preview.1', route_values=route_values) return self._deserialize('[AdminBehavior]', self._unwrap_collection(response)) def export_process_template(self, id, **kwargs): """ExportProcessTemplate. [Preview API] Returns requested process template. :param str id: The ID of the process :rtype: object """ route_values = {} if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') route_values['action'] = 'Export' response = self._send(http_method='GET', location_id='29e1f38d-9e9c-4358-86a5-cdf9896a5759', version='5.0-preview.1', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def import_process_template(self, upload_stream, ignore_warnings=None, **kwargs): """ImportProcessTemplate. [Preview API] Imports a process from zip file. :param object upload_stream: Stream to upload :param bool ignore_warnings: Default value is false :rtype: :class:` ` """ route_values = {} route_values['action'] = 'Import' query_parameters = {} if ignore_warnings is not None: query_parameters['ignoreWarnings'] = self._serialize.query('ignore_warnings', ignore_warnings, 'bool') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None content = self._client.stream_upload(upload_stream, callback=callback) response = self._send(http_method='POST', location_id='29e1f38d-9e9c-4358-86a5-cdf9896a5759', version='5.0-preview.1', route_values=route_values, query_parameters=query_parameters, content=content, media_type='application/octet-stream') return self._deserialize('ProcessImportResult', response) def import_process_template_status(self, id): """ImportProcessTemplateStatus. [Preview API] Tells whether promote has completed for the specified promote job ID. :param str id: The ID of the promote job operation :rtype: :class:` ` """ route_values = {} if id is not None: route_values['id'] = self._serialize.url('id', id, 'str') route_values['action'] = 'Status' response = self._send(http_method='GET', location_id='29e1f38d-9e9c-4358-86a5-cdf9896a5759', version='5.0-preview.1', route_values=route_values) return self._deserialize('ProcessPromoteStatus', response) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/000077500000000000000000000000001360605530400270565ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/__init__.py000066400000000000000000000010551360605530400311700ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/accounts/000077500000000000000000000000001360605530400306755ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/accounts/__init__.py000066400000000000000000000013461360605530400330120ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .accounts_client import AccountsClient __all__ = [ 'Account', 'AccountCreateInfoInternal', 'AccountPreferencesInternal', 'AccountsClient' ] accounts_client.py000066400000000000000000000043761360605530400343570ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/accounts# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class AccountsClient(Client): """Accounts :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(AccountsClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '0d55247a-1c47-4462-9b1f-5e2125590ee6' def get_accounts(self, owner_id=None, member_id=None, properties=None): """GetAccounts. Get a list of accounts for a specific owner or a specific member. :param str owner_id: ID for the owner of the accounts. :param str member_id: ID for a member of the accounts. :param str properties: :rtype: [Account] """ query_parameters = {} if owner_id is not None: query_parameters['ownerId'] = self._serialize.query('owner_id', owner_id, 'str') if member_id is not None: query_parameters['memberId'] = self._serialize.query('member_id', member_id, 'str') if properties is not None: query_parameters['properties'] = self._serialize.query('properties', properties, 'str') response = self._send(http_method='GET', location_id='229a6a53-b428-4ffb-a835-e8f36b5b4b1e', version='5.1', query_parameters=query_parameters) return self._deserialize('[Account]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/accounts/models.py000066400000000000000000000142151360605530400325350ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class Account(Model): """ :param account_id: Identifier for an Account :type account_id: str :param account_name: Name for an account :type account_name: str :param account_owner: Owner of account :type account_owner: str :param account_status: Current account status :type account_status: object :param account_type: Type of account: Personal, Organization :type account_type: object :param account_uri: Uri for an account :type account_uri: str :param created_by: Who created the account :type created_by: str :param created_date: Date account was created :type created_date: datetime :param has_moved: :type has_moved: bool :param last_updated_by: Identity of last person to update the account :type last_updated_by: str :param last_updated_date: Date account was last updated :type last_updated_date: datetime :param namespace_id: Namespace for an account :type namespace_id: str :param new_collection_id: :type new_collection_id: str :param organization_name: Organization that created the account :type organization_name: str :param properties: Extended properties :type properties: :class:`object ` :param status_reason: Reason for current status :type status_reason: str """ _attribute_map = { 'account_id': {'key': 'accountId', 'type': 'str'}, 'account_name': {'key': 'accountName', 'type': 'str'}, 'account_owner': {'key': 'accountOwner', 'type': 'str'}, 'account_status': {'key': 'accountStatus', 'type': 'object'}, 'account_type': {'key': 'accountType', 'type': 'object'}, 'account_uri': {'key': 'accountUri', 'type': 'str'}, 'created_by': {'key': 'createdBy', 'type': 'str'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'has_moved': {'key': 'hasMoved', 'type': 'bool'}, 'last_updated_by': {'key': 'lastUpdatedBy', 'type': 'str'}, 'last_updated_date': {'key': 'lastUpdatedDate', 'type': 'iso-8601'}, 'namespace_id': {'key': 'namespaceId', 'type': 'str'}, 'new_collection_id': {'key': 'newCollectionId', 'type': 'str'}, 'organization_name': {'key': 'organizationName', 'type': 'str'}, 'properties': {'key': 'properties', 'type': 'object'}, 'status_reason': {'key': 'statusReason', 'type': 'str'} } def __init__(self, account_id=None, account_name=None, account_owner=None, account_status=None, account_type=None, account_uri=None, created_by=None, created_date=None, has_moved=None, last_updated_by=None, last_updated_date=None, namespace_id=None, new_collection_id=None, organization_name=None, properties=None, status_reason=None): super(Account, self).__init__() self.account_id = account_id self.account_name = account_name self.account_owner = account_owner self.account_status = account_status self.account_type = account_type self.account_uri = account_uri self.created_by = created_by self.created_date = created_date self.has_moved = has_moved self.last_updated_by = last_updated_by self.last_updated_date = last_updated_date self.namespace_id = namespace_id self.new_collection_id = new_collection_id self.organization_name = organization_name self.properties = properties self.status_reason = status_reason class AccountCreateInfoInternal(Model): """ :param account_name: :type account_name: str :param creator: :type creator: str :param organization: :type organization: str :param preferences: :type preferences: :class:`AccountPreferencesInternal ` :param properties: :type properties: :class:`object ` :param service_definitions: :type service_definitions: list of { key: str; value: str } """ _attribute_map = { 'account_name': {'key': 'accountName', 'type': 'str'}, 'creator': {'key': 'creator', 'type': 'str'}, 'organization': {'key': 'organization', 'type': 'str'}, 'preferences': {'key': 'preferences', 'type': 'AccountPreferencesInternal'}, 'properties': {'key': 'properties', 'type': 'object'}, 'service_definitions': {'key': 'serviceDefinitions', 'type': '[{ key: str; value: str }]'} } def __init__(self, account_name=None, creator=None, organization=None, preferences=None, properties=None, service_definitions=None): super(AccountCreateInfoInternal, self).__init__() self.account_name = account_name self.creator = creator self.organization = organization self.preferences = preferences self.properties = properties self.service_definitions = service_definitions class AccountPreferencesInternal(Model): """ :param culture: :type culture: object :param language: :type language: object :param time_zone: :type time_zone: object """ _attribute_map = { 'culture': {'key': 'culture', 'type': 'object'}, 'language': {'key': 'language', 'type': 'object'}, 'time_zone': {'key': 'timeZone', 'type': 'object'} } def __init__(self, culture=None, language=None, time_zone=None): super(AccountPreferencesInternal, self).__init__() self.culture = culture self.language = language self.time_zone = time_zone __all__ = [ 'Account', 'AccountCreateInfoInternal', 'AccountPreferencesInternal', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/audit/000077500000000000000000000000001360605530400301645ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/audit/__init__.py000066400000000000000000000013311360605530400322730ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .audit_client import AuditClient __all__ = [ 'AuditLogEntry', 'AuditLogQueryResult', 'DecoratedAuditLogEntry', 'AuditClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/audit/audit_client.py000066400000000000000000000105321360605530400332030ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class AuditClient(Client): """Audit :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(AuditClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '94ff054d-5ee1-413d-9341-3f4a7827de2e' def query_log(self, start_time=None, end_time=None, batch_size=None, continuation_token=None, skip_aggregation=None): """QueryLog. [Preview API] Queries audit log entries :param datetime start_time: Start time of download window. Optional :param datetime end_time: End time of download window. Optional :param int batch_size: Max number of results to return. Optional :param str continuation_token: Token used for returning next set of results from previous query. Optional :param bool skip_aggregation: Skips aggregating events and leaves them as individual entries instead. By default events are aggregated. Event types that are aggregated: AuditLog.AccessLog. :rtype: :class:` ` """ query_parameters = {} if start_time is not None: query_parameters['startTime'] = self._serialize.query('start_time', start_time, 'iso-8601') if end_time is not None: query_parameters['endTime'] = self._serialize.query('end_time', end_time, 'iso-8601') if batch_size is not None: query_parameters['batchSize'] = self._serialize.query('batch_size', batch_size, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if skip_aggregation is not None: query_parameters['skipAggregation'] = self._serialize.query('skip_aggregation', skip_aggregation, 'bool') response = self._send(http_method='GET', location_id='4e5fa14f-7097-4b73-9c85-00abc7353c61', version='5.1-preview.1', query_parameters=query_parameters) return self._deserialize('AuditLogQueryResult', response) def download_log(self, format, start_time=None, end_time=None, **kwargs): """DownloadLog. [Preview API] Downloads audit log entries. :param str format: File format for download. Can be "json" or "csv". :param datetime start_time: Start time of download window. Optional :param datetime end_time: End time of download window. Optional :rtype: object """ query_parameters = {} if format is not None: query_parameters['format'] = self._serialize.query('format', format, 'str') if start_time is not None: query_parameters['startTime'] = self._serialize.query('start_time', start_time, 'iso-8601') if end_time is not None: query_parameters['endTime'] = self._serialize.query('end_time', end_time, 'iso-8601') response = self._send(http_method='GET', location_id='b7b98a76-04e8-4f4d-ac72-9d46492caaac', version='5.1-preview.1', query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/audit/models.py000066400000000000000000000217601360605530400320270ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AuditLogEntry(Model): """ :param action_id: The action if for the event, i.e Git.CreateRepo, Project.RenameProject :type action_id: str :param activity_id: ActivityId :type activity_id: str :param actor_cUID: The Actor's CUID :type actor_cUID: str :param actor_user_id: The Actor's User Id :type actor_user_id: str :param authentication_mechanism: Type of authentication used by the author :type authentication_mechanism: str :param correlation_id: This allows us to group things together, like one user action that caused a cascade of event entries (project creation). :type correlation_id: str :param data: External data such as CUIDs, item names, etc. :type data: dict :param id: EventId, should be unique :type id: str :param ip_address: IP Address where the event was originated :type ip_address: str :param scope_id: The org, collection or project Id :type scope_id: str :param scope_type: The type of the scope, Enterprise, Organization or Project :type scope_type: object :param timestamp: The time when the event occurred in UTC :type timestamp: datetime :param user_agent: The user agent from the request :type user_agent: str """ _attribute_map = { 'action_id': {'key': 'actionId', 'type': 'str'}, 'activity_id': {'key': 'activityId', 'type': 'str'}, 'actor_cUID': {'key': 'actorCUID', 'type': 'str'}, 'actor_user_id': {'key': 'actorUserId', 'type': 'str'}, 'authentication_mechanism': {'key': 'authenticationMechanism', 'type': 'str'}, 'correlation_id': {'key': 'correlationId', 'type': 'str'}, 'data': {'key': 'data', 'type': '{object}'}, 'id': {'key': 'id', 'type': 'str'}, 'ip_address': {'key': 'ipAddress', 'type': 'str'}, 'scope_id': {'key': 'scopeId', 'type': 'str'}, 'scope_type': {'key': 'scopeType', 'type': 'object'}, 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, 'user_agent': {'key': 'userAgent', 'type': 'str'} } def __init__(self, action_id=None, activity_id=None, actor_cUID=None, actor_user_id=None, authentication_mechanism=None, correlation_id=None, data=None, id=None, ip_address=None, scope_id=None, scope_type=None, timestamp=None, user_agent=None): super(AuditLogEntry, self).__init__() self.action_id = action_id self.activity_id = activity_id self.actor_cUID = actor_cUID self.actor_user_id = actor_user_id self.authentication_mechanism = authentication_mechanism self.correlation_id = correlation_id self.data = data self.id = id self.ip_address = ip_address self.scope_id = scope_id self.scope_type = scope_type self.timestamp = timestamp self.user_agent = user_agent class AuditLogQueryResult(Model): """ The object returned when the audit log is queried. It contains the log and the information needed to query more audit entries. :param continuation_token: The continuation token to pass to get the next set of results :type continuation_token: str :param decorated_audit_log_entries: The list of audit log entries :type decorated_audit_log_entries: list of :class:`DecoratedAuditLogEntry ` :param has_more: True when there are more matching results to be fetched, false otherwise. :type has_more: bool """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, 'decorated_audit_log_entries': {'key': 'decoratedAuditLogEntries', 'type': '[DecoratedAuditLogEntry]'}, 'has_more': {'key': 'hasMore', 'type': 'bool'} } def __init__(self, continuation_token=None, decorated_audit_log_entries=None, has_more=None): super(AuditLogQueryResult, self).__init__() self.continuation_token = continuation_token self.decorated_audit_log_entries = decorated_audit_log_entries self.has_more = has_more class DecoratedAuditLogEntry(Model): """ :param action_id: The action if for the event, i.e Git.CreateRepo, Project.RenameProject :type action_id: str :param activity_id: ActivityId :type activity_id: str :param actor_cUID: The Actor's CUID :type actor_cUID: str :param actor_display_name: DisplayName of the user who initiated the action :type actor_display_name: str :param actor_image_url: URL of Actor's Profile image :type actor_image_url: str :param actor_user_id: The Actor's User Id :type actor_user_id: str :param area: Area of Azure DevOps the action occurred :type area: str :param authentication_mechanism: Type of authentication used by the actor :type authentication_mechanism: str :param category: Type of action executed :type category: object :param category_display_name: DisplayName of the category :type category_display_name: str :param correlation_id: This allows related audit entries to be grouped together. Generally this occurs when a single action causes a cascade of audit entries. For example, project creation. :type correlation_id: str :param data: External data such as CUIDs, item names, etc. :type data: dict :param details: Decorated details :type details: str :param id: EventId - Needs to be unique per service :type id: str :param ip_address: IP Address where the event was originated :type ip_address: str :param scope_display_name: DisplayName of the scope :type scope_display_name: str :param scope_id: The organization or project Id :type scope_id: str :param scope_type: The type of the scope, Organization or Project :type scope_type: object :param timestamp: The time when the event occurred in UTC :type timestamp: datetime :param user_agent: The user agent from the request :type user_agent: str """ _attribute_map = { 'action_id': {'key': 'actionId', 'type': 'str'}, 'activity_id': {'key': 'activityId', 'type': 'str'}, 'actor_cUID': {'key': 'actorCUID', 'type': 'str'}, 'actor_display_name': {'key': 'actorDisplayName', 'type': 'str'}, 'actor_image_url': {'key': 'actorImageUrl', 'type': 'str'}, 'actor_user_id': {'key': 'actorUserId', 'type': 'str'}, 'area': {'key': 'area', 'type': 'str'}, 'authentication_mechanism': {'key': 'authenticationMechanism', 'type': 'str'}, 'category': {'key': 'category', 'type': 'object'}, 'category_display_name': {'key': 'categoryDisplayName', 'type': 'str'}, 'correlation_id': {'key': 'correlationId', 'type': 'str'}, 'data': {'key': 'data', 'type': '{object}'}, 'details': {'key': 'details', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'ip_address': {'key': 'ipAddress', 'type': 'str'}, 'scope_display_name': {'key': 'scopeDisplayName', 'type': 'str'}, 'scope_id': {'key': 'scopeId', 'type': 'str'}, 'scope_type': {'key': 'scopeType', 'type': 'object'}, 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, 'user_agent': {'key': 'userAgent', 'type': 'str'} } def __init__(self, action_id=None, activity_id=None, actor_cUID=None, actor_display_name=None, actor_image_url=None, actor_user_id=None, area=None, authentication_mechanism=None, category=None, category_display_name=None, correlation_id=None, data=None, details=None, id=None, ip_address=None, scope_display_name=None, scope_id=None, scope_type=None, timestamp=None, user_agent=None): super(DecoratedAuditLogEntry, self).__init__() self.action_id = action_id self.activity_id = activity_id self.actor_cUID = actor_cUID self.actor_display_name = actor_display_name self.actor_image_url = actor_image_url self.actor_user_id = actor_user_id self.area = area self.authentication_mechanism = authentication_mechanism self.category = category self.category_display_name = category_display_name self.correlation_id = correlation_id self.data = data self.details = details self.id = id self.ip_address = ip_address self.scope_display_name = scope_display_name self.scope_id = scope_id self.scope_type = scope_type self.timestamp = timestamp self.user_agent = user_agent __all__ = [ 'AuditLogEntry', 'AuditLogQueryResult', 'DecoratedAuditLogEntry', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/authorization/000077500000000000000000000000001360605530400317565ustar00rootroot00000000000000__init__.py000066400000000000000000000014461360605530400340150ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/authorization# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .authorization_client import authorizationClient __all__ = [ 'AuthorizedDefinitions', 'GraphSubjectBase', 'IdentityRef', 'ReferenceLinks', 'ResourceAuthorizedDefinitions', 'authorizationClient' ] authorization_client.py000066400000000000000000000022641360605530400365130ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/authorization# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class AuthorizationClient(Client): """Authorization :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(AuthorizationClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '2e426be0-da4d-48c4-9178-978da8562255' azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/authorization/models.py000066400000000000000000000201571360605530400336200ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AuthorizedDefinitions(Model): """AuthorizedDefinitions. :param authorized: :type authorized: bool :param authorized_by: :type authorized_by: :class:`IdentityRef ` :param authorized_on: :type authorized_on: datetime :param definition_id: :type definition_id: int """ _attribute_map = { 'authorized': {'key': 'authorized', 'type': 'bool'}, 'authorized_by': {'key': 'authorizedBy', 'type': 'IdentityRef'}, 'authorized_on': {'key': 'authorizedOn', 'type': 'iso-8601'}, 'definition_id': {'key': 'definitionId', 'type': 'int'} } def __init__(self, authorized=None, authorized_by=None, authorized_on=None, definition_id=None): super(AuthorizedDefinitions, self).__init__() self.authorized = authorized self.authorized_by = authorized_by self.authorized_on = authorized_on self.definition_id = definition_id class GraphSubjectBase(Model): """GraphSubjectBase. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """IdentityRef. :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary :type directory_alias: str :param id: :type id: str :param image_url: Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary :type image_url: str :param inactive: Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary :type inactive: bool :param is_aad_identity: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) :type is_aad_identity: bool :param is_container: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType) :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: Deprecated - not in use in most preexisting implementations of ToIdentityRef :type profile_url: str :param unique_name: Deprecated - use Domain+PrincipalName instead :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class ReferenceLinks(Model): """ReferenceLinks. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class ResourceAuthorizedDefinitions(Model): """ResourceAuthorizedDefinitions. :param definitions: :type definitions: list of :class:`AuthorizedDefinitions ` :param id: :type id: str :param is_authorized_for_all_definitions: :type is_authorized_for_all_definitions: bool :param type: :type type: str """ _attribute_map = { 'definitions': {'key': 'definitions', 'type': '[AuthorizedDefinitions]'}, 'id': {'key': 'id', 'type': 'str'}, 'is_authorized_for_all_definitions': {'key': 'isAuthorizedForAllDefinitions', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, definitions=None, id=None, is_authorized_for_all_definitions=None, type=None): super(ResourceAuthorizedDefinitions, self).__init__() self.definitions = definitions self.id = id self.is_authorized_for_all_definitions = is_authorized_for_all_definitions self.type = type __all__ = [ 'AuthorizedDefinitions', 'GraphSubjectBase', 'IdentityRef', 'ReferenceLinks', 'ResourceAuthorizedDefinitions', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/build/000077500000000000000000000000001360605530400301555ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/build/__init__.py000066400000000000000000000051041360605530400322660ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .build_client import BuildClient __all__ = [ 'AgentPoolQueue', 'AgentSpecification', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', 'AggregatedRunsByOutcome', 'AggregatedRunsByState', 'ArtifactResource', 'AssociatedWorkItem', 'Attachment', 'AuthorizationHeader', 'Build', 'BuildArtifact', 'BuildBadge', 'BuildController', 'BuildDefinition', 'BuildDefinition3_2', 'BuildDefinitionReference', 'BuildDefinitionReference3_2', 'BuildDefinitionRevision', 'BuildDefinitionStep', 'BuildDefinitionTemplate', 'BuildDefinitionTemplate3_2', 'BuildDefinitionVariable', 'BuildLog', 'BuildLogReference', 'BuildMetric', 'BuildOption', 'BuildOptionDefinition', 'BuildOptionDefinitionReference', 'BuildOptionGroupDefinition', 'BuildOptionInputDefinition', 'BuildReportMetadata', 'BuildRepository', 'BuildRequestValidationResult', 'BuildResourceUsage', 'BuildSettings', 'Change', 'DataSourceBindingBase', 'DefinitionReference', 'DefinitionResourceReference', 'Deployment', 'Folder', 'GraphSubjectBase', 'IdentityRef', 'Issue', 'JsonPatchOperation', 'ProcessParameters', 'PullRequest', 'ReferenceLinks', 'ReleaseReference', 'RepositoryWebhook', 'ResourceRef', 'RetentionPolicy', 'SourceProviderAttributes', 'SourceRepositories', 'SourceRepository', 'SourceRepositoryItem', 'SupportedTrigger', 'TaskAgentPoolReference', 'TaskDefinitionReference', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskOrchestrationPlanReference', 'TaskReference', 'TaskSourceDefinitionBase', 'TeamProjectReference', 'TestResultsContext', 'Timeline', 'TimelineAttempt', 'TimelineRecord', 'TimelineReference', 'VariableGroup', 'VariableGroupReference', 'WebApiConnectedServiceRef', 'XamlBuildControllerReference', 'BuildClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/build/build_client.py000066400000000000000000003311351360605530400331720ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class BuildClient(Client): """Build :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(BuildClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = '965220d5-5bb9-42cf-8d67-9b146df2a5a4' def create_artifact(self, artifact, project, build_id): """CreateArtifact. Associates an artifact with a build. :param :class:` ` artifact: The artifact. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') content = self._serialize.body(artifact, 'BuildArtifact') response = self._send(http_method='POST', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values, content=content) return self._deserialize('BuildArtifact', response) def get_artifact(self, project, build_id, artifact_name): """GetArtifact. Gets a specific artifact for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if artifact_name is not None: query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildArtifact', response) def get_artifact_content_zip(self, project, build_id, artifact_name, **kwargs): """GetArtifactContentZip. Gets a specific artifact for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if artifact_name is not None: query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_artifacts(self, project, build_id): """GetArtifacts. Gets all artifacts for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [BuildArtifact] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values) return self._deserialize('[BuildArtifact]', self._unwrap_collection(response)) def get_file(self, project, build_id, artifact_name, file_id, file_name, **kwargs): """GetFile. Gets a file from the build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str artifact_name: The name of the artifact. :param str file_id: The primary key for the file. :param str file_name: The name that the file will be set to. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if artifact_name is not None: query_parameters['artifactName'] = self._serialize.query('artifact_name', artifact_name, 'str') if file_id is not None: query_parameters['fileId'] = self._serialize.query('file_id', file_id, 'str') if file_name is not None: query_parameters['fileName'] = self._serialize.query('file_name', file_name, 'str') response = self._send(http_method='GET', location_id='1db06c96-014e-44e1-ac91-90b2d4b3e984', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_attachments(self, project, build_id, type): """GetAttachments. [Preview API] Gets the list of attachments of a specific type that are associated with a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: The type of attachment. :rtype: [Attachment] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') response = self._send(http_method='GET', location_id='f2192269-89fa-4f94-baf6-8fb128c55159', version='5.1-preview.2', route_values=route_values) return self._deserialize('[Attachment]', self._unwrap_collection(response)) def get_attachment(self, project, build_id, timeline_id, record_id, type, name, **kwargs): """GetAttachment. [Preview API] Gets a specific attachment. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str timeline_id: The ID of the timeline. :param str record_id: The ID of the timeline record. :param str type: The type of the attachment. :param str name: The name of the attachment. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') if record_id is not None: route_values['recordId'] = self._serialize.url('record_id', record_id, 'str') if type is not None: route_values['type'] = self._serialize.url('type', type, 'str') if name is not None: route_values['name'] = self._serialize.url('name', name, 'str') response = self._send(http_method='GET', location_id='af5122d3-3438-485e-a25a-2dbbfde84ee6', version='5.1-preview.2', route_values=route_values, accept_media_type='application/octet-stream') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def authorize_project_resources(self, resources, project): """AuthorizeProjectResources. [Preview API] :param [DefinitionResourceReference] resources: :param str project: Project ID or project name :rtype: [DefinitionResourceReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(resources, '[DefinitionResourceReference]') response = self._send(http_method='PATCH', location_id='398c85bc-81aa-4822-947c-a194a05f0fef', version='5.1-preview.1', route_values=route_values, content=content) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def get_project_resources(self, project, type=None, id=None): """GetProjectResources. [Preview API] :param str project: Project ID or project name :param str type: :param str id: :rtype: [DefinitionResourceReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') if id is not None: query_parameters['id'] = self._serialize.query('id', id, 'str') response = self._send(http_method='GET', location_id='398c85bc-81aa-4822-947c-a194a05f0fef', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def list_branches(self, project, provider_name, service_endpoint_id=None, repository=None, branch_name=None): """ListBranches. [Preview API] Gets a list of branches for the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: The vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories. :param str branch_name: If supplied, the name of the branch to check for specifically. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='e05d4403-9b81-4244-8763-20fde28d1976', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def get_build_badge(self, project, repo_type, repo_id=None, branch_name=None): """GetBuildBadge. [Preview API] Gets a badge that indicates the status of the most recent build for the specified branch. :param str project: Project ID or project name :param str repo_type: The repository type. :param str repo_id: The repository ID. :param str branch_name: The branch name. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repo_type is not None: route_values['repoType'] = self._serialize.url('repo_type', repo_type, 'str') query_parameters = {} if repo_id is not None: query_parameters['repoId'] = self._serialize.query('repo_id', repo_id, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='21b3b9ce-fad5-4567-9ad0-80679794e003', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildBadge', response) def get_build_badge_data(self, project, repo_type, repo_id=None, branch_name=None): """GetBuildBadgeData. [Preview API] Gets a badge that indicates the status of the most recent build for the specified branch. :param str project: Project ID or project name :param str repo_type: The repository type. :param str repo_id: The repository ID. :param str branch_name: The branch name. :rtype: str """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if repo_type is not None: route_values['repoType'] = self._serialize.url('repo_type', repo_type, 'str') query_parameters = {} if repo_id is not None: query_parameters['repoId'] = self._serialize.query('repo_id', repo_id, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='21b3b9ce-fad5-4567-9ad0-80679794e003', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def delete_build(self, project, build_id): """DeleteBuild. Deletes a build. :param str project: Project ID or project name :param int build_id: The ID of the build. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') self._send(http_method='DELETE', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values) def get_build(self, project, build_id, property_filters=None): """GetBuild. Gets a build :param str project: Project ID or project name :param int build_id: :param str property_filters: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if property_filters is not None: query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Build', response) def get_builds(self, project, definitions=None, queues=None, build_number=None, min_time=None, max_time=None, requested_for=None, reason_filter=None, status_filter=None, result_filter=None, tag_filters=None, properties=None, top=None, continuation_token=None, max_builds_per_definition=None, deleted_filter=None, query_order=None, branch_name=None, build_ids=None, repository_id=None, repository_type=None): """GetBuilds. Gets a list of builds. :param str project: Project ID or project name :param [int] definitions: A comma-delimited list of definition IDs. If specified, filters to builds for these definitions. :param [int] queues: A comma-delimited list of queue IDs. If specified, filters to builds that ran against these queues. :param str build_number: If specified, filters to builds that match this build number. Append * to do a prefix search. :param datetime min_time: If specified, filters to builds that finished/started/queued after this date based on the queryOrder specified. :param datetime max_time: If specified, filters to builds that finished/started/queued before this date based on the queryOrder specified. :param str requested_for: If specified, filters to builds requested for the specified user. :param str reason_filter: If specified, filters to builds that match this reason. :param str status_filter: If specified, filters to builds that match this status. :param str result_filter: If specified, filters to builds that match this result. :param [str] tag_filters: A comma-delimited list of tags. If specified, filters to builds that have the specified tags. :param [str] properties: A comma-delimited list of properties to retrieve. :param int top: The maximum number of builds to return. :param str continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of builds. :param int max_builds_per_definition: The maximum number of builds to return per definition. :param str deleted_filter: Indicates whether to exclude, include, or only return deleted builds. :param str query_order: The order in which builds should be returned. :param str branch_name: If specified, filters to builds that built branches that built this branch. :param [int] build_ids: A comma-delimited list that specifies the IDs of builds to retrieve. :param str repository_id: If specified, filters to builds that built from this repository. :param str repository_type: If specified, filters to builds that built from repositories of this type. :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definitions is not None: definitions = ",".join(map(str, definitions)) query_parameters['definitions'] = self._serialize.query('definitions', definitions, 'str') if queues is not None: queues = ",".join(map(str, queues)) query_parameters['queues'] = self._serialize.query('queues', queues, 'str') if build_number is not None: query_parameters['buildNumber'] = self._serialize.query('build_number', build_number, 'str') if min_time is not None: query_parameters['minTime'] = self._serialize.query('min_time', min_time, 'iso-8601') if max_time is not None: query_parameters['maxTime'] = self._serialize.query('max_time', max_time, 'iso-8601') if requested_for is not None: query_parameters['requestedFor'] = self._serialize.query('requested_for', requested_for, 'str') if reason_filter is not None: query_parameters['reasonFilter'] = self._serialize.query('reason_filter', reason_filter, 'str') if status_filter is not None: query_parameters['statusFilter'] = self._serialize.query('status_filter', status_filter, 'str') if result_filter is not None: query_parameters['resultFilter'] = self._serialize.query('result_filter', result_filter, 'str') if tag_filters is not None: tag_filters = ",".join(tag_filters) query_parameters['tagFilters'] = self._serialize.query('tag_filters', tag_filters, 'str') if properties is not None: properties = ",".join(properties) query_parameters['properties'] = self._serialize.query('properties', properties, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if max_builds_per_definition is not None: query_parameters['maxBuildsPerDefinition'] = self._serialize.query('max_builds_per_definition', max_builds_per_definition, 'int') if deleted_filter is not None: query_parameters['deletedFilter'] = self._serialize.query('deleted_filter', deleted_filter, 'str') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') if build_ids is not None: build_ids = ",".join(map(str, build_ids)) query_parameters['buildIds'] = self._serialize.query('build_ids', build_ids, 'str') if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if repository_type is not None: query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') response = self._send(http_method='GET', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[Build]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetBuildsResponseValue(response_value, continuation_token) class GetBuildsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_builds method :param value: :type value: :class:`<[Build]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def queue_build(self, build, project, ignore_warnings=None, check_in_ticket=None, source_build_id=None): """QueueBuild. Queues a build :param :class:` ` build: :param str project: Project ID or project name :param bool ignore_warnings: :param str check_in_ticket: :param int source_build_id: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if ignore_warnings is not None: query_parameters['ignoreWarnings'] = self._serialize.query('ignore_warnings', ignore_warnings, 'bool') if check_in_ticket is not None: query_parameters['checkInTicket'] = self._serialize.query('check_in_ticket', check_in_ticket, 'str') if source_build_id is not None: query_parameters['sourceBuildId'] = self._serialize.query('source_build_id', source_build_id, 'int') content = self._serialize.body(build, 'Build') response = self._send(http_method='POST', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Build', response) def update_build(self, build, project, build_id, retry=None): """UpdateBuild. Updates a build. :param :class:` ` build: The build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param bool retry: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if retry is not None: query_parameters['retry'] = self._serialize.query('retry', retry, 'bool') content = self._serialize.body(build, 'Build') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Build', response) def update_builds(self, builds, project): """UpdateBuilds. Updates multiple builds. :param [Build] builds: The builds to update. :param str project: Project ID or project name :rtype: [Build] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(builds, '[Build]') response = self._send(http_method='PATCH', location_id='0cd358e1-9217-4d94-8269-1c1ee6f93dcf', version='5.1', route_values=route_values, content=content) return self._deserialize('[Build]', self._unwrap_collection(response)) def get_build_changes(self, project, build_id, continuation_token=None, top=None, include_source_change=None): """GetBuildChanges. Gets the changes associated with a build :param str project: Project ID or project name :param int build_id: :param str continuation_token: :param int top: The maximum number of changes to return :param bool include_source_change: :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if include_source_change is not None: query_parameters['includeSourceChange'] = self._serialize.query('include_source_change', include_source_change, 'bool') response = self._send(http_method='GET', location_id='54572c7b-bbd3-45d4-80dc-28be08941620', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[Change]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetBuildChangesResponseValue(response_value, continuation_token) class GetBuildChangesResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_build_changes method :param value: :type value: :class:`<[Change]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def get_changes_between_builds(self, project, from_build_id=None, to_build_id=None, top=None): """GetChangesBetweenBuilds. [Preview API] Gets the changes made to the repository between two given builds. :param str project: Project ID or project name :param int from_build_id: The ID of the first build. :param int to_build_id: The ID of the last build. :param int top: The maximum number of changes to return. :rtype: [Change] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if from_build_id is not None: query_parameters['fromBuildId'] = self._serialize.query('from_build_id', from_build_id, 'int') if to_build_id is not None: query_parameters['toBuildId'] = self._serialize.query('to_build_id', to_build_id, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='f10f0ea5-18a1-43ec-a8fb-2042c7be9b43', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Change]', self._unwrap_collection(response)) def get_build_controller(self, controller_id): """GetBuildController. Gets a controller :param int controller_id: :rtype: :class:` ` """ route_values = {} if controller_id is not None: route_values['controllerId'] = self._serialize.url('controller_id', controller_id, 'int') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', version='5.1', route_values=route_values) return self._deserialize('BuildController', response) def get_build_controllers(self, name=None): """GetBuildControllers. Gets controller, optionally filtered by name :param str name: :rtype: [BuildController] """ query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') response = self._send(http_method='GET', location_id='fcac1932-2ee1-437f-9b6f-7f696be858f6', version='5.1', query_parameters=query_parameters) return self._deserialize('[BuildController]', self._unwrap_collection(response)) def create_definition(self, definition, project, definition_to_clone_id=None, definition_to_clone_revision=None): """CreateDefinition. Creates a new definition. :param :class:` ` definition: The definition. :param str project: Project ID or project name :param int definition_to_clone_id: :param int definition_to_clone_revision: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if definition_to_clone_id is not None: query_parameters['definitionToCloneId'] = self._serialize.query('definition_to_clone_id', definition_to_clone_id, 'int') if definition_to_clone_revision is not None: query_parameters['definitionToCloneRevision'] = self._serialize.query('definition_to_clone_revision', definition_to_clone_revision, 'int') content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='POST', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('BuildDefinition', response) def delete_definition(self, project, definition_id): """DeleteDefinition. Deletes a definition and all associated builds. :param str project: Project ID or project name :param int definition_id: The ID of the definition. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') self._send(http_method='DELETE', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values) def get_definition(self, project, definition_id, revision=None, min_metrics_time=None, property_filters=None, include_latest_builds=None): """GetDefinition. Gets a definition, optionally at a specific revision. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int revision: The revision number to retrieve. If this is not specified, the latest version will be returned. :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. :param [str] property_filters: A comma-delimited list of properties to include in the results. :param bool include_latest_builds: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if revision is not None: query_parameters['revision'] = self._serialize.query('revision', revision, 'int') if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') if property_filters is not None: property_filters = ",".join(property_filters) query_parameters['propertyFilters'] = self._serialize.query('property_filters', property_filters, 'str') if include_latest_builds is not None: query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) def get_definitions(self, project, name=None, repository_id=None, repository_type=None, query_order=None, top=None, continuation_token=None, min_metrics_time=None, definition_ids=None, path=None, built_after=None, not_built_after=None, include_all_properties=None, include_latest_builds=None, task_id_filter=None, process_type=None, yaml_filename=None): """GetDefinitions. Gets a list of definitions. :param str project: Project ID or project name :param str name: If specified, filters to definitions whose names match this pattern. :param str repository_id: A repository ID. If specified, filters to definitions that use this repository. :param str repository_type: If specified, filters to definitions that have a repository of this type. :param str query_order: Indicates the order in which definitions should be returned. :param int top: The maximum number of definitions to return. :param str continuation_token: A continuation token, returned by a previous call to this method, that can be used to return the next set of definitions. :param datetime min_metrics_time: If specified, indicates the date from which metrics should be included. :param [int] definition_ids: A comma-delimited list that specifies the IDs of definitions to retrieve. :param str path: If specified, filters to definitions under this folder. :param datetime built_after: If specified, filters to definitions that have builds after this date. :param datetime not_built_after: If specified, filters to definitions that do not have builds after this date. :param bool include_all_properties: Indicates whether the full definitions should be returned. By default, shallow representations of the definitions are returned. :param bool include_latest_builds: Indicates whether to return the latest and latest completed builds for this definition. :param str task_id_filter: If specified, filters to definitions that use the specified task. :param int process_type: If specified, filters to definitions with the given process type. :param str yaml_filename: If specified, filters to YAML definitions that match the given filename. :rtype: :class:`` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if name is not None: query_parameters['name'] = self._serialize.query('name', name, 'str') if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if repository_type is not None: query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') if definition_ids is not None: definition_ids = ",".join(map(str, definition_ids)) query_parameters['definitionIds'] = self._serialize.query('definition_ids', definition_ids, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') if built_after is not None: query_parameters['builtAfter'] = self._serialize.query('built_after', built_after, 'iso-8601') if not_built_after is not None: query_parameters['notBuiltAfter'] = self._serialize.query('not_built_after', not_built_after, 'iso-8601') if include_all_properties is not None: query_parameters['includeAllProperties'] = self._serialize.query('include_all_properties', include_all_properties, 'bool') if include_latest_builds is not None: query_parameters['includeLatestBuilds'] = self._serialize.query('include_latest_builds', include_latest_builds, 'bool') if task_id_filter is not None: query_parameters['taskIdFilter'] = self._serialize.query('task_id_filter', task_id_filter, 'str') if process_type is not None: query_parameters['processType'] = self._serialize.query('process_type', process_type, 'int') if yaml_filename is not None: query_parameters['yamlFilename'] = self._serialize.query('yaml_filename', yaml_filename, 'str') response = self._send(http_method='GET', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters) response_value = self._deserialize('[BuildDefinitionReference]', self._unwrap_collection(response)) continuation_token = self._get_continuation_token(response) return self.GetDefinitionsResponseValue(response_value, continuation_token) class GetDefinitionsResponseValue(object): def __init__(self, value, continuation_token): """ Response for the get_definitions method :param value: :type value: :class:`<[BuildDefinitionReference]> ` :param continuation_token: The continuation token to be used to get the next page of results. :type continuation_token: str """ self.value = value self.continuation_token = continuation_token def restore_definition(self, project, definition_id, deleted): """RestoreDefinition. Restores a deleted definition :param str project: Project ID or project name :param int definition_id: The identifier of the definition to restore. :param bool deleted: When false, restores a deleted definition. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if deleted is not None: query_parameters['deleted'] = self._serialize.query('deleted', deleted, 'bool') response = self._send(http_method='PATCH', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildDefinition', response) def update_definition(self, definition, project, definition_id, secrets_source_definition_id=None, secrets_source_definition_revision=None): """UpdateDefinition. Updates an existing definition. :param :class:` ` definition: The new version of the defintion. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int secrets_source_definition_id: :param int secrets_source_definition_revision: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if secrets_source_definition_id is not None: query_parameters['secretsSourceDefinitionId'] = self._serialize.query('secrets_source_definition_id', secrets_source_definition_id, 'int') if secrets_source_definition_revision is not None: query_parameters['secretsSourceDefinitionRevision'] = self._serialize.query('secrets_source_definition_revision', secrets_source_definition_revision, 'int') content = self._serialize.body(definition, 'BuildDefinition') response = self._send(http_method='PUT', location_id='dbeaf647-6167-421a-bda9-c9327b25e2e6', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('BuildDefinition', response) def get_file_contents(self, project, provider_name, service_endpoint_id=None, repository=None, commit_or_branch=None, path=None, **kwargs): """GetFileContents. [Preview API] Gets the contents of a file in the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories. :param str commit_or_branch: The identifier of the commit or branch from which a file's contents are retrieved. :param str path: The path to the file to retrieve, relative to the root of the repository. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') if commit_or_branch is not None: query_parameters['commitOrBranch'] = self._serialize.query('commit_or_branch', commit_or_branch, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='29d12225-b1d9-425f-b668-6c594a981313', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def create_folder(self, folder, project, path): """CreateFolder. [Preview API] Creates a new folder. :param :class:` ` folder: The folder. :param str project: Project ID or project name :param str path: The full path of the folder. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') content = self._serialize.body(folder, 'Folder') response = self._send(http_method='PUT', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Folder', response) def delete_folder(self, project, path): """DeleteFolder. [Preview API] Deletes a definition folder. Definitions and their corresponding builds will also be deleted. :param str project: Project ID or project name :param str path: The full path to the folder. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') self._send(http_method='DELETE', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters) def get_folders(self, project, path=None, query_order=None): """GetFolders. [Preview API] Gets a list of build definition folders. :param str project: Project ID or project name :param str path: The path to start with. :param str query_order: The order in which folders should be returned. :rtype: [Folder] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if path is not None: route_values['path'] = self._serialize.url('path', path, 'str') query_parameters = {} if query_order is not None: query_parameters['queryOrder'] = self._serialize.query('query_order', query_order, 'str') response = self._send(http_method='GET', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Folder]', self._unwrap_collection(response)) def update_folder(self, folder, project, path): """UpdateFolder. [Preview API] Updates an existing folder at given existing path :param :class:` ` folder: The new version of the folder. :param str project: Project ID or project name :param str path: The full path to the folder. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') content = self._serialize.body(folder, 'Folder') response = self._send(http_method='POST', location_id='a906531b-d2da-4f55-bda7-f3e676cc50d9', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('Folder', response) def get_latest_build(self, project, definition, branch_name=None): """GetLatestBuild. [Preview API] Gets the latest build for a definition, optionally scoped to a specific branch. :param str project: Project ID or project name :param str definition: definition name with optional leading folder path, or the definition id :param str branch_name: optional parameter that indicates the specific branch to use :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition is not None: route_values['definition'] = self._serialize.url('definition', definition, 'str') query_parameters = {} if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') response = self._send(http_method='GET', location_id='54481611-01f4-47f3-998f-160da0f0c229', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Build', response) def get_build_log(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): """GetBuildLog. Gets an individual log file for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int log_id: The ID of the log file. :param long start_line: The start line. :param long end_line: The end line. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/plain') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_build_log_lines(self, project, build_id, log_id, start_line=None, end_line=None): """GetBuildLogLines. Gets an individual log file for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int log_id: The ID of the log file. :param long start_line: The start line. :param long end_line: The end line. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def get_build_logs(self, project, build_id): """GetBuildLogs. Gets the logs for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [BuildLog] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values) return self._deserialize('[BuildLog]', self._unwrap_collection(response)) def get_build_logs_zip(self, project, build_id, **kwargs): """GetBuildLogsZip. Gets the logs for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_build_log_zip(self, project, build_id, log_id, start_line=None, end_line=None, **kwargs): """GetBuildLogZip. Gets an individual log file for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int log_id: The ID of the log file. :param long start_line: The start line. :param long end_line: The end line. :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if log_id is not None: route_values['logId'] = self._serialize.url('log_id', log_id, 'int') query_parameters = {} if start_line is not None: query_parameters['startLine'] = self._serialize.query('start_line', start_line, 'long') if end_line is not None: query_parameters['endLine'] = self._serialize.query('end_line', end_line, 'long') response = self._send(http_method='GET', location_id='35a80daf-7f30-45fc-86e8-6b813d9c90df', version='5.1', route_values=route_values, query_parameters=query_parameters, accept_media_type='application/zip') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def get_project_metrics(self, project, metric_aggregation_type=None, min_metrics_time=None): """GetProjectMetrics. [Preview API] Gets build metrics for a project. :param str project: Project ID or project name :param str metric_aggregation_type: The aggregation type to use (hourly, daily). :param datetime min_metrics_time: The date from which to calculate metrics. :rtype: [BuildMetric] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if metric_aggregation_type is not None: route_values['metricAggregationType'] = self._serialize.url('metric_aggregation_type', metric_aggregation_type, 'str') query_parameters = {} if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') response = self._send(http_method='GET', location_id='7433fae7-a6bc-41dc-a6e2-eef9005ce41a', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[BuildMetric]', self._unwrap_collection(response)) def get_definition_metrics(self, project, definition_id, min_metrics_time=None): """GetDefinitionMetrics. [Preview API] Gets build metrics for a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param datetime min_metrics_time: The date from which to calculate metrics. :rtype: [BuildMetric] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if min_metrics_time is not None: query_parameters['minMetricsTime'] = self._serialize.query('min_metrics_time', min_metrics_time, 'iso-8601') response = self._send(http_method='GET', location_id='d973b939-0ce0-4fec-91d8-da3940fa1827', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[BuildMetric]', self._unwrap_collection(response)) def get_build_option_definitions(self, project=None): """GetBuildOptionDefinitions. Gets all build definition options supported by the system. :param str project: Project ID or project name :rtype: [BuildOptionDefinition] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='591cb5a4-2d46-4f3a-a697-5cd42b6bd332', version='5.1', route_values=route_values) return self._deserialize('[BuildOptionDefinition]', self._unwrap_collection(response)) def get_path_contents(self, project, provider_name, service_endpoint_id=None, repository=None, commit_or_branch=None, path=None): """GetPathContents. [Preview API] Gets the contents of a directory in the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of the repository to get branches. Can only be omitted for providers that do not support multiple repositories. :param str commit_or_branch: The identifier of the commit or branch from which a file's contents are retrieved. :param str path: The path contents to list, relative to the root of the repository. :rtype: [SourceRepositoryItem] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') if commit_or_branch is not None: query_parameters['commitOrBranch'] = self._serialize.query('commit_or_branch', commit_or_branch, 'str') if path is not None: query_parameters['path'] = self._serialize.query('path', path, 'str') response = self._send(http_method='GET', location_id='7944d6fb-df01-4709-920a-7a189aa34037', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[SourceRepositoryItem]', self._unwrap_collection(response)) def get_build_properties(self, project, build_id, filter=None): """GetBuildProperties. [Preview API] Gets properties for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param [str] filter: A comma-delimited list of properties. If specified, filters to these specific properties. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if filter is not None: filter = ",".join(filter) query_parameters['filter'] = self._serialize.query('filter', filter, 'str') response = self._send(http_method='GET', location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def update_build_properties(self, document, project, build_id): """UpdateBuildProperties. [Preview API] Updates properties for a build. :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='0a6312e9-0627-49b7-8083-7d74a64849c9', version='5.1-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') return self._deserialize('object', response) def get_definition_properties(self, project, definition_id, filter=None): """GetDefinitionProperties. [Preview API] Gets properties for a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param [str] filter: A comma-delimited list of properties. If specified, filters to these specific properties. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if filter is not None: filter = ",".join(filter) query_parameters['filter'] = self._serialize.query('filter', filter, 'str') response = self._send(http_method='GET', location_id='d9826ad7-2a68-46a9-a6e9-677698777895', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('object', response) def update_definition_properties(self, document, project, definition_id): """UpdateDefinitionProperties. [Preview API] Updates properties for a definition. :param :class:`<[JsonPatchOperation]> ` document: A json-patch document describing the properties to update. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') content = self._serialize.body(document, '[JsonPatchOperation]') response = self._send(http_method='PATCH', location_id='d9826ad7-2a68-46a9-a6e9-677698777895', version='5.1-preview.1', route_values=route_values, content=content, media_type='application/json-patch+json') return self._deserialize('object', response) def get_pull_request(self, project, provider_name, pull_request_id, repository_id=None, service_endpoint_id=None): """GetPullRequest. [Preview API] Gets a pull request object from source provider. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str pull_request_id: Vendor-specific id of the pull request. :param str repository_id: Vendor-specific identifier or the name of the repository that contains the pull request. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') if pull_request_id is not None: route_values['pullRequestId'] = self._serialize.url('pull_request_id', pull_request_id, 'str') query_parameters = {} if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') response = self._send(http_method='GET', location_id='d8763ec7-9ff0-4fb4-b2b2-9d757906ff14', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('PullRequest', response) def get_build_report(self, project, build_id, type=None): """GetBuildReport. [Preview API] Gets a build report. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('BuildReportMetadata', response) def get_build_report_html_content(self, project, build_id, type=None, **kwargs): """GetBuildReportHtmlContent. [Preview API] Gets a build report. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str type: :rtype: object """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if type is not None: query_parameters['type'] = self._serialize.query('type', type, 'str') response = self._send(http_method='GET', location_id='45bcaa88-67e1-4042-a035-56d3b4a7d44c', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters, accept_media_type='text/html') if "callback" in kwargs: callback = kwargs["callback"] else: callback = None return self._client.stream_download(response, callback=callback) def list_repositories(self, project, provider_name, service_endpoint_id=None, repository=None, result_set=None, page_results=None, continuation_token=None): """ListRepositories. [Preview API] Gets a list of source code repositories. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of a single repository to get. :param str result_set: 'top' for the repositories most relevant for the endpoint. If not set, all repositories are returned. Ignored if 'repository' is set. :param bool page_results: If set to true, this will limit the set of results and will return a continuation token to continue the query. :param str continuation_token: When paging results, this is a continuation token, returned by a previous call to this method, that can be used to return the next set of repositories. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') if result_set is not None: query_parameters['resultSet'] = self._serialize.query('result_set', result_set, 'str') if page_results is not None: query_parameters['pageResults'] = self._serialize.query('page_results', page_results, 'bool') if continuation_token is not None: query_parameters['continuationToken'] = self._serialize.query('continuation_token', continuation_token, 'str') response = self._send(http_method='GET', location_id='d44d1680-f978-4834-9b93-8c6e132329c9', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('SourceRepositories', response) def authorize_definition_resources(self, resources, project, definition_id): """AuthorizeDefinitionResources. [Preview API] :param [DefinitionResourceReference] resources: :param str project: Project ID or project name :param int definition_id: :rtype: [DefinitionResourceReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') content = self._serialize.body(resources, '[DefinitionResourceReference]') response = self._send(http_method='PATCH', location_id='ea623316-1967-45eb-89ab-e9e6110cf2d6', version='5.1-preview.1', route_values=route_values, content=content) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def get_definition_resources(self, project, definition_id): """GetDefinitionResources. [Preview API] :param str project: Project ID or project name :param int definition_id: :rtype: [DefinitionResourceReference] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='ea623316-1967-45eb-89ab-e9e6110cf2d6', version='5.1-preview.1', route_values=route_values) return self._deserialize('[DefinitionResourceReference]', self._unwrap_collection(response)) def get_resource_usage(self): """GetResourceUsage. [Preview API] Gets information about build resources in the system. :rtype: :class:` ` """ response = self._send(http_method='GET', location_id='3813d06c-9e36-4ea1-aac3-61a485d60e3d', version='5.1-preview.2') return self._deserialize('BuildResourceUsage', response) def get_definition_revisions(self, project, definition_id): """GetDefinitionRevisions. Gets all revisions of a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :rtype: [BuildDefinitionRevision] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') response = self._send(http_method='GET', location_id='7c116775-52e5-453e-8c5d-914d9762d8c4', version='5.1', route_values=route_values) return self._deserialize('[BuildDefinitionRevision]', self._unwrap_collection(response)) def get_build_settings(self, project=None): """GetBuildSettings. Gets the build settings. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', version='5.1', route_values=route_values) return self._deserialize('BuildSettings', response) def update_build_settings(self, settings, project=None): """UpdateBuildSettings. Updates the build settings. :param :class:` ` settings: The new settings. :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(settings, 'BuildSettings') response = self._send(http_method='PATCH', location_id='aa8c1c9c-ef8b-474a-b8c4-785c7b191d0d', version='5.1', route_values=route_values, content=content) return self._deserialize('BuildSettings', response) def list_source_providers(self, project): """ListSourceProviders. [Preview API] Get a list of source providers and their capabilities. :param str project: Project ID or project name :rtype: [SourceProviderAttributes] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='3ce81729-954f-423d-a581-9fea01d25186', version='5.1-preview.1', route_values=route_values) return self._deserialize('[SourceProviderAttributes]', self._unwrap_collection(response)) def get_status_badge(self, project, definition, branch_name=None, stage_name=None, job_name=None, configuration=None, label=None): """GetStatusBadge. [Preview API]

Gets the build status for a definition, optionally scoped to a specific branch, stage, job, and configuration.

If there are more than one, then it is required to pass in a stageName value when specifying a jobName, and the same rule then applies for both if passing a configuration parameter.

:param str project: Project ID or project name :param str definition: Either the definition name with optional leading folder path, or the definition id. :param str branch_name: Only consider the most recent build for this branch. :param str stage_name: Use this stage within the pipeline to render the status. :param str job_name: Use this job within a stage of the pipeline to render the status. :param str configuration: Use this job configuration to render the status :param str label: Replaces the default text on the left side of the badge. :rtype: str """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition is not None: route_values['definition'] = self._serialize.url('definition', definition, 'str') query_parameters = {} if branch_name is not None: query_parameters['branchName'] = self._serialize.query('branch_name', branch_name, 'str') if stage_name is not None: query_parameters['stageName'] = self._serialize.query('stage_name', stage_name, 'str') if job_name is not None: query_parameters['jobName'] = self._serialize.query('job_name', job_name, 'str') if configuration is not None: query_parameters['configuration'] = self._serialize.query('configuration', configuration, 'str') if label is not None: query_parameters['label'] = self._serialize.query('label', label, 'str') response = self._send(http_method='GET', location_id='07acfdce-4757-4439-b422-ddd13a2fcc10', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('str', response) def add_build_tag(self, project, build_id, tag): """AddBuildTag. Adds a tag to a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str tag: The tag to add. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.1', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def add_build_tags(self, tags, project, build_id): """AddBuildTags. Adds tags to a build. :param [str] tags: The tags to add. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.1', route_values=route_values, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_build_tag(self, project, build_id, tag): """DeleteBuildTag. Removes a tag from a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param str tag: The tag to remove. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.1', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_build_tags(self, project, build_id): """GetBuildTags. Gets the tags for a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') response = self._send(http_method='GET', location_id='6e6114b2-8161-44c8-8f6c-c5505782427f', version='5.1', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_tags(self, project): """GetTags. Gets a list of all build and definition tags in the project. :param str project: Project ID or project name :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='d84ac5c6-edc7-43d5-adc9-1b34be5dea09', version='5.1', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def add_definition_tag(self, project, definition_id, tag): """AddDefinitionTag. [Preview API] Adds a tag to a definition :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param str tag: The tag to add. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='PUT', location_id='cb894432-134a-4d31-a839-83beceaace4b', version='5.1-preview.2', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def add_definition_tags(self, tags, project, definition_id): """AddDefinitionTags. [Preview API] Adds multiple tags to a definition. :param [str] tags: The tags to add. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') content = self._serialize.body(tags, '[str]') response = self._send(http_method='POST', location_id='cb894432-134a-4d31-a839-83beceaace4b', version='5.1-preview.2', route_values=route_values, content=content) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_definition_tag(self, project, definition_id, tag): """DeleteDefinitionTag. [Preview API] Removes a tag from a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param str tag: The tag to remove. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') if tag is not None: route_values['tag'] = self._serialize.url('tag', tag, 'str') response = self._send(http_method='DELETE', location_id='cb894432-134a-4d31-a839-83beceaace4b', version='5.1-preview.2', route_values=route_values) return self._deserialize('[str]', self._unwrap_collection(response)) def get_definition_tags(self, project, definition_id, revision=None): """GetDefinitionTags. [Preview API] Gets the tags for a definition. :param str project: Project ID or project name :param int definition_id: The ID of the definition. :param int revision: The definition revision number. If not specified, uses the latest revision of the definition. :rtype: [str] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if definition_id is not None: route_values['definitionId'] = self._serialize.url('definition_id', definition_id, 'int') query_parameters = {} if revision is not None: query_parameters['revision'] = self._serialize.query('revision', revision, 'int') response = self._send(http_method='GET', location_id='cb894432-134a-4d31-a839-83beceaace4b', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[str]', self._unwrap_collection(response)) def delete_template(self, project, template_id): """DeleteTemplate. Deletes a build definition template. :param str project: Project ID or project name :param str template_id: The ID of the template. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') self._send(http_method='DELETE', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.1', route_values=route_values) def get_template(self, project, template_id): """GetTemplate. Gets a specific build definition template. :param str project: Project ID or project name :param str template_id: The ID of the requested template. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.1', route_values=route_values) return self._deserialize('BuildDefinitionTemplate', response) def get_templates(self, project): """GetTemplates. Gets all definition templates. :param str project: Project ID or project name :rtype: [BuildDefinitionTemplate] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') response = self._send(http_method='GET', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.1', route_values=route_values) return self._deserialize('[BuildDefinitionTemplate]', self._unwrap_collection(response)) def save_template(self, template, project, template_id): """SaveTemplate. Updates an existing build definition template. :param :class:` ` template: The new version of the template. :param str project: Project ID or project name :param str template_id: The ID of the template. :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if template_id is not None: route_values['templateId'] = self._serialize.url('template_id', template_id, 'str') content = self._serialize.body(template, 'BuildDefinitionTemplate') response = self._send(http_method='PUT', location_id='e884571e-7f92-4d6a-9274-3f5649900835', version='5.1', route_values=route_values, content=content) return self._deserialize('BuildDefinitionTemplate', response) def get_build_timeline(self, project, build_id, timeline_id=None, change_id=None, plan_id=None): """GetBuildTimeline. Gets details for a build :param str project: Project ID or project name :param int build_id: :param str timeline_id: :param int change_id: :param str plan_id: :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') if timeline_id is not None: route_values['timelineId'] = self._serialize.url('timeline_id', timeline_id, 'str') query_parameters = {} if change_id is not None: query_parameters['changeId'] = self._serialize.query('change_id', change_id, 'int') if plan_id is not None: query_parameters['planId'] = self._serialize.query('plan_id', plan_id, 'str') response = self._send(http_method='GET', location_id='8baac422-4c6e-4de5-8532-db96d92acffa', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('Timeline', response) def restore_webhooks(self, trigger_types, project, provider_name, service_endpoint_id=None, repository=None): """RestoreWebhooks. [Preview API] Recreates the webhooks for the specified triggers in the given source code repository. :param [DefinitionTriggerType] trigger_types: The types of triggers to restore webhooks for. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories. """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') content = self._serialize.body(trigger_types, '[DefinitionTriggerType]') self._send(http_method='POST', location_id='793bceb8-9736-4030-bd2f-fb3ce6d6b478', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters, content=content) def list_webhooks(self, project, provider_name, service_endpoint_id=None, repository=None): """ListWebhooks. [Preview API] Gets a list of webhooks installed in the given source code repository. :param str project: Project ID or project name :param str provider_name: The name of the source provider. :param str service_endpoint_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TFVC or TFGit. :param str repository: If specified, the vendor-specific identifier or the name of the repository to get webhooks. Can only be omitted for providers that do not support multiple repositories. :rtype: [RepositoryWebhook] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if provider_name is not None: route_values['providerName'] = self._serialize.url('provider_name', provider_name, 'str') query_parameters = {} if service_endpoint_id is not None: query_parameters['serviceEndpointId'] = self._serialize.query('service_endpoint_id', service_endpoint_id, 'str') if repository is not None: query_parameters['repository'] = self._serialize.query('repository', repository, 'str') response = self._send(http_method='GET', location_id='8f20ff82-9498-4812-9f6e-9c01bdc50e99', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[RepositoryWebhook]', self._unwrap_collection(response)) def get_build_work_items_refs(self, project, build_id, top=None): """GetBuildWorkItemsRefs. Gets the work items associated with a build. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int top: The maximum number of work items to return. :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', version='5.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) def get_build_work_items_refs_from_commits(self, commit_ids, project, build_id, top=None): """GetBuildWorkItemsRefsFromCommits. Gets the work items associated with a build, filtered to specific commits. :param [str] commit_ids: A comma-delimited list of commit IDs. :param str project: Project ID or project name :param int build_id: The ID of the build. :param int top: The maximum number of work items to return, or the number of commits to consider if no commit IDs are specified. :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') if build_id is not None: route_values['buildId'] = self._serialize.url('build_id', build_id, 'int') query_parameters = {} if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') content = self._serialize.body(commit_ids, '[str]') response = self._send(http_method='POST', location_id='5a21f5d2-5642-47e4-a0bd-1356e6731bee', version='5.1', route_values=route_values, query_parameters=query_parameters, content=content) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) def get_work_items_between_builds(self, project, from_build_id, to_build_id, top=None): """GetWorkItemsBetweenBuilds. [Preview API] Gets all the work items between two builds. :param str project: Project ID or project name :param int from_build_id: The ID of the first build. :param int to_build_id: The ID of the last build. :param int top: The maximum number of work items to return. :rtype: [ResourceRef] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if from_build_id is not None: query_parameters['fromBuildId'] = self._serialize.query('from_build_id', from_build_id, 'int') if to_build_id is not None: query_parameters['toBuildId'] = self._serialize.query('to_build_id', to_build_id, 'int') if top is not None: query_parameters['$top'] = self._serialize.query('top', top, 'int') response = self._send(http_method='GET', location_id='52ba8915-5518-42e3-a4bb-b0182d159e2d', version='5.1-preview.2', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ResourceRef]', self._unwrap_collection(response)) azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/build/models.py000066400000000000000000003750441360605530400320270ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest.serialization import Model class AgentPoolQueue(Model): """ Represents a queue for running builds. :param _links: :type _links: :class:`ReferenceLinks ` :param id: The ID of the queue. :type id: int :param name: The name of the queue. :type name: str :param pool: The pool used by this queue. :type pool: :class:`TaskAgentPoolReference ` :param url: The full http link to the resource. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'pool': {'key': 'pool', 'type': 'TaskAgentPoolReference'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, id=None, name=None, pool=None, url=None): super(AgentPoolQueue, self).__init__() self._links = _links self.id = id self.name = name self.pool = pool self.url = url class AgentSpecification(Model): """ Specification of the agent defined by the pool provider. :param identifier: Agent specification unique identifier. :type identifier: str """ _attribute_map = { 'identifier': {'key': 'identifier', 'type': 'str'} } def __init__(self, identifier=None): super(AgentSpecification, self).__init__() self.identifier = identifier class AggregatedResultsAnalysis(Model): """ :param duration: :type duration: object :param not_reported_results_by_outcome: :type not_reported_results_by_outcome: dict :param previous_context: :type previous_context: :class:`TestResultsContext ` :param results_by_outcome: :type results_by_outcome: dict :param results_difference: :type results_difference: :class:`AggregatedResultsDifference ` :param run_summary_by_outcome: :type run_summary_by_outcome: dict :param run_summary_by_state: :type run_summary_by_state: dict :param total_tests: :type total_tests: int """ _attribute_map = { 'duration': {'key': 'duration', 'type': 'object'}, 'not_reported_results_by_outcome': {'key': 'notReportedResultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'previous_context': {'key': 'previousContext', 'type': 'TestResultsContext'}, 'results_by_outcome': {'key': 'resultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'results_difference': {'key': 'resultsDifference', 'type': 'AggregatedResultsDifference'}, 'run_summary_by_outcome': {'key': 'runSummaryByOutcome', 'type': '{AggregatedRunsByOutcome}'}, 'run_summary_by_state': {'key': 'runSummaryByState', 'type': '{AggregatedRunsByState}'}, 'total_tests': {'key': 'totalTests', 'type': 'int'} } def __init__(self, duration=None, not_reported_results_by_outcome=None, previous_context=None, results_by_outcome=None, results_difference=None, run_summary_by_outcome=None, run_summary_by_state=None, total_tests=None): super(AggregatedResultsAnalysis, self).__init__() self.duration = duration self.not_reported_results_by_outcome = not_reported_results_by_outcome self.previous_context = previous_context self.results_by_outcome = results_by_outcome self.results_difference = results_difference self.run_summary_by_outcome = run_summary_by_outcome self.run_summary_by_state = run_summary_by_state self.total_tests = total_tests class AggregatedResultsByOutcome(Model): """ :param count: :type count: int :param duration: :type duration: object :param group_by_field: :type group_by_field: str :param group_by_value: :type group_by_value: object :param outcome: :type outcome: object :param rerun_result_count: :type rerun_result_count: int """ _attribute_map = { 'count': {'key': 'count', 'type': 'int'}, 'duration': {'key': 'duration', 'type': 'object'}, 'group_by_field': {'key': 'groupByField', 'type': 'str'}, 'group_by_value': {'key': 'groupByValue', 'type': 'object'}, 'outcome': {'key': 'outcome', 'type': 'object'}, 'rerun_result_count': {'key': 'rerunResultCount', 'type': 'int'} } def __init__(self, count=None, duration=None, group_by_field=None, group_by_value=None, outcome=None, rerun_result_count=None): super(AggregatedResultsByOutcome, self).__init__() self.count = count self.duration = duration self.group_by_field = group_by_field self.group_by_value = group_by_value self.outcome = outcome self.rerun_result_count = rerun_result_count class AggregatedResultsDifference(Model): """ :param increase_in_duration: :type increase_in_duration: object :param increase_in_failures: :type increase_in_failures: int :param increase_in_other_tests: :type increase_in_other_tests: int :param increase_in_passed_tests: :type increase_in_passed_tests: int :param increase_in_total_tests: :type increase_in_total_tests: int """ _attribute_map = { 'increase_in_duration': {'key': 'increaseInDuration', 'type': 'object'}, 'increase_in_failures': {'key': 'increaseInFailures', 'type': 'int'}, 'increase_in_other_tests': {'key': 'increaseInOtherTests', 'type': 'int'}, 'increase_in_passed_tests': {'key': 'increaseInPassedTests', 'type': 'int'}, 'increase_in_total_tests': {'key': 'increaseInTotalTests', 'type': 'int'} } def __init__(self, increase_in_duration=None, increase_in_failures=None, increase_in_other_tests=None, increase_in_passed_tests=None, increase_in_total_tests=None): super(AggregatedResultsDifference, self).__init__() self.increase_in_duration = increase_in_duration self.increase_in_failures = increase_in_failures self.increase_in_other_tests = increase_in_other_tests self.increase_in_passed_tests = increase_in_passed_tests self.increase_in_total_tests = increase_in_total_tests class AggregatedRunsByOutcome(Model): """ :param outcome: :type outcome: object :param runs_count: :type runs_count: int """ _attribute_map = { 'outcome': {'key': 'outcome', 'type': 'object'}, 'runs_count': {'key': 'runsCount', 'type': 'int'} } def __init__(self, outcome=None, runs_count=None): super(AggregatedRunsByOutcome, self).__init__() self.outcome = outcome self.runs_count = runs_count class AggregatedRunsByState(Model): """ :param results_by_outcome: :type results_by_outcome: dict :param runs_count: :type runs_count: int :param state: :type state: object """ _attribute_map = { 'results_by_outcome': {'key': 'resultsByOutcome', 'type': '{AggregatedResultsByOutcome}'}, 'runs_count': {'key': 'runsCount', 'type': 'int'}, 'state': {'key': 'state', 'type': 'object'} } def __init__(self, results_by_outcome=None, runs_count=None, state=None): super(AggregatedRunsByState, self).__init__() self.results_by_outcome = results_by_outcome self.runs_count = runs_count self.state = state class ArtifactResource(Model): """ :param _links: :type _links: :class:`ReferenceLinks ` :param data: Type-specific data about the artifact. :type data: str :param download_url: A link to download the resource. :type download_url: str :param properties: Type-specific properties of the artifact. :type properties: dict :param type: The type of the resource: File container, version control folder, UNC path, etc. :type type: str :param url: The full http link to the resource. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'data': {'key': 'data', 'type': 'str'}, 'download_url': {'key': 'downloadUrl', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, data=None, download_url=None, properties=None, type=None, url=None): super(ArtifactResource, self).__init__() self._links = _links self.data = data self.download_url = download_url self.properties = properties self.type = type self.url = url class AssociatedWorkItem(Model): """ :param assigned_to: :type assigned_to: str :param id: Id of associated the work item. :type id: int :param state: :type state: str :param title: :type title: str :param url: REST Url of the work item. :type url: str :param web_url: :type web_url: str :param work_item_type: :type work_item_type: str """ _attribute_map = { 'assigned_to': {'key': 'assignedTo', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'state': {'key': 'state', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'web_url': {'key': 'webUrl', 'type': 'str'}, 'work_item_type': {'key': 'workItemType', 'type': 'str'} } def __init__(self, assigned_to=None, id=None, state=None, title=None, url=None, web_url=None, work_item_type=None): super(AssociatedWorkItem, self).__init__() self.assigned_to = assigned_to self.id = id self.state = state self.title = title self.url = url self.web_url = web_url self.work_item_type = work_item_type class Attachment(Model): """ Represents an attachment to a build. :param _links: :type _links: :class:`ReferenceLinks ` :param name: The name of the attachment. :type name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, _links=None, name=None): super(Attachment, self).__init__() self._links = _links self.name = name class AuthorizationHeader(Model): """ :param name: :type name: str :param value: :type value: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, name=None, value=None): super(AuthorizationHeader, self).__init__() self.name = name self.value = value class Build(Model): """ Data representation of a build. :param _links: :type _links: :class:`ReferenceLinks ` :param agent_specification: The agent specification for the build. :type agent_specification: :class:`AgentSpecification ` :param build_number: The build number/name of the build. :type build_number: str :param build_number_revision: The build number revision. :type build_number_revision: int :param controller: The build controller. This is only set if the definition type is Xaml. :type controller: :class:`BuildController ` :param definition: The definition associated with the build. :type definition: :class:`DefinitionReference ` :param deleted: Indicates whether the build has been deleted. :type deleted: bool :param deleted_by: The identity of the process or person that deleted the build. :type deleted_by: :class:`IdentityRef ` :param deleted_date: The date the build was deleted. :type deleted_date: datetime :param deleted_reason: The description of how the build was deleted. :type deleted_reason: str :param demands: A list of demands that represents the agent capabilities required by this build. :type demands: list of :class:`object ` :param finish_time: The time that the build was completed. :type finish_time: datetime :param id: The ID of the build. :type id: int :param keep_forever: Indicates whether the build should be skipped by retention policies. :type keep_forever: bool :param last_changed_by: The identity representing the process or person that last changed the build. :type last_changed_by: :class:`IdentityRef ` :param last_changed_date: The date the build was last changed. :type last_changed_date: datetime :param logs: Information about the build logs. :type logs: :class:`BuildLogReference ` :param orchestration_plan: The orchestration plan for the build. :type orchestration_plan: :class:`TaskOrchestrationPlanReference ` :param parameters: The parameters for the build. :type parameters: str :param plans: Orchestration plans associated with the build (build, cleanup) :type plans: list of :class:`TaskOrchestrationPlanReference ` :param priority: The build's priority. :type priority: object :param project: The team project. :type project: :class:`TeamProjectReference ` :param properties: :type properties: :class:`object ` :param quality: The quality of the xaml build (good, bad, etc.) :type quality: str :param queue: The queue. This is only set if the definition type is Build. :type queue: :class:`AgentPoolQueue ` :param queue_options: Additional options for queueing the build. :type queue_options: object :param queue_position: The current position of the build in the queue. :type queue_position: int :param queue_time: The time that the build was queued. :type queue_time: datetime :param reason: The reason that the build was created. :type reason: object :param repository: The repository. :type repository: :class:`BuildRepository ` :param requested_by: The identity that queued the build. :type requested_by: :class:`IdentityRef ` :param requested_for: The identity on whose behalf the build was queued. :type requested_for: :class:`IdentityRef ` :param result: The build result. :type result: object :param retained_by_release: Indicates whether the build is retained by a release. :type retained_by_release: bool :param source_branch: The source branch. :type source_branch: str :param source_version: The source version. :type source_version: str :param start_time: The time that the build was started. :type start_time: datetime :param status: The status of the build. :type status: object :param tags: :type tags: list of str :param triggered_by_build: The build that triggered this build via a Build completion trigger. :type triggered_by_build: :class:`Build ` :param trigger_info: Sourceprovider-specific information about what triggered the build :type trigger_info: dict :param uri: The URI of the build. :type uri: str :param url: The REST URL of the build. :type url: str :param validation_results: :type validation_results: list of :class:`BuildRequestValidationResult ` """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'agent_specification': {'key': 'agentSpecification', 'type': 'AgentSpecification'}, 'build_number': {'key': 'buildNumber', 'type': 'str'}, 'build_number_revision': {'key': 'buildNumberRevision', 'type': 'int'}, 'controller': {'key': 'controller', 'type': 'BuildController'}, 'definition': {'key': 'definition', 'type': 'DefinitionReference'}, 'deleted': {'key': 'deleted', 'type': 'bool'}, 'deleted_by': {'key': 'deletedBy', 'type': 'IdentityRef'}, 'deleted_date': {'key': 'deletedDate', 'type': 'iso-8601'}, 'deleted_reason': {'key': 'deletedReason', 'type': 'str'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'keep_forever': {'key': 'keepForever', 'type': 'bool'}, 'last_changed_by': {'key': 'lastChangedBy', 'type': 'IdentityRef'}, 'last_changed_date': {'key': 'lastChangedDate', 'type': 'iso-8601'}, 'logs': {'key': 'logs', 'type': 'BuildLogReference'}, 'orchestration_plan': {'key': 'orchestrationPlan', 'type': 'TaskOrchestrationPlanReference'}, 'parameters': {'key': 'parameters', 'type': 'str'}, 'plans': {'key': 'plans', 'type': '[TaskOrchestrationPlanReference]'}, 'priority': {'key': 'priority', 'type': 'object'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'properties': {'key': 'properties', 'type': 'object'}, 'quality': {'key': 'quality', 'type': 'str'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'}, 'queue_options': {'key': 'queueOptions', 'type': 'object'}, 'queue_position': {'key': 'queuePosition', 'type': 'int'}, 'queue_time': {'key': 'queueTime', 'type': 'iso-8601'}, 'reason': {'key': 'reason', 'type': 'object'}, 'repository': {'key': 'repository', 'type': 'BuildRepository'}, 'requested_by': {'key': 'requestedBy', 'type': 'IdentityRef'}, 'requested_for': {'key': 'requestedFor', 'type': 'IdentityRef'}, 'result': {'key': 'result', 'type': 'object'}, 'retained_by_release': {'key': 'retainedByRelease', 'type': 'bool'}, 'source_branch': {'key': 'sourceBranch', 'type': 'str'}, 'source_version': {'key': 'sourceVersion', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'status': {'key': 'status', 'type': 'object'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'triggered_by_build': {'key': 'triggeredByBuild', 'type': 'Build'}, 'trigger_info': {'key': 'triggerInfo', 'type': '{str}'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'validation_results': {'key': 'validationResults', 'type': '[BuildRequestValidationResult]'} } def __init__(self, _links=None, agent_specification=None, build_number=None, build_number_revision=None, controller=None, definition=None, deleted=None, deleted_by=None, deleted_date=None, deleted_reason=None, demands=None, finish_time=None, id=None, keep_forever=None, last_changed_by=None, last_changed_date=None, logs=None, orchestration_plan=None, parameters=None, plans=None, priority=None, project=None, properties=None, quality=None, queue=None, queue_options=None, queue_position=None, queue_time=None, reason=None, repository=None, requested_by=None, requested_for=None, result=None, retained_by_release=None, source_branch=None, source_version=None, start_time=None, status=None, tags=None, triggered_by_build=None, trigger_info=None, uri=None, url=None, validation_results=None): super(Build, self).__init__() self._links = _links self.agent_specification = agent_specification self.build_number = build_number self.build_number_revision = build_number_revision self.controller = controller self.definition = definition self.deleted = deleted self.deleted_by = deleted_by self.deleted_date = deleted_date self.deleted_reason = deleted_reason self.demands = demands self.finish_time = finish_time self.id = id self.keep_forever = keep_forever self.last_changed_by = last_changed_by self.last_changed_date = last_changed_date self.logs = logs self.orchestration_plan = orchestration_plan self.parameters = parameters self.plans = plans self.priority = priority self.project = project self.properties = properties self.quality = quality self.queue = queue self.queue_options = queue_options self.queue_position = queue_position self.queue_time = queue_time self.reason = reason self.repository = repository self.requested_by = requested_by self.requested_for = requested_for self.result = result self.retained_by_release = retained_by_release self.source_branch = source_branch self.source_version = source_version self.start_time = start_time self.status = status self.tags = tags self.triggered_by_build = triggered_by_build self.trigger_info = trigger_info self.uri = uri self.url = url self.validation_results = validation_results class BuildArtifact(Model): """ Represents an artifact produced by a build. :param id: The artifact ID. :type id: int :param name: The name of the artifact. :type name: str :param resource: The actual resource. :type resource: :class:`ArtifactResource ` :param source: The artifact source, which will be the ID of the job that produced this artifact. :type source: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'resource': {'key': 'resource', 'type': 'ArtifactResource'}, 'source': {'key': 'source', 'type': 'str'} } def __init__(self, id=None, name=None, resource=None, source=None): super(BuildArtifact, self).__init__() self.id = id self.name = name self.resource = resource self.source = source class BuildBadge(Model): """ Represents a build badge. :param build_id: The ID of the build represented by this badge. :type build_id: int :param image_url: A link to the SVG resource. :type image_url: str """ _attribute_map = { 'build_id': {'key': 'buildId', 'type': 'int'}, 'image_url': {'key': 'imageUrl', 'type': 'str'} } def __init__(self, build_id=None, image_url=None): super(BuildBadge, self).__init__() self.build_id = build_id self.image_url = image_url class BuildDefinitionRevision(Model): """ Represents a revision of a build definition. :param changed_by: The identity of the person or process that changed the definition. :type changed_by: :class:`IdentityRef ` :param changed_date: The date and time that the definition was changed. :type changed_date: datetime :param change_type: The change type (add, edit, delete). :type change_type: object :param comment: The comment associated with the change. :type comment: str :param definition_url: A link to the definition at this revision. :type definition_url: str :param name: The name of the definition. :type name: str :param revision: The revision number. :type revision: int """ _attribute_map = { 'changed_by': {'key': 'changedBy', 'type': 'IdentityRef'}, 'changed_date': {'key': 'changedDate', 'type': 'iso-8601'}, 'change_type': {'key': 'changeType', 'type': 'object'}, 'comment': {'key': 'comment', 'type': 'str'}, 'definition_url': {'key': 'definitionUrl', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'int'} } def __init__(self, changed_by=None, changed_date=None, change_type=None, comment=None, definition_url=None, name=None, revision=None): super(BuildDefinitionRevision, self).__init__() self.changed_by = changed_by self.changed_date = changed_date self.change_type = change_type self.comment = comment self.definition_url = definition_url self.name = name self.revision = revision class BuildDefinitionStep(Model): """ Represents a step in a build phase. :param always_run: Indicates whether this step should run even if a previous step fails. :type always_run: bool :param condition: A condition that determines whether this step should run. :type condition: str :param continue_on_error: Indicates whether the phase should continue even if this step fails. :type continue_on_error: bool :param display_name: The display name for this step. :type display_name: str :param enabled: Indicates whether the step is enabled. :type enabled: bool :param environment: :type environment: dict :param inputs: :type inputs: dict :param ref_name: The reference name for this step. :type ref_name: str :param task: The task associated with this step. :type task: :class:`TaskDefinitionReference ` :param timeout_in_minutes: The time, in minutes, that this step is allowed to run. :type timeout_in_minutes: int """ _attribute_map = { 'always_run': {'key': 'alwaysRun', 'type': 'bool'}, 'condition': {'key': 'condition', 'type': 'str'}, 'continue_on_error': {'key': 'continueOnError', 'type': 'bool'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'environment': {'key': 'environment', 'type': '{str}'}, 'inputs': {'key': 'inputs', 'type': '{str}'}, 'ref_name': {'key': 'refName', 'type': 'str'}, 'task': {'key': 'task', 'type': 'TaskDefinitionReference'}, 'timeout_in_minutes': {'key': 'timeoutInMinutes', 'type': 'int'} } def __init__(self, always_run=None, condition=None, continue_on_error=None, display_name=None, enabled=None, environment=None, inputs=None, ref_name=None, task=None, timeout_in_minutes=None): super(BuildDefinitionStep, self).__init__() self.always_run = always_run self.condition = condition self.continue_on_error = continue_on_error self.display_name = display_name self.enabled = enabled self.environment = environment self.inputs = inputs self.ref_name = ref_name self.task = task self.timeout_in_minutes = timeout_in_minutes class BuildDefinitionTemplate(Model): """ Represents a template from which new build definitions can be created. :param can_delete: Indicates whether the template can be deleted. :type can_delete: bool :param category: The template category. :type category: str :param default_hosted_queue: An optional hosted agent queue for the template to use by default. :type default_hosted_queue: str :param description: A description of the template. :type description: str :param icons: :type icons: dict :param icon_task_id: The ID of the task whose icon is used when showing this template in the UI. :type icon_task_id: str :param id: The ID of the template. :type id: str :param name: The name of the template. :type name: str :param template: The actual template. :type template: :class:`BuildDefinition ` """ _attribute_map = { 'can_delete': {'key': 'canDelete', 'type': 'bool'}, 'category': {'key': 'category', 'type': 'str'}, 'default_hosted_queue': {'key': 'defaultHostedQueue', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'icons': {'key': 'icons', 'type': '{str}'}, 'icon_task_id': {'key': 'iconTaskId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'template': {'key': 'template', 'type': 'BuildDefinition'} } def __init__(self, can_delete=None, category=None, default_hosted_queue=None, description=None, icons=None, icon_task_id=None, id=None, name=None, template=None): super(BuildDefinitionTemplate, self).__init__() self.can_delete = can_delete self.category = category self.default_hosted_queue = default_hosted_queue self.description = description self.icons = icons self.icon_task_id = icon_task_id self.id = id self.name = name self.template = template class BuildDefinitionTemplate3_2(Model): """ For back-compat with extensions that use the old Steps format instead of Process and Phases :param can_delete: :type can_delete: bool :param category: :type category: str :param default_hosted_queue: :type default_hosted_queue: str :param description: :type description: str :param icons: :type icons: dict :param icon_task_id: :type icon_task_id: str :param id: :type id: str :param name: :type name: str :param template: :type template: :class:`BuildDefinition3_2 ` """ _attribute_map = { 'can_delete': {'key': 'canDelete', 'type': 'bool'}, 'category': {'key': 'category', 'type': 'str'}, 'default_hosted_queue': {'key': 'defaultHostedQueue', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'icons': {'key': 'icons', 'type': '{str}'}, 'icon_task_id': {'key': 'iconTaskId', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'template': {'key': 'template', 'type': 'BuildDefinition3_2'} } def __init__(self, can_delete=None, category=None, default_hosted_queue=None, description=None, icons=None, icon_task_id=None, id=None, name=None, template=None): super(BuildDefinitionTemplate3_2, self).__init__() self.can_delete = can_delete self.category = category self.default_hosted_queue = default_hosted_queue self.description = description self.icons = icons self.icon_task_id = icon_task_id self.id = id self.name = name self.template = template class BuildDefinitionVariable(Model): """ Represents a variable used by a build definition. :param allow_override: Indicates whether the value can be set at queue time. :type allow_override: bool :param is_secret: Indicates whether the variable's value is a secret. :type is_secret: bool :param value: The value of the variable. :type value: str """ _attribute_map = { 'allow_override': {'key': 'allowOverride', 'type': 'bool'}, 'is_secret': {'key': 'isSecret', 'type': 'bool'}, 'value': {'key': 'value', 'type': 'str'} } def __init__(self, allow_override=None, is_secret=None, value=None): super(BuildDefinitionVariable, self).__init__() self.allow_override = allow_override self.is_secret = is_secret self.value = value class BuildLogReference(Model): """ Represents a reference to a build log. :param id: The ID of the log. :type id: int :param type: The type of the log location. :type type: str :param url: A full link to the log resource. :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, type=None, url=None): super(BuildLogReference, self).__init__() self.id = id self.type = type self.url = url class BuildMetric(Model): """ Represents metadata about builds in the system. :param date: The date for the scope. :type date: datetime :param int_value: The value. :type int_value: int :param name: The name of the metric. :type name: str :param scope: The scope. :type scope: str """ _attribute_map = { 'date': {'key': 'date', 'type': 'iso-8601'}, 'int_value': {'key': 'intValue', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'scope': {'key': 'scope', 'type': 'str'} } def __init__(self, date=None, int_value=None, name=None, scope=None): super(BuildMetric, self).__init__() self.date = date self.int_value = int_value self.name = name self.scope = scope class BuildOption(Model): """ Represents the application of an optional behavior to a build definition. :param definition: A reference to the build option. :type definition: :class:`BuildOptionDefinitionReference ` :param enabled: Indicates whether the behavior is enabled. :type enabled: bool :param inputs: :type inputs: dict """ _attribute_map = { 'definition': {'key': 'definition', 'type': 'BuildOptionDefinitionReference'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'inputs': {'key': 'inputs', 'type': '{str}'} } def __init__(self, definition=None, enabled=None, inputs=None): super(BuildOption, self).__init__() self.definition = definition self.enabled = enabled self.inputs = inputs class BuildOptionDefinitionReference(Model): """ Represents a reference to a build option definition. :param id: The ID of the referenced build option. :type id: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'} } def __init__(self, id=None): super(BuildOptionDefinitionReference, self).__init__() self.id = id class BuildOptionGroupDefinition(Model): """ Represents a group of inputs for a build option. :param display_name: The name of the group to display in the UI. :type display_name: str :param is_expanded: Indicates whether the group is initially displayed as expanded in the UI. :type is_expanded: bool :param name: The internal name of the group. :type name: str """ _attribute_map = { 'display_name': {'key': 'displayName', 'type': 'str'}, 'is_expanded': {'key': 'isExpanded', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, display_name=None, is_expanded=None, name=None): super(BuildOptionGroupDefinition, self).__init__() self.display_name = display_name self.is_expanded = is_expanded self.name = name class BuildOptionInputDefinition(Model): """ Represents an input for a build option. :param default_value: The default value. :type default_value: str :param group_name: The name of the input group that this input belongs to. :type group_name: str :param help: :type help: dict :param label: The label for the input. :type label: str :param name: The name of the input. :type name: str :param options: :type options: dict :param required: Indicates whether the input is required to have a value. :type required: bool :param type: Indicates the type of the input value. :type type: object :param visible_rule: The rule that is applied to determine whether the input is visible in the UI. :type visible_rule: str """ _attribute_map = { 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'help': {'key': 'help', 'type': '{str}'}, 'label': {'key': 'label', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'options': {'key': 'options', 'type': '{str}'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'object'}, 'visible_rule': {'key': 'visibleRule', 'type': 'str'} } def __init__(self, default_value=None, group_name=None, help=None, label=None, name=None, options=None, required=None, type=None, visible_rule=None): super(BuildOptionInputDefinition, self).__init__() self.default_value = default_value self.group_name = group_name self.help = help self.label = label self.name = name self.options = options self.required = required self.type = type self.visible_rule = visible_rule class BuildReportMetadata(Model): """ Represents information about a build report. :param build_id: The Id of the build. :type build_id: int :param content: The content of the report. :type content: str :param type: The type of the report. :type type: str """ _attribute_map = { 'build_id': {'key': 'buildId', 'type': 'int'}, 'content': {'key': 'content', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, build_id=None, content=None, type=None): super(BuildReportMetadata, self).__init__() self.build_id = build_id self.content = content self.type = type class BuildRepository(Model): """ Represents a repository used by a build definition. :param checkout_submodules: Indicates whether to checkout submodules. :type checkout_submodules: bool :param clean: Indicates whether to clean the target folder when getting code from the repository. :type clean: str :param default_branch: The name of the default branch. :type default_branch: str :param id: The ID of the repository. :type id: str :param name: The friendly name of the repository. :type name: str :param properties: :type properties: dict :param root_folder: The root folder. :type root_folder: str :param type: The type of the repository. :type type: str :param url: The URL of the repository. :type url: str """ _attribute_map = { 'checkout_submodules': {'key': 'checkoutSubmodules', 'type': 'bool'}, 'clean': {'key': 'clean', 'type': 'str'}, 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'root_folder': {'key': 'rootFolder', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, checkout_submodules=None, clean=None, default_branch=None, id=None, name=None, properties=None, root_folder=None, type=None, url=None): super(BuildRepository, self).__init__() self.checkout_submodules = checkout_submodules self.clean = clean self.default_branch = default_branch self.id = id self.name = name self.properties = properties self.root_folder = root_folder self.type = type self.url = url class BuildRequestValidationResult(Model): """ Represents the result of validating a build request. :param message: The message associated with the result. :type message: str :param result: The result. :type result: object """ _attribute_map = { 'message': {'key': 'message', 'type': 'str'}, 'result': {'key': 'result', 'type': 'object'} } def __init__(self, message=None, result=None): super(BuildRequestValidationResult, self).__init__() self.message = message self.result = result class BuildResourceUsage(Model): """ Represents information about resources used by builds in the system. :param distributed_task_agents: The number of build agents. :type distributed_task_agents: int :param paid_private_agent_slots: The number of paid private agent slots. :type paid_private_agent_slots: int :param total_usage: The total usage. :type total_usage: int :param xaml_controllers: The number of XAML controllers. :type xaml_controllers: int """ _attribute_map = { 'distributed_task_agents': {'key': 'distributedTaskAgents', 'type': 'int'}, 'paid_private_agent_slots': {'key': 'paidPrivateAgentSlots', 'type': 'int'}, 'total_usage': {'key': 'totalUsage', 'type': 'int'}, 'xaml_controllers': {'key': 'xamlControllers', 'type': 'int'} } def __init__(self, distributed_task_agents=None, paid_private_agent_slots=None, total_usage=None, xaml_controllers=None): super(BuildResourceUsage, self).__init__() self.distributed_task_agents = distributed_task_agents self.paid_private_agent_slots = paid_private_agent_slots self.total_usage = total_usage self.xaml_controllers = xaml_controllers class BuildSettings(Model): """ Represents system-wide build settings. :param days_to_keep_deleted_builds_before_destroy: The number of days to keep records of deleted builds. :type days_to_keep_deleted_builds_before_destroy: int :param default_retention_policy: The default retention policy. :type default_retention_policy: :class:`RetentionPolicy ` :param maximum_retention_policy: The maximum retention policy. :type maximum_retention_policy: :class:`RetentionPolicy ` """ _attribute_map = { 'days_to_keep_deleted_builds_before_destroy': {'key': 'daysToKeepDeletedBuildsBeforeDestroy', 'type': 'int'}, 'default_retention_policy': {'key': 'defaultRetentionPolicy', 'type': 'RetentionPolicy'}, 'maximum_retention_policy': {'key': 'maximumRetentionPolicy', 'type': 'RetentionPolicy'} } def __init__(self, days_to_keep_deleted_builds_before_destroy=None, default_retention_policy=None, maximum_retention_policy=None): super(BuildSettings, self).__init__() self.days_to_keep_deleted_builds_before_destroy = days_to_keep_deleted_builds_before_destroy self.default_retention_policy = default_retention_policy self.maximum_retention_policy = maximum_retention_policy class Change(Model): """ Represents a change associated with a build. :param author: The author of the change. :type author: :class:`IdentityRef ` :param display_uri: The location of a user-friendly representation of the resource. :type display_uri: str :param id: The identifier for the change. For a commit, this would be the SHA1. For a TFVC changeset, this would be the changeset ID. :type id: str :param location: The location of the full representation of the resource. :type location: str :param message: The description of the change. This might be a commit message or changeset description. :type message: str :param message_truncated: Indicates whether the message was truncated. :type message_truncated: bool :param pusher: The person or process that pushed the change. :type pusher: str :param timestamp: The timestamp for the change. :type timestamp: datetime :param type: The type of change. "commit", "changeset", etc. :type type: str """ _attribute_map = { 'author': {'key': 'author', 'type': 'IdentityRef'}, 'display_uri': {'key': 'displayUri', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'location': {'key': 'location', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'}, 'message_truncated': {'key': 'messageTruncated', 'type': 'bool'}, 'pusher': {'key': 'pusher', 'type': 'str'}, 'timestamp': {'key': 'timestamp', 'type': 'iso-8601'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, author=None, display_uri=None, id=None, location=None, message=None, message_truncated=None, pusher=None, timestamp=None, type=None): super(Change, self).__init__() self.author = author self.display_uri = display_uri self.id = id self.location = location self.message = message self.message_truncated = message_truncated self.pusher = pusher self.timestamp = timestamp self.type = type class DataSourceBindingBase(Model): """ Represents binding of data source for the service endpoint request. :param callback_context_template: Pagination format supported by this data source(ContinuationToken/SkipTop). :type callback_context_template: str :param callback_required_template: Subsequent calls needed? :type callback_required_template: str :param data_source_name: Gets or sets the name of the data source. :type data_source_name: str :param endpoint_id: Gets or sets the endpoint Id. :type endpoint_id: str :param endpoint_url: Gets or sets the url of the service endpoint. :type endpoint_url: str :param headers: Gets or sets the authorization headers. :type headers: list of :class:`AuthorizationHeader ` :param initial_context_template: Defines the initial value of the query params :type initial_context_template: str :param parameters: Gets or sets the parameters for the data source. :type parameters: dict :param request_content: Gets or sets http request body :type request_content: str :param request_verb: Gets or sets http request verb :type request_verb: str :param result_selector: Gets or sets the result selector. :type result_selector: str :param result_template: Gets or sets the result template. :type result_template: str :param target: Gets or sets the target of the data source. :type target: str """ _attribute_map = { 'callback_context_template': {'key': 'callbackContextTemplate', 'type': 'str'}, 'callback_required_template': {'key': 'callbackRequiredTemplate', 'type': 'str'}, 'data_source_name': {'key': 'dataSourceName', 'type': 'str'}, 'endpoint_id': {'key': 'endpointId', 'type': 'str'}, 'endpoint_url': {'key': 'endpointUrl', 'type': 'str'}, 'headers': {'key': 'headers', 'type': '[AuthorizationHeader]'}, 'initial_context_template': {'key': 'initialContextTemplate', 'type': 'str'}, 'parameters': {'key': 'parameters', 'type': '{str}'}, 'request_content': {'key': 'requestContent', 'type': 'str'}, 'request_verb': {'key': 'requestVerb', 'type': 'str'}, 'result_selector': {'key': 'resultSelector', 'type': 'str'}, 'result_template': {'key': 'resultTemplate', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, callback_context_template=None, callback_required_template=None, data_source_name=None, endpoint_id=None, endpoint_url=None, headers=None, initial_context_template=None, parameters=None, request_content=None, request_verb=None, result_selector=None, result_template=None, target=None): super(DataSourceBindingBase, self).__init__() self.callback_context_template = callback_context_template self.callback_required_template = callback_required_template self.data_source_name = data_source_name self.endpoint_id = endpoint_id self.endpoint_url = endpoint_url self.headers = headers self.initial_context_template = initial_context_template self.parameters = parameters self.request_content = request_content self.request_verb = request_verb self.result_selector = result_selector self.result_template = result_template self.target = target class DefinitionReference(Model): """ Represents a reference to a definition. :param created_date: The date this version of the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None): super(DefinitionReference, self).__init__() self.created_date = created_date self.id = id self.name = name self.path = path self.project = project self.queue_status = queue_status self.revision = revision self.type = type self.uri = uri self.url = url class DefinitionResourceReference(Model): """ :param authorized: Indicates whether the resource is authorized for use. :type authorized: bool :param id: The id of the resource. :type id: str :param name: A friendly name for the resource. :type name: str :param type: The type of the resource. :type type: str """ _attribute_map = { 'authorized': {'key': 'authorized', 'type': 'bool'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'} } def __init__(self, authorized=None, id=None, name=None, type=None): super(DefinitionResourceReference, self).__init__() self.authorized = authorized self.id = id self.name = name self.type = type class Deployment(Model): """ Represents the data from the build information nodes for type "DeploymentInformation" for xaml builds :param type: :type type: str """ _attribute_map = { 'type': {'key': 'type', 'type': 'str'} } def __init__(self, type=None): super(Deployment, self).__init__() self.type = type class Folder(Model): """ Represents a folder that contains build definitions. :param created_by: The process or person who created the folder. :type created_by: :class:`IdentityRef ` :param created_on: The date the folder was created. :type created_on: datetime :param description: The description. :type description: str :param last_changed_by: The process or person that last changed the folder. :type last_changed_by: :class:`IdentityRef ` :param last_changed_date: The date the folder was last changed. :type last_changed_date: datetime :param path: The full path. :type path: str :param project: The project. :type project: :class:`TeamProjectReference ` """ _attribute_map = { 'created_by': {'key': 'createdBy', 'type': 'IdentityRef'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'last_changed_by': {'key': 'lastChangedBy', 'type': 'IdentityRef'}, 'last_changed_date': {'key': 'lastChangedDate', 'type': 'iso-8601'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'} } def __init__(self, created_by=None, created_on=None, description=None, last_changed_by=None, last_changed_date=None, path=None, project=None): super(Folder, self).__init__() self.created_by = created_by self.created_on = created_on self.description = description self.last_changed_by = last_changed_by self.last_changed_date = last_changed_date self.path = path self.project = project class GraphSubjectBase(Model): """ :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None): super(GraphSubjectBase, self).__init__() self._links = _links self.descriptor = descriptor self.display_name = display_name self.url = url class IdentityRef(GraphSubjectBase): """ :param _links: This field contains zero or more interesting links about the graph subject. These links may be invoked to obtain additional relationships or more detailed information about this graph subject. :type _links: :class:`ReferenceLinks ` :param descriptor: The descriptor is the primary way to reference the graph subject while the system is running. This field will uniquely identify the same graph subject across both Accounts and Organizations. :type descriptor: str :param display_name: This is the non-unique display name of the graph subject. To change this field, you must alter its value in the source provider. :type display_name: str :param url: This url is the full route to the source resource of this graph subject. :type url: str :param directory_alias: Deprecated - Can be retrieved by querying the Graph user referenced in the "self" entry of the IdentityRef "_links" dictionary :type directory_alias: str :param id: :type id: str :param image_url: Deprecated - Available in the "avatar" entry of the IdentityRef "_links" dictionary :type image_url: str :param inactive: Deprecated - Can be retrieved by querying the Graph membership state referenced in the "membershipState" entry of the GraphUser "_links" dictionary :type inactive: bool :param is_aad_identity: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsAadUserType/Descriptor.IsAadGroupType) :type is_aad_identity: bool :param is_container: Deprecated - Can be inferred from the subject type of the descriptor (Descriptor.IsGroupType) :type is_container: bool :param is_deleted_in_origin: :type is_deleted_in_origin: bool :param profile_url: Deprecated - not in use in most preexisting implementations of ToIdentityRef :type profile_url: str :param unique_name: Deprecated - use Domain+PrincipalName instead :type unique_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'descriptor': {'key': 'descriptor', 'type': 'str'}, 'display_name': {'key': 'displayName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'directory_alias': {'key': 'directoryAlias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'image_url': {'key': 'imageUrl', 'type': 'str'}, 'inactive': {'key': 'inactive', 'type': 'bool'}, 'is_aad_identity': {'key': 'isAadIdentity', 'type': 'bool'}, 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'is_deleted_in_origin': {'key': 'isDeletedInOrigin', 'type': 'bool'}, 'profile_url': {'key': 'profileUrl', 'type': 'str'}, 'unique_name': {'key': 'uniqueName', 'type': 'str'} } def __init__(self, _links=None, descriptor=None, display_name=None, url=None, directory_alias=None, id=None, image_url=None, inactive=None, is_aad_identity=None, is_container=None, is_deleted_in_origin=None, profile_url=None, unique_name=None): super(IdentityRef, self).__init__(_links=_links, descriptor=descriptor, display_name=display_name, url=url) self.directory_alias = directory_alias self.id = id self.image_url = image_url self.inactive = inactive self.is_aad_identity = is_aad_identity self.is_container = is_container self.is_deleted_in_origin = is_deleted_in_origin self.profile_url = profile_url self.unique_name = unique_name class Issue(Model): """ Represents an issue (error, warning) associated with a build. :param category: The category. :type category: str :param data: :type data: dict :param message: A description of the issue. :type message: str :param type: The type (error, warning) of the issue. :type type: object """ _attribute_map = { 'category': {'key': 'category', 'type': 'str'}, 'data': {'key': 'data', 'type': '{str}'}, 'message': {'key': 'message', 'type': 'str'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, category=None, data=None, message=None, type=None): super(Issue, self).__init__() self.category = category self.data = data self.message = message self.type = type class JsonPatchOperation(Model): """ The JSON model for a JSON Patch operation :param from_: The path to copy from for the Move/Copy operation. :type from_: str :param op: The patch operation :type op: object :param path: The path for the operation. In the case of an array, a zero based index can be used to specify the position in the array (e.g. /biscuits/0/name). The "-" character can be used instead of an index to insert at the end of the array (e.g. /biscuits/-). :type path: str :param value: The value for the operation. This is either a primitive or a JToken. :type value: object """ _attribute_map = { 'from_': {'key': 'from', 'type': 'str'}, 'op': {'key': 'op', 'type': 'object'}, 'path': {'key': 'path', 'type': 'str'}, 'value': {'key': 'value', 'type': 'object'} } def __init__(self, from_=None, op=None, path=None, value=None): super(JsonPatchOperation, self).__init__() self.from_ = from_ self.op = op self.path = path self.value = value class ProcessParameters(Model): """ :param data_source_bindings: :type data_source_bindings: list of :class:`DataSourceBindingBase ` :param inputs: :type inputs: list of :class:`TaskInputDefinitionBase ` :param source_definitions: :type source_definitions: list of :class:`TaskSourceDefinitionBase ` """ _attribute_map = { 'data_source_bindings': {'key': 'dataSourceBindings', 'type': '[DataSourceBindingBase]'}, 'inputs': {'key': 'inputs', 'type': '[TaskInputDefinitionBase]'}, 'source_definitions': {'key': 'sourceDefinitions', 'type': '[TaskSourceDefinitionBase]'} } def __init__(self, data_source_bindings=None, inputs=None, source_definitions=None): super(ProcessParameters, self).__init__() self.data_source_bindings = data_source_bindings self.inputs = inputs self.source_definitions = source_definitions class PullRequest(Model): """ Represents a pull request object. These are retrieved from Source Providers. :param _links: The links to other objects related to this object. :type _links: :class:`ReferenceLinks ` :param author: Author of the pull request. :type author: :class:`IdentityRef ` :param current_state: Current state of the pull request, e.g. open, merged, closed, conflicts, etc. :type current_state: str :param description: Description for the pull request. :type description: str :param id: Unique identifier for the pull request :type id: str :param provider_name: The name of the provider this pull request is associated with. :type provider_name: str :param source_branch_ref: Source branch ref of this pull request :type source_branch_ref: str :param source_repository_owner: Owner of the source repository of this pull request :type source_repository_owner: str :param target_branch_ref: Target branch ref of this pull request :type target_branch_ref: str :param target_repository_owner: Owner of the target repository of this pull request :type target_repository_owner: str :param title: Title of the pull request. :type title: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'author': {'key': 'author', 'type': 'IdentityRef'}, 'current_state': {'key': 'currentState', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'provider_name': {'key': 'providerName', 'type': 'str'}, 'source_branch_ref': {'key': 'sourceBranchRef', 'type': 'str'}, 'source_repository_owner': {'key': 'sourceRepositoryOwner', 'type': 'str'}, 'target_branch_ref': {'key': 'targetBranchRef', 'type': 'str'}, 'target_repository_owner': {'key': 'targetRepositoryOwner', 'type': 'str'}, 'title': {'key': 'title', 'type': 'str'} } def __init__(self, _links=None, author=None, current_state=None, description=None, id=None, provider_name=None, source_branch_ref=None, source_repository_owner=None, target_branch_ref=None, target_repository_owner=None, title=None): super(PullRequest, self).__init__() self._links = _links self.author = author self.current_state = current_state self.description = description self.id = id self.provider_name = provider_name self.source_branch_ref = source_branch_ref self.source_repository_owner = source_repository_owner self.target_branch_ref = target_branch_ref self.target_repository_owner = target_repository_owner self.title = title class ReferenceLinks(Model): """ The class to represent a collection of REST reference links. :param links: The readonly view of the links. Because Reference links are readonly, we only want to expose them as read only. :type links: dict """ _attribute_map = { 'links': {'key': 'links', 'type': '{object}'} } def __init__(self, links=None): super(ReferenceLinks, self).__init__() self.links = links class ReleaseReference(Model): """ Reference to a release. :param attempt: Number of Release Attempt. :type attempt: int :param creation_date: Release Creation Date. :type creation_date: datetime :param definition_id: Release definition ID. :type definition_id: int :param environment_creation_date: Environment creation Date. :type environment_creation_date: datetime :param environment_definition_id: Release environment definition ID. :type environment_definition_id: int :param environment_definition_name: Release environment definition name. :type environment_definition_name: str :param environment_id: Release environment ID. :type environment_id: int :param environment_name: Release environment name. :type environment_name: str :param id: Release ID. :type id: int :param name: Release name. :type name: str """ _attribute_map = { 'attempt': {'key': 'attempt', 'type': 'int'}, 'creation_date': {'key': 'creationDate', 'type': 'iso-8601'}, 'definition_id': {'key': 'definitionId', 'type': 'int'}, 'environment_creation_date': {'key': 'environmentCreationDate', 'type': 'iso-8601'}, 'environment_definition_id': {'key': 'environmentDefinitionId', 'type': 'int'}, 'environment_definition_name': {'key': 'environmentDefinitionName', 'type': 'str'}, 'environment_id': {'key': 'environmentId', 'type': 'int'}, 'environment_name': {'key': 'environmentName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, attempt=None, creation_date=None, definition_id=None, environment_creation_date=None, environment_definition_id=None, environment_definition_name=None, environment_id=None, environment_name=None, id=None, name=None): super(ReleaseReference, self).__init__() self.attempt = attempt self.creation_date = creation_date self.definition_id = definition_id self.environment_creation_date = environment_creation_date self.environment_definition_id = environment_definition_id self.environment_definition_name = environment_definition_name self.environment_id = environment_id self.environment_name = environment_name self.id = id self.name = name class RepositoryWebhook(Model): """ Represents a repository's webhook returned from a source provider. :param name: The friendly name of the repository. :type name: str :param types: :type types: list of DefinitionTriggerType :param url: The URL of the repository. :type url: str """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'types': {'key': 'types', 'type': '[object]'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, name=None, types=None, url=None): super(RepositoryWebhook, self).__init__() self.name = name self.types = types self.url = url class ResourceRef(Model): """ :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(ResourceRef, self).__init__() self.id = id self.url = url class RetentionPolicy(Model): """ Represents a retention policy for a build definition. :param artifacts: :type artifacts: list of str :param artifact_types_to_delete: :type artifact_types_to_delete: list of str :param branches: :type branches: list of str :param days_to_keep: The number of days to keep builds. :type days_to_keep: int :param delete_build_record: Indicates whether the build record itself should be deleted. :type delete_build_record: bool :param delete_test_results: Indicates whether to delete test results associated with the build. :type delete_test_results: bool :param minimum_to_keep: The minimum number of builds to keep. :type minimum_to_keep: int """ _attribute_map = { 'artifacts': {'key': 'artifacts', 'type': '[str]'}, 'artifact_types_to_delete': {'key': 'artifactTypesToDelete', 'type': '[str]'}, 'branches': {'key': 'branches', 'type': '[str]'}, 'days_to_keep': {'key': 'daysToKeep', 'type': 'int'}, 'delete_build_record': {'key': 'deleteBuildRecord', 'type': 'bool'}, 'delete_test_results': {'key': 'deleteTestResults', 'type': 'bool'}, 'minimum_to_keep': {'key': 'minimumToKeep', 'type': 'int'} } def __init__(self, artifacts=None, artifact_types_to_delete=None, branches=None, days_to_keep=None, delete_build_record=None, delete_test_results=None, minimum_to_keep=None): super(RetentionPolicy, self).__init__() self.artifacts = artifacts self.artifact_types_to_delete = artifact_types_to_delete self.branches = branches self.days_to_keep = days_to_keep self.delete_build_record = delete_build_record self.delete_test_results = delete_test_results self.minimum_to_keep = minimum_to_keep class SourceProviderAttributes(Model): """ :param name: The name of the source provider. :type name: str :param supported_capabilities: The capabilities supported by this source provider. :type supported_capabilities: dict :param supported_triggers: The types of triggers supported by this source provider. :type supported_triggers: list of :class:`SupportedTrigger ` """ _attribute_map = { 'name': {'key': 'name', 'type': 'str'}, 'supported_capabilities': {'key': 'supportedCapabilities', 'type': '{bool}'}, 'supported_triggers': {'key': 'supportedTriggers', 'type': '[SupportedTrigger]'} } def __init__(self, name=None, supported_capabilities=None, supported_triggers=None): super(SourceProviderAttributes, self).__init__() self.name = name self.supported_capabilities = supported_capabilities self.supported_triggers = supported_triggers class SourceRepositories(Model): """ A set of repositories returned from the source provider. :param continuation_token: A token used to continue this paged request; 'null' if the request is complete :type continuation_token: str :param page_length: The number of repositories requested for each page :type page_length: int :param repositories: A list of repositories :type repositories: list of :class:`SourceRepository ` :param total_page_count: The total number of pages, or '-1' if unknown :type total_page_count: int """ _attribute_map = { 'continuation_token': {'key': 'continuationToken', 'type': 'str'}, 'page_length': {'key': 'pageLength', 'type': 'int'}, 'repositories': {'key': 'repositories', 'type': '[SourceRepository]'}, 'total_page_count': {'key': 'totalPageCount', 'type': 'int'} } def __init__(self, continuation_token=None, page_length=None, repositories=None, total_page_count=None): super(SourceRepositories, self).__init__() self.continuation_token = continuation_token self.page_length = page_length self.repositories = repositories self.total_page_count = total_page_count class SourceRepository(Model): """ Represents a repository returned from a source provider. :param default_branch: The name of the default branch. :type default_branch: str :param full_name: The full name of the repository. :type full_name: str :param id: The ID of the repository. :type id: str :param name: The friendly name of the repository. :type name: str :param properties: :type properties: dict :param source_provider_name: The name of the source provider the repository is from. :type source_provider_name: str :param url: The URL of the repository. :type url: str """ _attribute_map = { 'default_branch': {'key': 'defaultBranch', 'type': 'str'}, 'full_name': {'key': 'fullName', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'source_provider_name': {'key': 'sourceProviderName', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, default_branch=None, full_name=None, id=None, name=None, properties=None, source_provider_name=None, url=None): super(SourceRepository, self).__init__() self.default_branch = default_branch self.full_name = full_name self.id = id self.name = name self.properties = properties self.source_provider_name = source_provider_name self.url = url class SourceRepositoryItem(Model): """ Represents an item in a repository from a source provider. :param is_container: Whether the item is able to have sub-items (e.g., is a folder). :type is_container: bool :param path: The full path of the item, relative to the root of the repository. :type path: str :param type: The type of the item (folder, file, etc). :type type: str :param url: The URL of the item. :type url: str """ _attribute_map = { 'is_container': {'key': 'isContainer', 'type': 'bool'}, 'path': {'key': 'path', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, is_container=None, path=None, type=None, url=None): super(SourceRepositoryItem, self).__init__() self.is_container = is_container self.path = path self.type = type self.url = url class SupportedTrigger(Model): """ :param default_polling_interval: The default interval to wait between polls (only relevant when NotificationType is Polling). :type default_polling_interval: int :param notification_type: How the trigger is notified of changes. :type notification_type: str :param supported_capabilities: The capabilities supported by this trigger. :type supported_capabilities: dict :param type: The type of trigger. :type type: object """ _attribute_map = { 'default_polling_interval': {'key': 'defaultPollingInterval', 'type': 'int'}, 'notification_type': {'key': 'notificationType', 'type': 'str'}, 'supported_capabilities': {'key': 'supportedCapabilities', 'type': '{object}'}, 'type': {'key': 'type', 'type': 'object'} } def __init__(self, default_polling_interval=None, notification_type=None, supported_capabilities=None, type=None): super(SupportedTrigger, self).__init__() self.default_polling_interval = default_polling_interval self.notification_type = notification_type self.supported_capabilities = supported_capabilities self.type = type class TaskAgentPoolReference(Model): """ Represents a reference to an agent pool. :param id: The pool ID. :type id: int :param is_hosted: A value indicating whether or not this pool is managed by the service. :type is_hosted: bool :param name: The pool name. :type name: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'is_hosted': {'key': 'isHosted', 'type': 'bool'}, 'name': {'key': 'name', 'type': 'str'} } def __init__(self, id=None, is_hosted=None, name=None): super(TaskAgentPoolReference, self).__init__() self.id = id self.is_hosted = is_hosted self.name = name class TaskDefinitionReference(Model): """ A reference to a task definition. :param definition_type: The type of task (task or task group). :type definition_type: str :param id: The ID of the task. :type id: str :param version_spec: The version of the task. :type version_spec: str """ _attribute_map = { 'definition_type': {'key': 'definitionType', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'version_spec': {'key': 'versionSpec', 'type': 'str'} } def __init__(self, definition_type=None, id=None, version_spec=None): super(TaskDefinitionReference, self).__init__() self.definition_type = definition_type self.id = id self.version_spec = version_spec class TaskInputDefinitionBase(Model): """ :param aliases: :type aliases: list of str :param default_value: :type default_value: str :param group_name: :type group_name: str :param help_mark_down: :type help_mark_down: str :param label: :type label: str :param name: :type name: str :param options: :type options: dict :param properties: :type properties: dict :param required: :type required: bool :param type: :type type: str :param validation: :type validation: :class:`TaskInputValidation ` :param visible_rule: :type visible_rule: str """ _attribute_map = { 'aliases': {'key': 'aliases', 'type': '[str]'}, 'default_value': {'key': 'defaultValue', 'type': 'str'}, 'group_name': {'key': 'groupName', 'type': 'str'}, 'help_mark_down': {'key': 'helpMarkDown', 'type': 'str'}, 'label': {'key': 'label', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'options': {'key': 'options', 'type': '{str}'}, 'properties': {'key': 'properties', 'type': '{str}'}, 'required': {'key': 'required', 'type': 'bool'}, 'type': {'key': 'type', 'type': 'str'}, 'validation': {'key': 'validation', 'type': 'TaskInputValidation'}, 'visible_rule': {'key': 'visibleRule', 'type': 'str'} } def __init__(self, aliases=None, default_value=None, group_name=None, help_mark_down=None, label=None, name=None, options=None, properties=None, required=None, type=None, validation=None, visible_rule=None): super(TaskInputDefinitionBase, self).__init__() self.aliases = aliases self.default_value = default_value self.group_name = group_name self.help_mark_down = help_mark_down self.label = label self.name = name self.options = options self.properties = properties self.required = required self.type = type self.validation = validation self.visible_rule = visible_rule class TaskInputValidation(Model): """ :param expression: Conditional expression :type expression: str :param message: Message explaining how user can correct if validation fails :type message: str """ _attribute_map = { 'expression': {'key': 'expression', 'type': 'str'}, 'message': {'key': 'message', 'type': 'str'} } def __init__(self, expression=None, message=None): super(TaskInputValidation, self).__init__() self.expression = expression self.message = message class TaskOrchestrationPlanReference(Model): """ Represents a reference to an orchestration plan. :param orchestration_type: The type of the plan. :type orchestration_type: int :param plan_id: The ID of the plan. :type plan_id: str """ _attribute_map = { 'orchestration_type': {'key': 'orchestrationType', 'type': 'int'}, 'plan_id': {'key': 'planId', 'type': 'str'} } def __init__(self, orchestration_type=None, plan_id=None): super(TaskOrchestrationPlanReference, self).__init__() self.orchestration_type = orchestration_type self.plan_id = plan_id class TaskReference(Model): """ Represents a reference to a task. :param id: The ID of the task definition. :type id: str :param name: The name of the task definition. :type name: str :param version: The version of the task definition. :type version: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'version': {'key': 'version', 'type': 'str'} } def __init__(self, id=None, name=None, version=None): super(TaskReference, self).__init__() self.id = id self.name = name self.version = version class TaskSourceDefinitionBase(Model): """ :param auth_key: :type auth_key: str :param endpoint: :type endpoint: str :param key_selector: :type key_selector: str :param selector: :type selector: str :param target: :type target: str """ _attribute_map = { 'auth_key': {'key': 'authKey', 'type': 'str'}, 'endpoint': {'key': 'endpoint', 'type': 'str'}, 'key_selector': {'key': 'keySelector', 'type': 'str'}, 'selector': {'key': 'selector', 'type': 'str'}, 'target': {'key': 'target', 'type': 'str'} } def __init__(self, auth_key=None, endpoint=None, key_selector=None, selector=None, target=None): super(TaskSourceDefinitionBase, self).__init__() self.auth_key = auth_key self.endpoint = endpoint self.key_selector = key_selector self.selector = selector self.target = target class TeamProjectReference(Model): """ Represents a shallow reference to a TeamProject. :param abbreviation: Project abbreviation. :type abbreviation: str :param default_team_image_url: Url to default team identity image. :type default_team_image_url: str :param description: The project's description (if any). :type description: str :param id: Project identifier. :type id: str :param last_update_time: Project last update time. :type last_update_time: datetime :param name: Project name. :type name: str :param revision: Project revision. :type revision: long :param state: Project state. :type state: object :param url: Url to the full version of the object. :type url: str :param visibility: Project visibility. :type visibility: object """ _attribute_map = { 'abbreviation': {'key': 'abbreviation', 'type': 'str'}, 'default_team_image_url': {'key': 'defaultTeamImageUrl', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'id': {'key': 'id', 'type': 'str'}, 'last_update_time': {'key': 'lastUpdateTime', 'type': 'iso-8601'}, 'name': {'key': 'name', 'type': 'str'}, 'revision': {'key': 'revision', 'type': 'long'}, 'state': {'key': 'state', 'type': 'object'}, 'url': {'key': 'url', 'type': 'str'}, 'visibility': {'key': 'visibility', 'type': 'object'} } def __init__(self, abbreviation=None, default_team_image_url=None, description=None, id=None, last_update_time=None, name=None, revision=None, state=None, url=None, visibility=None): super(TeamProjectReference, self).__init__() self.abbreviation = abbreviation self.default_team_image_url = default_team_image_url self.description = description self.id = id self.last_update_time = last_update_time self.name = name self.revision = revision self.state = state self.url = url self.visibility = visibility class TestResultsContext(Model): """ :param build: :type build: :class:`BuildReference ` :param context_type: :type context_type: object :param release: :type release: :class:`ReleaseReference ` """ _attribute_map = { 'build': {'key': 'build', 'type': 'BuildReference'}, 'context_type': {'key': 'contextType', 'type': 'object'}, 'release': {'key': 'release', 'type': 'ReleaseReference'} } def __init__(self, build=None, context_type=None, release=None): super(TestResultsContext, self).__init__() self.build = build self.context_type = context_type self.release = release class TimelineAttempt(Model): """ :param attempt: Gets or sets the attempt of the record. :type attempt: int :param record_id: Gets or sets the record identifier located within the specified timeline. :type record_id: str :param timeline_id: Gets or sets the timeline identifier which owns the record representing this attempt. :type timeline_id: str """ _attribute_map = { 'attempt': {'key': 'attempt', 'type': 'int'}, 'record_id': {'key': 'recordId', 'type': 'str'}, 'timeline_id': {'key': 'timelineId', 'type': 'str'} } def __init__(self, attempt=None, record_id=None, timeline_id=None): super(TimelineAttempt, self).__init__() self.attempt = attempt self.record_id = record_id self.timeline_id = timeline_id class TimelineRecord(Model): """ Represents an entry in a build's timeline. :param _links: :type _links: :class:`ReferenceLinks ` :param attempt: Attempt number of record. :type attempt: int :param change_id: The change ID. :type change_id: int :param current_operation: A string that indicates the current operation. :type current_operation: str :param details: A reference to a sub-timeline. :type details: :class:`TimelineReference ` :param error_count: The number of errors produced by this operation. :type error_count: int :param finish_time: The finish time. :type finish_time: datetime :param id: The ID of the record. :type id: str :param identifier: String identifier that is consistent across attempts. :type identifier: str :param issues: :type issues: list of :class:`Issue ` :param last_modified: The time the record was last modified. :type last_modified: datetime :param log: A reference to the log produced by this operation. :type log: :class:`BuildLogReference ` :param name: The name. :type name: str :param order: An ordinal value relative to other records. :type order: int :param parent_id: The ID of the record's parent. :type parent_id: str :param percent_complete: The current completion percentage. :type percent_complete: int :param previous_attempts: :type previous_attempts: list of :class:`TimelineAttempt ` :param result: The result. :type result: object :param result_code: The result code. :type result_code: str :param start_time: The start time. :type start_time: datetime :param state: The state of the record. :type state: object :param task: A reference to the task represented by this timeline record. :type task: :class:`TaskReference ` :param type: The type of the record. :type type: str :param url: The REST URL of the timeline record. :type url: str :param warning_count: The number of warnings produced by this operation. :type warning_count: int :param worker_name: The name of the agent running the operation. :type worker_name: str """ _attribute_map = { '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'attempt': {'key': 'attempt', 'type': 'int'}, 'change_id': {'key': 'changeId', 'type': 'int'}, 'current_operation': {'key': 'currentOperation', 'type': 'str'}, 'details': {'key': 'details', 'type': 'TimelineReference'}, 'error_count': {'key': 'errorCount', 'type': 'int'}, 'finish_time': {'key': 'finishTime', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'str'}, 'identifier': {'key': 'identifier', 'type': 'str'}, 'issues': {'key': 'issues', 'type': '[Issue]'}, 'last_modified': {'key': 'lastModified', 'type': 'iso-8601'}, 'log': {'key': 'log', 'type': 'BuildLogReference'}, 'name': {'key': 'name', 'type': 'str'}, 'order': {'key': 'order', 'type': 'int'}, 'parent_id': {'key': 'parentId', 'type': 'str'}, 'percent_complete': {'key': 'percentComplete', 'type': 'int'}, 'previous_attempts': {'key': 'previousAttempts', 'type': '[TimelineAttempt]'}, 'result': {'key': 'result', 'type': 'object'}, 'result_code': {'key': 'resultCode', 'type': 'str'}, 'start_time': {'key': 'startTime', 'type': 'iso-8601'}, 'state': {'key': 'state', 'type': 'object'}, 'task': {'key': 'task', 'type': 'TaskReference'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'warning_count': {'key': 'warningCount', 'type': 'int'}, 'worker_name': {'key': 'workerName', 'type': 'str'} } def __init__(self, _links=None, attempt=None, change_id=None, current_operation=None, details=None, error_count=None, finish_time=None, id=None, identifier=None, issues=None, last_modified=None, log=None, name=None, order=None, parent_id=None, percent_complete=None, previous_attempts=None, result=None, result_code=None, start_time=None, state=None, task=None, type=None, url=None, warning_count=None, worker_name=None): super(TimelineRecord, self).__init__() self._links = _links self.attempt = attempt self.change_id = change_id self.current_operation = current_operation self.details = details self.error_count = error_count self.finish_time = finish_time self.id = id self.identifier = identifier self.issues = issues self.last_modified = last_modified self.log = log self.name = name self.order = order self.parent_id = parent_id self.percent_complete = percent_complete self.previous_attempts = previous_attempts self.result = result self.result_code = result_code self.start_time = start_time self.state = state self.task = task self.type = type self.url = url self.warning_count = warning_count self.worker_name = worker_name class TimelineReference(Model): """ Represents a reference to a timeline. :param change_id: The change ID. :type change_id: int :param id: The ID of the timeline. :type id: str :param url: The REST URL of the timeline. :type url: str """ _attribute_map = { 'change_id': {'key': 'changeId', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, change_id=None, id=None, url=None): super(TimelineReference, self).__init__() self.change_id = change_id self.id = id self.url = url class VariableGroupReference(Model): """ Represents a reference to a variable group. :param alias: The Name of the variable group. :type alias: str :param id: The ID of the variable group. :type id: int """ _attribute_map = { 'alias': {'key': 'alias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'} } def __init__(self, alias=None, id=None): super(VariableGroupReference, self).__init__() self.alias = alias self.id = id class WebApiConnectedServiceRef(Model): """ :param id: :type id: str :param url: :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, url=None): super(WebApiConnectedServiceRef, self).__init__() self.id = id self.url = url class XamlBuildControllerReference(Model): """ :param id: Id of the resource :type id: int :param name: Name of the linked resource (definition name, controller name, etc.) :type name: str :param url: Full http link to the resource :type url: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'} } def __init__(self, id=None, name=None, url=None): super(XamlBuildControllerReference, self).__init__() self.id = id self.name = name self.url = url class BuildController(XamlBuildControllerReference): """ :param id: Id of the resource :type id: int :param name: Name of the linked resource (definition name, controller name, etc.) :type name: str :param url: Full http link to the resource :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param created_date: The date the controller was created. :type created_date: datetime :param description: The description of the controller. :type description: str :param enabled: Indicates whether the controller is enabled. :type enabled: bool :param status: The status of the controller. :type status: object :param updated_date: The date the controller was last updated. :type updated_date: datetime :param uri: The controller's URI. :type uri: str """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'description': {'key': 'description', 'type': 'str'}, 'enabled': {'key': 'enabled', 'type': 'bool'}, 'status': {'key': 'status', 'type': 'object'}, 'updated_date': {'key': 'updatedDate', 'type': 'iso-8601'}, 'uri': {'key': 'uri', 'type': 'str'} } def __init__(self, id=None, name=None, url=None, _links=None, created_date=None, description=None, enabled=None, status=None, updated_date=None, uri=None): super(BuildController, self).__init__(id=id, name=name, url=url) self._links = _links self.created_date = created_date self.description = description self.enabled = enabled self.status = status self.updated_date = updated_date self.uri = uri class BuildDefinitionReference(DefinitionReference): """ Represents a reference to a build definition. :param created_date: The date this version of the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. :type drafts: list of :class:`DefinitionReference ` :param latest_build: :type latest_build: :class:`Build ` :param latest_completed_build: :type latest_completed_build: :class:`Build ` :param metrics: :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. :type queue: :class:`AgentPoolQueue ` """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'authored_by': {'key': 'authoredBy', 'type': 'IdentityRef'}, 'draft_of': {'key': 'draftOf', 'type': 'DefinitionReference'}, 'drafts': {'key': 'drafts', 'type': '[DefinitionReference]'}, 'latest_build': {'key': 'latestBuild', 'type': 'Build'}, 'latest_completed_build': {'key': 'latestCompletedBuild', 'type': 'Build'}, 'metrics': {'key': 'metrics', 'type': '[BuildMetric]'}, 'quality': {'key': 'quality', 'type': 'object'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, latest_build=None, latest_completed_build=None, metrics=None, quality=None, queue=None): super(BuildDefinitionReference, self).__init__(created_date=created_date, id=id, name=name, path=path, project=project, queue_status=queue_status, revision=revision, type=type, uri=uri, url=url) self._links = _links self.authored_by = authored_by self.draft_of = draft_of self.drafts = drafts self.latest_build = latest_build self.latest_completed_build = latest_completed_build self.metrics = metrics self.quality = quality self.queue = queue class BuildDefinitionReference3_2(DefinitionReference): """ For back-compat with extensions that use the old Steps format instead of Process and Phases :param created_date: The date this version of the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. :type drafts: list of :class:`DefinitionReference ` :param metrics: :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. :type queue: :class:`AgentPoolQueue ` """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'authored_by': {'key': 'authoredBy', 'type': 'IdentityRef'}, 'draft_of': {'key': 'draftOf', 'type': 'DefinitionReference'}, 'drafts': {'key': 'drafts', 'type': '[DefinitionReference]'}, 'metrics': {'key': 'metrics', 'type': '[BuildMetric]'}, 'quality': {'key': 'quality', 'type': 'object'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, metrics=None, quality=None, queue=None): super(BuildDefinitionReference3_2, self).__init__(created_date=created_date, id=id, name=name, path=path, project=project, queue_status=queue_status, revision=revision, type=type, uri=uri, url=url) self._links = _links self.authored_by = authored_by self.draft_of = draft_of self.drafts = drafts self.metrics = metrics self.quality = quality self.queue = queue class BuildLog(BuildLogReference): """ Represents a build log. :param id: The ID of the log. :type id: int :param type: The type of the log location. :type type: str :param url: A full link to the log resource. :type url: str :param created_on: The date and time the log was created. :type created_on: datetime :param last_changed_on: The date and time the log was last changed. :type last_changed_on: datetime :param line_count: The number of lines in the log. :type line_count: long """ _attribute_map = { 'id': {'key': 'id', 'type': 'int'}, 'type': {'key': 'type', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'created_on': {'key': 'createdOn', 'type': 'iso-8601'}, 'last_changed_on': {'key': 'lastChangedOn', 'type': 'iso-8601'}, 'line_count': {'key': 'lineCount', 'type': 'long'} } def __init__(self, id=None, type=None, url=None, created_on=None, last_changed_on=None, line_count=None): super(BuildLog, self).__init__(id=id, type=type, url=url) self.created_on = created_on self.last_changed_on = last_changed_on self.line_count = line_count class BuildOptionDefinition(BuildOptionDefinitionReference): """ Represents an optional behavior that can be applied to a build definition. :param id: The ID of the referenced build option. :type id: str :param description: The description. :type description: str :param groups: The list of input groups defined for the build option. :type groups: list of :class:`BuildOptionGroupDefinition ` :param inputs: The list of inputs defined for the build option. :type inputs: list of :class:`BuildOptionInputDefinition ` :param name: The name of the build option. :type name: str :param ordinal: A value that indicates the relative order in which the behavior should be applied. :type ordinal: int """ _attribute_map = { 'id': {'key': 'id', 'type': 'str'}, 'description': {'key': 'description', 'type': 'str'}, 'groups': {'key': 'groups', 'type': '[BuildOptionGroupDefinition]'}, 'inputs': {'key': 'inputs', 'type': '[BuildOptionInputDefinition]'}, 'name': {'key': 'name', 'type': 'str'}, 'ordinal': {'key': 'ordinal', 'type': 'int'} } def __init__(self, id=None, description=None, groups=None, inputs=None, name=None, ordinal=None): super(BuildOptionDefinition, self).__init__(id=id) self.description = description self.groups = groups self.inputs = inputs self.name = name self.ordinal = ordinal class Timeline(TimelineReference): """ Represents the timeline of a build. :param change_id: The change ID. :type change_id: int :param id: The ID of the timeline. :type id: str :param url: The REST URL of the timeline. :type url: str :param last_changed_by: The process or person that last changed the timeline. :type last_changed_by: str :param last_changed_on: The time the timeline was last changed. :type last_changed_on: datetime :param records: :type records: list of :class:`TimelineRecord ` """ _attribute_map = { 'change_id': {'key': 'changeId', 'type': 'int'}, 'id': {'key': 'id', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, 'last_changed_by': {'key': 'lastChangedBy', 'type': 'str'}, 'last_changed_on': {'key': 'lastChangedOn', 'type': 'iso-8601'}, 'records': {'key': 'records', 'type': '[TimelineRecord]'} } def __init__(self, change_id=None, id=None, url=None, last_changed_by=None, last_changed_on=None, records=None): super(Timeline, self).__init__(change_id=change_id, id=id, url=url) self.last_changed_by = last_changed_by self.last_changed_on = last_changed_on self.records = records class VariableGroup(VariableGroupReference): """ Represents a variable group. :param alias: The Name of the variable group. :type alias: str :param id: The ID of the variable group. :type id: int :param description: The description. :type description: str :param name: The name of the variable group. :type name: str :param type: The type of the variable group. :type type: str :param variables: :type variables: dict """ _attribute_map = { 'alias': {'key': 'alias', 'type': 'str'}, 'id': {'key': 'id', 'type': 'int'}, 'description': {'key': 'description', 'type': 'str'}, 'name': {'key': 'name', 'type': 'str'}, 'type': {'key': 'type', 'type': 'str'}, 'variables': {'key': 'variables', 'type': '{BuildDefinitionVariable}'} } def __init__(self, alias=None, id=None, description=None, name=None, type=None, variables=None): super(VariableGroup, self).__init__(alias=alias, id=id) self.description = description self.name = name self.type = type self.variables = variables class BuildDefinition(BuildDefinitionReference): """ Represents a build definition. :param created_date: The date this version of the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. :type drafts: list of :class:`DefinitionReference ` :param latest_build: :type latest_build: :class:`Build ` :param latest_completed_build: :type latest_completed_build: :class:`Build ` :param metrics: :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. :type queue: :class:`AgentPoolQueue ` :param badge_enabled: Indicates whether badges are enabled for this definition. :type badge_enabled: bool :param build_number_format: The build number format. :type build_number_format: str :param comment: A save-time comment for the definition. :type comment: str :param demands: :type demands: list of :class:`object ` :param description: The description. :type description: str :param drop_location: The drop location for the definition. :type drop_location: str :param job_authorization_scope: The job authorization scope for builds queued against this definition. :type job_authorization_scope: object :param job_cancel_timeout_in_minutes: The job cancel timeout (in minutes) for builds cancelled by user for this definition. :type job_cancel_timeout_in_minutes: int :param job_timeout_in_minutes: The job execution timeout (in minutes) for builds queued against this definition. :type job_timeout_in_minutes: int :param options: :type options: list of :class:`BuildOption ` :param process: The build process. :type process: :class:`object ` :param process_parameters: The process parameters for this definition. :type process_parameters: :class:`ProcessParameters ` :param properties: :type properties: :class:`object ` :param repository: The repository. :type repository: :class:`BuildRepository ` :param retention_rules: :type retention_rules: list of :class:`RetentionPolicy ` :param tags: :type tags: list of str :param triggers: :type triggers: list of :class:`object ` :param variable_groups: :type variable_groups: list of :class:`VariableGroup ` :param variables: :type variables: dict """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'authored_by': {'key': 'authoredBy', 'type': 'IdentityRef'}, 'draft_of': {'key': 'draftOf', 'type': 'DefinitionReference'}, 'drafts': {'key': 'drafts', 'type': '[DefinitionReference]'}, 'latest_build': {'key': 'latestBuild', 'type': 'Build'}, 'latest_completed_build': {'key': 'latestCompletedBuild', 'type': 'Build'}, 'metrics': {'key': 'metrics', 'type': '[BuildMetric]'}, 'quality': {'key': 'quality', 'type': 'object'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'}, 'badge_enabled': {'key': 'badgeEnabled', 'type': 'bool'}, 'build_number_format': {'key': 'buildNumberFormat', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'description': {'key': 'description', 'type': 'str'}, 'drop_location': {'key': 'dropLocation', 'type': 'str'}, 'job_authorization_scope': {'key': 'jobAuthorizationScope', 'type': 'object'}, 'job_cancel_timeout_in_minutes': {'key': 'jobCancelTimeoutInMinutes', 'type': 'int'}, 'job_timeout_in_minutes': {'key': 'jobTimeoutInMinutes', 'type': 'int'}, 'options': {'key': 'options', 'type': '[BuildOption]'}, 'process': {'key': 'process', 'type': 'object'}, 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, 'properties': {'key': 'properties', 'type': 'object'}, 'repository': {'key': 'repository', 'type': 'BuildRepository'}, 'retention_rules': {'key': 'retentionRules', 'type': '[RetentionPolicy]'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'triggers': {'key': 'triggers', 'type': '[object]'}, 'variable_groups': {'key': 'variableGroups', 'type': '[VariableGroup]'}, 'variables': {'key': 'variables', 'type': '{BuildDefinitionVariable}'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, latest_build=None, latest_completed_build=None, metrics=None, quality=None, queue=None, badge_enabled=None, build_number_format=None, comment=None, demands=None, description=None, drop_location=None, job_authorization_scope=None, job_cancel_timeout_in_minutes=None, job_timeout_in_minutes=None, options=None, process=None, process_parameters=None, properties=None, repository=None, retention_rules=None, tags=None, triggers=None, variable_groups=None, variables=None): super(BuildDefinition, self).__init__(created_date=created_date, id=id, name=name, path=path, project=project, queue_status=queue_status, revision=revision, type=type, uri=uri, url=url, _links=_links, authored_by=authored_by, draft_of=draft_of, drafts=drafts, latest_build=latest_build, latest_completed_build=latest_completed_build, metrics=metrics, quality=quality, queue=queue) self.badge_enabled = badge_enabled self.build_number_format = build_number_format self.comment = comment self.demands = demands self.description = description self.drop_location = drop_location self.job_authorization_scope = job_authorization_scope self.job_cancel_timeout_in_minutes = job_cancel_timeout_in_minutes self.job_timeout_in_minutes = job_timeout_in_minutes self.options = options self.process = process self.process_parameters = process_parameters self.properties = properties self.repository = repository self.retention_rules = retention_rules self.tags = tags self.triggers = triggers self.variable_groups = variable_groups self.variables = variables class BuildDefinition3_2(BuildDefinitionReference3_2): """ For back-compat with extensions that use the old Steps format instead of Process and Phases :param created_date: The date this version of the definition was created. :type created_date: datetime :param id: The ID of the referenced definition. :type id: int :param name: The name of the referenced definition. :type name: str :param path: The folder path of the definition. :type path: str :param project: A reference to the project. :type project: :class:`TeamProjectReference ` :param queue_status: A value that indicates whether builds can be queued against this definition. :type queue_status: object :param revision: The definition revision number. :type revision: int :param type: The type of the definition. :type type: object :param uri: The definition's URI. :type uri: str :param url: The REST URL of the definition. :type url: str :param _links: :type _links: :class:`ReferenceLinks ` :param authored_by: The author of the definition. :type authored_by: :class:`IdentityRef ` :param draft_of: A reference to the definition that this definition is a draft of, if this is a draft definition. :type draft_of: :class:`DefinitionReference ` :param drafts: The list of drafts associated with this definition, if this is not a draft definition. :type drafts: list of :class:`DefinitionReference ` :param metrics: :type metrics: list of :class:`BuildMetric ` :param quality: The quality of the definition document (draft, etc.) :type quality: object :param queue: The default queue for builds run against this definition. :type queue: :class:`AgentPoolQueue ` :param badge_enabled: Indicates whether badges are enabled for this definition :type badge_enabled: bool :param build: :type build: list of :class:`BuildDefinitionStep ` :param build_number_format: The build number format :type build_number_format: str :param comment: The comment entered when saving the definition :type comment: str :param demands: :type demands: list of :class:`object ` :param description: The description :type description: str :param drop_location: The drop location for the definition :type drop_location: str :param job_authorization_scope: The job authorization scope for builds which are queued against this definition :type job_authorization_scope: object :param job_cancel_timeout_in_minutes: The job cancel timeout in minutes for builds which are cancelled by user for this definition :type job_cancel_timeout_in_minutes: int :param job_timeout_in_minutes: The job execution timeout in minutes for builds which are queued against this definition :type job_timeout_in_minutes: int :param latest_build: :type latest_build: :class:`Build ` :param latest_completed_build: :type latest_completed_build: :class:`Build ` :param options: :type options: list of :class:`BuildOption ` :param process_parameters: Process Parameters :type process_parameters: :class:`ProcessParameters ` :param properties: :type properties: :class:`object ` :param repository: The repository :type repository: :class:`BuildRepository ` :param retention_rules: :type retention_rules: list of :class:`RetentionPolicy ` :param tags: :type tags: list of str :param triggers: :type triggers: list of :class:`object ` :param variables: :type variables: dict """ _attribute_map = { 'created_date': {'key': 'createdDate', 'type': 'iso-8601'}, 'id': {'key': 'id', 'type': 'int'}, 'name': {'key': 'name', 'type': 'str'}, 'path': {'key': 'path', 'type': 'str'}, 'project': {'key': 'project', 'type': 'TeamProjectReference'}, 'queue_status': {'key': 'queueStatus', 'type': 'object'}, 'revision': {'key': 'revision', 'type': 'int'}, 'type': {'key': 'type', 'type': 'object'}, 'uri': {'key': 'uri', 'type': 'str'}, 'url': {'key': 'url', 'type': 'str'}, '_links': {'key': '_links', 'type': 'ReferenceLinks'}, 'authored_by': {'key': 'authoredBy', 'type': 'IdentityRef'}, 'draft_of': {'key': 'draftOf', 'type': 'DefinitionReference'}, 'drafts': {'key': 'drafts', 'type': '[DefinitionReference]'}, 'metrics': {'key': 'metrics', 'type': '[BuildMetric]'}, 'quality': {'key': 'quality', 'type': 'object'}, 'queue': {'key': 'queue', 'type': 'AgentPoolQueue'}, 'badge_enabled': {'key': 'badgeEnabled', 'type': 'bool'}, 'build': {'key': 'build', 'type': '[BuildDefinitionStep]'}, 'build_number_format': {'key': 'buildNumberFormat', 'type': 'str'}, 'comment': {'key': 'comment', 'type': 'str'}, 'demands': {'key': 'demands', 'type': '[object]'}, 'description': {'key': 'description', 'type': 'str'}, 'drop_location': {'key': 'dropLocation', 'type': 'str'}, 'job_authorization_scope': {'key': 'jobAuthorizationScope', 'type': 'object'}, 'job_cancel_timeout_in_minutes': {'key': 'jobCancelTimeoutInMinutes', 'type': 'int'}, 'job_timeout_in_minutes': {'key': 'jobTimeoutInMinutes', 'type': 'int'}, 'latest_build': {'key': 'latestBuild', 'type': 'Build'}, 'latest_completed_build': {'key': 'latestCompletedBuild', 'type': 'Build'}, 'options': {'key': 'options', 'type': '[BuildOption]'}, 'process_parameters': {'key': 'processParameters', 'type': 'ProcessParameters'}, 'properties': {'key': 'properties', 'type': 'object'}, 'repository': {'key': 'repository', 'type': 'BuildRepository'}, 'retention_rules': {'key': 'retentionRules', 'type': '[RetentionPolicy]'}, 'tags': {'key': 'tags', 'type': '[str]'}, 'triggers': {'key': 'triggers', 'type': '[object]'}, 'variables': {'key': 'variables', 'type': '{BuildDefinitionVariable}'} } def __init__(self, created_date=None, id=None, name=None, path=None, project=None, queue_status=None, revision=None, type=None, uri=None, url=None, _links=None, authored_by=None, draft_of=None, drafts=None, metrics=None, quality=None, queue=None, badge_enabled=None, build=None, build_number_format=None, comment=None, demands=None, description=None, drop_location=None, job_authorization_scope=None, job_cancel_timeout_in_minutes=None, job_timeout_in_minutes=None, latest_build=None, latest_completed_build=None, options=None, process_parameters=None, properties=None, repository=None, retention_rules=None, tags=None, triggers=None, variables=None): super(BuildDefinition3_2, self).__init__(created_date=created_date, id=id, name=name, path=path, project=project, queue_status=queue_status, revision=revision, type=type, uri=uri, url=url, _links=_links, authored_by=authored_by, draft_of=draft_of, drafts=drafts, metrics=metrics, quality=quality, queue=queue) self.badge_enabled = badge_enabled self.build = build self.build_number_format = build_number_format self.comment = comment self.demands = demands self.description = description self.drop_location = drop_location self.job_authorization_scope = job_authorization_scope self.job_cancel_timeout_in_minutes = job_cancel_timeout_in_minutes self.job_timeout_in_minutes = job_timeout_in_minutes self.latest_build = latest_build self.latest_completed_build = latest_completed_build self.options = options self.process_parameters = process_parameters self.properties = properties self.repository = repository self.retention_rules = retention_rules self.tags = tags self.triggers = triggers self.variables = variables __all__ = [ 'AgentPoolQueue', 'AgentSpecification', 'AggregatedResultsAnalysis', 'AggregatedResultsByOutcome', 'AggregatedResultsDifference', 'AggregatedRunsByOutcome', 'AggregatedRunsByState', 'ArtifactResource', 'AssociatedWorkItem', 'Attachment', 'AuthorizationHeader', 'Build', 'BuildArtifact', 'BuildBadge', 'BuildDefinitionRevision', 'BuildDefinitionStep', 'BuildDefinitionTemplate', 'BuildDefinitionTemplate3_2', 'BuildDefinitionVariable', 'BuildLogReference', 'BuildMetric', 'BuildOption', 'BuildOptionDefinitionReference', 'BuildOptionGroupDefinition', 'BuildOptionInputDefinition', 'BuildReportMetadata', 'BuildRepository', 'BuildRequestValidationResult', 'BuildResourceUsage', 'BuildSettings', 'Change', 'DataSourceBindingBase', 'DefinitionReference', 'DefinitionResourceReference', 'Deployment', 'Folder', 'GraphSubjectBase', 'IdentityRef', 'Issue', 'JsonPatchOperation', 'ProcessParameters', 'PullRequest', 'ReferenceLinks', 'ReleaseReference', 'RepositoryWebhook', 'ResourceRef', 'RetentionPolicy', 'SourceProviderAttributes', 'SourceRepositories', 'SourceRepository', 'SourceRepositoryItem', 'SupportedTrigger', 'TaskAgentPoolReference', 'TaskDefinitionReference', 'TaskInputDefinitionBase', 'TaskInputValidation', 'TaskOrchestrationPlanReference', 'TaskReference', 'TaskSourceDefinitionBase', 'TeamProjectReference', 'TestResultsContext', 'TimelineAttempt', 'TimelineRecord', 'TimelineReference', 'VariableGroupReference', 'WebApiConnectedServiceRef', 'XamlBuildControllerReference', 'BuildController', 'BuildDefinitionReference', 'BuildDefinitionReference3_2', 'BuildLog', 'BuildOptionDefinition', 'Timeline', 'VariableGroup', 'BuildDefinition', 'BuildDefinition3_2', ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/cix/000077500000000000000000000000001360605530400276415ustar00rootroot00000000000000azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/cix/__init__.py000066400000000000000000000021701360605530400317520ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from .models import * from .cix_client import CixClient __all__ = [ 'ConfigurationFile', 'CreatedResources', 'CreatePipelineConnectionInputs', 'DetectedBuildFramework', 'DetectedBuildTarget', 'Operation', 'OperationReference', 'OperationResultReference', 'PipelineConnection', 'ReferenceLinks', 'ResourceCreationParameter', 'TeamProject', 'TeamProjectReference', 'Template', 'TemplateAsset', 'TemplateDataSourceBinding', 'TemplateParameterDefinition', 'TemplateParameters', 'WebApiTeamRef', 'CixClient' ] azure-devops-cli-extension-0.17.0/azure-devops/azext_devops/devops_sdk/v5_1/cix/cix_client.py000066400000000000000000000250511360605530400323370ustar00rootroot00000000000000# -------------------------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for license information. # -------------------------------------------------------------------------------------------- # Generated file, DO NOT EDIT # Changes may cause incorrect behavior and will be lost if the code is regenerated. # -------------------------------------------------------------------------------------------- from msrest import Serializer, Deserializer from ...client import Client from . import models class CixClient(Client): """Cix :param str base_url: Service URL :param Authentication creds: Authenticated credentials. """ def __init__(self, base_url=None, creds=None): super(CixClient, self).__init__(base_url, creds) client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)} self._serialize = Serializer(client_models) self._deserialize = Deserializer(client_models) resource_area_identifier = None def get_configurations(self, project, repository_type=None, repository_id=None, branch=None, service_connection_id=None): """GetConfigurations. [Preview API] Gets a list of existing configuration files for the given repository. :param str project: Project ID or project name :param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc. :param str repository_id: The vendor-specific identifier or the name of the repository, e.g. Microsoft/vscode (GitHub) or e9d82045-ddba-4e01-a63d-2ab9f040af62 (Azure Repos) :param str branch: The repository branch where to look for the configuration file. :param str service_connection_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TfsGit (i.e. Azure Repos). :rtype: [ConfigurationFile] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if repository_type is not None: query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if branch is not None: query_parameters['branch'] = self._serialize.query('branch', branch, 'str') if service_connection_id is not None: query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str') response = self._send(http_method='GET', location_id='8fc87684-9ebc-4c37-ab92-f4ac4a58cb3a', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[ConfigurationFile]', self._unwrap_collection(response)) def create_project_connection(self, create_connection_inputs, project): """CreateProjectConnection. [Preview API] Creates a new Pipeline connection between the provider installation and the specified project. Returns the PipelineConnection object created. :param :class:` ` create_connection_inputs: :param str project: :rtype: :class:` ` """ query_parameters = {} if project is not None: query_parameters['project'] = self._serialize.query('project', project, 'str') content = self._serialize.body(create_connection_inputs, 'CreatePipelineConnectionInputs') response = self._send(http_method='POST', location_id='00df4879-9216-45d5-b38d-4a487b626b2c', version='5.1-preview.1', query_parameters=query_parameters, content=content) return self._deserialize('PipelineConnection', response) def get_detected_build_frameworks(self, project, repository_type=None, repository_id=None, branch=None, detection_type=None, service_connection_id=None): """GetDetectedBuildFrameworks. [Preview API] Returns a list of build frameworks that best match the given repository based on its contents. :param str project: Project ID or project name :param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc. :param str repository_id: The vendor-specific identifier or the name of the repository, e.g. Microsoft/vscode (GitHub) or e9d82045-ddba-4e01-a63d-2ab9f040af62 (Azure Repos) :param str branch: The repository branch to detect build frameworks for. :param str detection_type: :param str service_connection_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TfsGit (i.e. Azure Repos). :rtype: [DetectedBuildFramework] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if repository_type is not None: query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if branch is not None: query_parameters['branch'] = self._serialize.query('branch', branch, 'str') if detection_type is not None: query_parameters['detectionType'] = self._serialize.query('detection_type', detection_type, 'str') if service_connection_id is not None: query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str') response = self._send(http_method='GET', location_id='29a30bab-9efb-4652-bf1b-9269baca0980', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[DetectedBuildFramework]', self._unwrap_collection(response)) def get_template_recommendations(self, project, repository_type=None, repository_id=None, branch=None, service_connection_id=None): """GetTemplateRecommendations. [Preview API] Returns a list of all YAML templates with weighting based on which would best fit the given repository. :param str project: Project ID or project name :param str repository_type: The type of the repository such as GitHub, TfsGit (i.e. Azure Repos), Bitbucket, etc. :param str repository_id: The vendor-specific identifier or the name of the repository, e.g. Microsoft/vscode (GitHub) or e9d82045-ddba-4e01-a63d-2ab9f040af62 (Azure Repos) :param str branch: The repository branch which to find matching templates for. :param str service_connection_id: If specified, the ID of the service endpoint to query. Can only be omitted for providers that do not use service endpoints, e.g. TfsGit (i.e. Azure Repos). :rtype: [Template] """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') query_parameters = {} if repository_type is not None: query_parameters['repositoryType'] = self._serialize.query('repository_type', repository_type, 'str') if repository_id is not None: query_parameters['repositoryId'] = self._serialize.query('repository_id', repository_id, 'str') if branch is not None: query_parameters['branch'] = self._serialize.query('branch', branch, 'str') if service_connection_id is not None: query_parameters['serviceConnectionId'] = self._serialize.query('service_connection_id', service_connection_id, 'str') response = self._send(http_method='GET', location_id='63ea8f13-b563-4be7-bc31-3a96eda27220', version='5.1-preview.1', route_values=route_values, query_parameters=query_parameters) return self._deserialize('[Template]', self._unwrap_collection(response)) def create_resources(self, creation_parameters, project): """CreateResources. [Preview API] :param {ResourceCreationParameter} creation_parameters: :param str project: Project ID or project name :rtype: :class:` ` """ route_values = {} if project is not None: route_values['project'] = self._serialize.url('project', project, 'str') content = self._serialize.body(creation_parameters, '{ResourceCreationParameter}') response = self._send(http_method='POST', location_id='43201899-7690-4870-9c79-ab69605f21ed', version='5.1-preview.1', route_values=route_values, content=content) return self._deserialize('CreatedResources', response) def render_template(self, template_parameters, template_id): """RenderTemplate. [Preview API] :param :class:` ` template_parameters: :param str template_id: :rtype: :class:`